<< distfun_geornd Geometric Histogram >>

Distfun >> Distfun > Geometric > distfun_geostat

distfun_geostat

Geometric mean and variance

Calling Sequence

M = distfun_geostat(pr)
[M,V] = distfun_geostat(pr)

Parameters

pr :

a matrix of doubles, the probability of getting success in a Bernoulli trial. pr in (0,1].

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


Report an issue
<< distfun_geornd Geometric Histogram >>