<< logth Distribution Functions pascal >>

sci_gsl >> sci_gsl > Distribution Functions > negbinomial

negbinomial

Negative Binomial Distribution

Syntax

y = negbinomial(p,n,k,c)

Parameters

y:

output

p:

probability of success

n:

number of successes in independent trials. It may be a positive real or integer number.

k:

k is number of failures occuring before n successes in independent trials. It will be a positive integer.

c = 1:

It will generate random integer from the negative binomial distribution, the number of failures occurring before n successes in independent trials with probability p of success. In this case the function is independent of k and hence any value of k can be set.

c = 2:

It will allow the user to compute the probability p(k) of obtaining k from a negative binomial distribution with parameters p and n.

c = 3:

It will allow the user to compute negative binomial cdf P(k)

c =>4:

It will allow the user to compute negative binomial cdf Q(k)

Description

This function is used to calculate negative binomial random variate, probability p(k) of obtaining k from a negative binomial distribution and cumulative distribution functions P(k), Q(k).

Examples

// probability p(k) of obtaining k=5 from negative binomial distribution with  p=0.5 and n=3.5
p=0.5
n=3.5
k=5
c=2
y = negbinomial(p,n,k,c)
disp(y)

Authors


Report an issue
<< logth Distribution Functions pascal >>