<< gaussiantail Distribution Functions hypergeom >>

sci_gsl >> sci_gsl > Distribution Functions > geometric

geometric

Geometric distribution

Syntax

y = geometric(p,k,c)

Parameters

y:

output

p:

probability of success.

k:

k is an integer greater than equal to 1.

c = 1:

It will allow the user to generate a random integer from the geometric distribution, the number of independent trials with probability p until the first 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 geometric distribution with parameter p.

c = 3:

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

c >=4:

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

Description

This function generates geometric random variates, probability p(k) of obtaining k from a geometric distribution and cdf P(k), Q(k)

Examples

// probability p(k) of obtaining k=1 from a geometric distribution with p=0.5.
p=0.5
k=1
c=2
y = geometric(p,k,c)
disp(y)

Authors


Report an issue
<< gaussiantail Distribution Functions hypergeom >>