Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

PoissonDistribution InverseDistributionFunction not returning expected value #340

@nwiman

Description

@nwiman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions