Documentation

geostat

Geometric mean and variance

Syntax

[m,v] = geostat(p)

Description

[m,v] = geostat(p)returns the meanmand variancevof a geometric distribution with corresponding probability parameters inp.pcan be a vector, a matrix, or a multidimensional array. The parameters inp必须躺在间隔[0,1].

Examples

collapse all

Define a probability vector that contains six different parameter values.

p = 1./(1:6)
p =1×61.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 =1×60 1.0000 2.0000 3.0000 4.0000 5.0000
v =1×60 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 parameterpequal 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

mean = 1 p p ,

and the variance of the geometric distribution is

var = 1 p p 2 ,

wherepis 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?