Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jecc1982 opened this issue Jul 29, 2024 · 0 comments
Open

Comments

@jecc1982
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant