Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Add a range in standardDeviation function

    Posted 06/30/21 05:25 PM

    I have been trying to add a range when using standardDeviation function in CPLEX, still it notifies me with error. I have not known if it is possible to do so.

    What I want is for the function to work like sum. For example:

    forall(x in rangeX){ sum(y in rangeY)variable[x][y]; }

    Likewise, for standardDeviation function, to calculate std for each variable[x], I expect the code to be like this somehow:

    forall(x in rangeX){ standardDeviation(y in rangeY)variable[x][y]; }

    But the function does not work like that.

    So, how can I specify a range applied for the function?

    Thank you.






    #DecisionOptimization
    #Support
    #SupportMigration


  • 2.  RE: Add a range in standardDeviation function

    Posted 06/30/21 09:54 PM

    I don't think your example is syntactically valid. So it is quite difficult to know how you want to use function standardDeviation. I would suggest you either post a valid OPL model file (or the best version you can write with some errors) or give some description using math symbols, and post the details to Data Science Community https://community.ibm.com/community/user/datascience/communities/community-home/digestviewer?communitykey=ab7de0fd-6f43-47a9-8261-33578a231bb7&tab=digestviewer






    #DecisionOptimization
    #Support
    #SupportMigration


  • 3.  RE: Add a range in standardDeviation function

    Posted 07/01/21 07:18 AM

    I try with:

    forall(x in rangeX){

    standardDeviation(all(y in rangeY) variable[x][y]);

    }

    and it doesn't notify any error so I think function of CPLEX, in general, works like that. I read the documentation for this standardDeviation function but there was no example working with range so I was confused.

    Anyhow, thank you for the answer, I just know about the community existence through your recommendation! I'm learning these stuffs on my own so I didn't know where to reach out for answers.







    #DecisionOptimization
    #Support
    #SupportMigration


  • 4.  RE: Add a range in standardDeviation function

    Posted 07/03/21 12:01 AM

    There is a sample in the documentation at https://www.ibm.com/docs/en/icos/20.1.0?topic=functions-standarddeviation

    using CP; int n = 5; range R = 1..n; dvar int x[R] in R; subject to { ct: standardDeviation(x)<=10; }

    Note that if you want to use standardDeviation in constraints, you need to impose some bounds on the expression. Otherwise, the constraints are not really constraining anything.






    #DecisionOptimization
    #Support
    #SupportMigration