0

I have a need to calculate the CDF of a truncated normal distribution in an AnyLogic model. I haven't found any java packages that would work (but would take recommendations). I did find a package in R called truncnorm that will work for me. However, I'm struggling to figure out the best way to call the truncnorm R package. I'm experimenting with JRI in the rJava package. My plan is to add JRI as a .jar file to the Dependencies section of my AnyLogic model but I'm struggling to get it working so far.

Any other suggestions for how to do this before I keep beating my head against the wall with JRI?

Vince
  • 25
  • 5
  • I may have an acceptable workaround, but it doesn't yield the exact same CDF values as _truncnorm_: 1) Create a large (n=100,000) histogram dataset by drawing from a truncated normal distribution; 2) use histogramdataset.getCDF(x) where x=the value at which I want the CDF. – Vince Sep 23 '21 at 23:04
  • Does this answer your question? [AnyLogic simulation how to call R script](https://stackoverflow.com/questions/24558220/anylogic-simulation-how-to-call-r-script) – Felipe Sep 24 '21 at 15:41
  • That thread is where I got the recommendation for JRI. Thanks though! – Vince Sep 25 '21 at 14:08

1 Answers1

1

If you can do the same thing in Python, you can easily call it from AnyLogic by using AnyLogic Pypeline.

Yashar Ahmadov
  • 1,616
  • 2
  • 10
  • 21