Using Beta/Erlang probability distribution

57 views
Skip to first unread message

Moeen

unread,
Jul 14, 2022, 5:10:49 PM7/14/22
to Jaamsim Users Discussion Group
Hi Harry,

Thanks for the support on my previous question regarding saving Entity Attribute. 

My process data follows beta and erlang distribution hence I tried to use probability functions using the fitted parameters but the random data from distribution doesn't behave as expected. 

In the example file, Erlang distribution is used. I have attached a histogram (thanks to your previous solution on log file and plot) using the Jaamsim simulated data (jammsim_log_dist.png), it doesn't follow the real data (dist_param.png) and scipy.stat (erlang_rand.png) generated distribution. The pick is close to 20 minutes whereas in Jaamsim, it's close to 6 minutes. The beta distribution doesn't even work, it hang the program. 

The parameters are

Erlang : a = 2.297, loc = 3.26, scale = 12.47
Beta : a = 2.32, b = 988503529146, loc = 3.22, scale = 12196201903242

Thanks
Wali

dist_param.png
erlang_rand.png
sample_model.cfg
Erlang_input.png
jaamsim_log_dist.png

Harry King

unread,
Jul 15, 2022, 12:28:33 AM7/15/22
to Jaamsim Users Discussion Group
Wali,

There is no standard way to parameterize most probability distributions.  You need to check the documentation for the statistics software you are using and figure out how to calculate the appropriate inputs to the JaamSim probability distribution objects. Wikipedia provides quite a lot of information for each type of distribution. A good way to test whether you have entered the correct input to JaamSim is to look at the CalculatedMean and CalculatedStandardDeviation output for the distribution object. These values are calculated directly from the inputs and should be identical to the mean and standard deviation calculated by your statistics software.

I notice that the data you are trying to fit has a very noticeable preference for certain values. It looks like some of your data was rounded to a series of integer values. You need to process your data to get a smooth probability distribution before you try to fit any of the theoretical distributions (Erlang, beta, etc.).

The Erlang distribution has a integer-valued 'shape' parameter that is usually labelled as 'k'. It is not clear what the parameter 'a' represents.

It is not usual to see a 12-digit values for the 'beta' and 'scale' parameters for the beta distribution. This suggests to me that the beta distribution is probably not a good choice for your data.

My personal opinion is that unless you have a good reason to expect that your data should follow a particular theoretical distribution, you should model the actual data using the ContinuousDistribution object.

Harry

Moeen

unread,
Jul 15, 2022, 5:50:33 PM7/15/22
to Jaamsim Users Discussion Group
Hi Harry,

Thanks a lot for the detail explanation. I followed your suggestion to use ContinuousDistribution object and it worked perfectly. Attached example using the continuous distribution.

Thanks :)
Wali 

jaamsim_log_dist.png
Reply all
Reply to author
Forward
0 new messages