Skip to content

Some combination of parameter for PERT Distribution may throw exception #1084

Open
@jecc1982

Description

@jecc1982

Hi

I notice that some combination of parameters of PERT distribution may throw ArgumentException and I am unsure if this is intentional.

        [Theory]
        [InlineData(7.7, 8, 7.9)] // Pass
        [InlineData(7.8, 8, 7.9)] // Exception
        public void TestSamplingFromPertDistribution(double min, double max, double likely)
        {
            double sample = MathNet.Numerics.Distributions.BetaScaled.PERT(min, max, likely).Sample();
            Assert.InRange(sample, min, max);
        }
System.ArgumentException : Invalid parametrization for the distribution.
   at MathNet.Numerics.Distributions.BetaScaled..ctor(Double a, Double b, Double location, Double scale, Random randomSource)
   at MathNet.Numerics.Distributions.BetaScaled.PERT(Double min, Double max, Double likely, Random randomSource)
   at TestSamplingFromPertDistribution(Double min, Double max, Double likely)
   at InvokeStub_ContinuousValueTest.TestSamplingFromPertDistribution(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

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