This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Geometric mean and variance


[m,v] = geostat(p)


[m,v] = geostat(p) returns the mean m and variance v of a geometric distribution with corresponding probability parameters in p. p can be a vector, a matrix, or a multidimensional array. The parameters in p must lie in the interval [0,1].


collapse all

Define a probability vector that contains six different parameter values.

p = 1./(1:6)
p =

    1.0000    0.5000    0.3333    0.2500    0.2000    0.1667

Compute the mean and variance of the geometric distribution that corresponds to each value contained in probability vector.

[m,v] = geostat(1./(1:6))
m =

         0    1.0000    2.0000    3.0000    4.0000    5.0000

v =

         0    2.0000    6.0000   12.0000   20.0000   30.0000

The returned values indicate that, for example, the mean of a geometric distribution with probability parameter p equal to 1/3 is 2, and its variance is 6.

More About

collapse all

Geometric Distribution Mean and Variance

The mean of the geometric distribution is


and the variance of the geometric distribution is


where p is the probability of success.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?