USArmy-Corps-of-Engineers-RMC / Numerics

Numerics is a free and open-source library for .NET developed by USACE-RMC, providing a comprehensive set of methods and algorithms for numerical computations and statistical analysis.
Other
18 stars 2 forks source link

Bernoulli.cs-ValidateParameters() #81

Closed tikigonzo closed 3 weeks ago

tikigonzo commented 1 month ago
/// <summary>
/// Gets and sets the shape parameter α (alpha).
/// </summary>
public double Alpha
{
    get { return _alpha; }
    set
    {
        _parametersValid = ValidateParameters(new[] { value, Beta }, false) is null;
        _alpha = value;
    }
}

/// <summary>
/// Gets and sets the shape parameter β (beta).
/// </summary>
public double Beta
{
    get { return _beta; }
    set
    {
        _parametersValid = ValidateParameters(new[] { Alpha, value }, false) is null;
        _beta = value;
    }
}

There is a bug in here while trying to call alpha and beta inputs in ParametersToString with a beta error. I am not sure what the problem is.

HadenSmith commented 1 month ago

Bernoulli doesn't have those parameters. Maybe you are looking at the Beta distribution?

tikigonzo commented 1 month ago

My apologies, this was a bug that I was looking at for Beta. I figured out that it was a bug when calling ValidateParameters() when I changed the returned Argument Exception to a throw but when I changed it back and adjusted my fail test, everything worked.