I can't seem to get out the expected result.
For the Poisson with a lambda of 2 and k set to 7 i get 0.99890328103214132 from the 'DistributionFunction'. However when i call the 'InverseDistributionFunction' with that same number i get 9.
var dist = new PoissonDistribution(lambda: 2.0);
double cdf3 = dist.DistributionFunction(k: 7); // 0.998903281032141
int icdf3 = dist.InverseDistributionFunction(p: cdf3); // Expects 7
The result of icdf3 = 9
https://dotnetfiddle.net/cGufGD
This only seems to be in the upper >98%.
Tried to test this in Math.Net but it doesn't implement an InverseCDF.
Can you confirm that I am doing this right and this is a bug?
Or explain how to get the correct result?
Cheers
Wiman