When instantiating an exponential distribution it asks for a rate
val exp = Exponential(1/4)
val cdtAt5 = exp.cdf(5) // gives: 0.9999999979388464, but should be: 0.7134952031398099
I looked at the source code for Exponential and it calls the apache commons math3 ExponentialDistribution, when using pdf and cdf.
That object assumes a mean which would be 4 in the example above.
The crude fix is just to call Exponential with the mean, but that results in the mean function returning the rate instead of the mean.
The fix seems to be to change the calls instantiating ExponentialDistribution, such that it uses the mean instead of the rate in the Exponential.scala file
new ExponentialDistribution(rate) -> new ExponentialDistribution(mean)
Im still very new to statistics so please correct me if Im wrong.
And Github wouldn't let me make a new branch and a pull request
When instantiating an exponential distribution it asks for a rate
I looked at the source code for Exponential and it calls the apache commons math3 ExponentialDistribution, when using pdf and cdf.
That object assumes a mean which would be 4 in the example above. The crude fix is just to call Exponential with the mean, but that results in the mean function returning the rate instead of the mean.
The fix seems to be to change the calls instantiating ExponentialDistribution, such that it uses the mean instead of the rate in the Exponential.scala file
Im still very new to statistics so please correct me if Im wrong. And Github wouldn't let me make a new branch and a pull request