Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Generate random values of Gamma distribution

    Posted Mon March 28, 2022 02:09 PM
    Hi all,

    I have been looking for posts about random values following specific distribution and find options of using Java or code the pdf mathematically.  

    I would like to try both. But I dont have any basics of Java and pdf of gamma is a integration of the exponential function. 

    I wonder do we have any model examples about how to setup the random numbers following specific distribution?

    Thanks,
    Jia
    #DecisionOptimization


  • 2.  RE: Generate random values of Gamma distribution

    Posted Wed March 30, 2022 12:57 PM
    Hi,

    you could call some java from OPL as can be seen in OPL scripting

    You could also call python:

    import numpy as np
    
    f = np.random.gamma(3, 20, 10)
    print(f)​

    to generate values that you would then use within OPL




    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: Generate random values of Gamma distribution

    Posted Thu March 31, 2022 12:39 PM
    Thank you very much Alex!

    ------------------------------
    Jia
    ------------------------------