IStatistics.NegBinomDist

Fore Syntax

NegBinomDist(FailedTrials: Integer; SuccessfulTrials: Integer; Probability: Double): Double;

Fore.NET Syntax

NegBinomDist(FailedTrials: integer; SuccessfulTrials: integer; Probability: double): double;

Parameters

FailedTrials. The number of failed trials;

SuccessfulTrials. Threshold value of successes;

Probability. Success probability.

Description

The NegBinomDist method returns the negative binomial distribution.

Comments

The function returns the probability for FailedTrials of unsuccessful trials to occur before SuccessfulTrials of successful trials has been achieved, provided that the probability of a successful trial is constant and equal to the Probability argument value. This function is similar to binomial distribution, except for the fact that the number of successes is fixed and the number of trials is variable. Similar to binomial distribution trials, these trials are considered to be independent.

The number of failed trials FailedTrials and threshold value of the number of successful trials SuccessfulTrials must be positive. The following condition must also be met: (FailedTrials + SuccessfulTrials - 1) > 0.

Tolerance range of the Probability parameter: [0; 1].

Fore Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    st: Statistics;
    d0: Double;
Begin
    st := 
New Statistics.Create;
    d0 := st.NegBinomDist(
1050.25);
    
If st.Status <> 0 Then
        Debug.WriteLine(st.Errors);
    
Else
        Debug.WriteLine(
"Negative binomial: " + d0.ToString);
    
End If;
End Sub UserProc;

After executing the example the console window displays value of negative binomial distribution.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Stat;

Public Shared Sub Main(Params: StartParams);
Var
    st: Statistics;
    d0: Double;
Begin
    st := New Statistics.Create();
    d0 := st.NegBinomDist(1050.25);
    If st.Status <> 0 Then
        System.Diagnostics.Debug.WriteLine(st.Errors);
    Else
        System.Diagnostics.Debug.WriteLine("Negative binomial: " + d0.ToString());
    End If;
End Sub;

See also:

IStatistics | Binomial distribution