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.

NegativeBinomialDistribution Cum Dist func not returning expected value #327

@jonbarkerlondon

Description

@jonbarkerlondon

Forgive me if I am misusing the library, but I can't seem to get out the expected result.

For the NBD, with a number-of-successes of 71, and a probability of success of 0.9712 and a value of 1, I would expect the 'DistributionFunction' method to return approx 0.382....

However with your library, doing the following:

var distribution = new NegativeBinomialDistribution(71, 0.9712);
var X = distribution.DistributionFunction(1);

The result of X is 1.1102230246251565E-16

Wolfram alpha indicates the result should be 0.382...:
http://www.wolframalpha.com/input/?x=6&y=3&i=negative+binomial+distribution+n%3D71+p%3D0.9712

I also get this result from the Math.NET libraries by doing the following code:

var distribution = new MathNet.Numerics.Distributions.NegativeBinomial(71, 0.9712);
var X = distribution.CumulativeDistribution(1);

The result of X is 0.382

(See https://dotnetfiddle.net/BfeMuz for sample of MathNet)

Can you confirm that I am using the library as expected, and this is a bug? Or alternatively explain how to get the correct result.

Best,
Jon

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