<< negbinomial Distribution Functions poisson >>

sci_gsl >> sci_gsl > Distribution Functions > pascal

pascal

Pascal Distribution. The Pascal distribution is simply a negative binomial distribution with an integer value of n.

Syntax

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

Parameters

y:

output

p:

probability of success

n:

number of successes in independent trials. It will be a positive 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 pascal 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 pascal distribution with parameters p and n.

c = 3:

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

c =>4:

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

Description

This function is used to calculate pascal random variate, probability p(k) of obtaining k from a pascal 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
p=0.5
n=3
k=5
c=2
y = pascal(p,n,k,c)
disp(y)

Authors


Report an issue
<< negbinomial Distribution Functions poisson >>