<< distfun_geornd Geometric LogNormal >>

Distfun >> Distfun > Geometric > distfun_geostat

distfun_geostat

Geometric mean and variance

Calling Sequence

M = distfun_geostat(Pr)
[M,V] = distfun_unifstat(Pr)

Parameters

Pr :

a 1x1 or nxm matrix of doubles, the probability of getting success in a Bernoulli trial

M :

a matrix of doubles, the mean

V :

a matrix of doubles, the variance

Description

Computes statistics from the Geometric distribution.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

The Mean and Variance of the Geometric Distribution are

Examples

// Test with expanded Pr
[m,v] = distfun_geostat(1 ./(1:6))
me = [ 0  1.0000  2.0000  3.0000  4.0000  5.0000];
ve = [ 0  2.0000  6.0000  12.0000  20.0000  30.0000];

//Accuracy test
Pr=[0.11 0.22 0.33];
[M,V] = distfun_geostat ( Pr )
ve= [73.553719 16.115702 6.1524334 ];
me = [8.0909091 3.5454545 2.030303 ];

Bibliography

http://en.wikipedia.org/wiki/Geometric_distribution

Authors


<< distfun_geornd Geometric LogNormal >>