<< distfun_betarnd Beta Binomial >>

distfun >> distfun > Beta > distfun_betastat

distfun_betastat

Beta mean and variance

Calling Sequence

M = distfun_betastat ( a , b )
[M,V] = distfun_betastat ( a , b )

Parameters

a :

a matrix of doubles, the first shape parameter, a>=0.

b :

a matrix of doubles, the first shape parameter, b>=0.

M :

a matrix of doubles, the mean

V :

a matrix of doubles, the variance

Description

Computes statistics from the Beta distribution.

The mean and variance of the Beta distribution are

\begin{eqnarray}
M &=& \frac{a}{a+b} \\
V &=& \frac{ab}{(a+b)^2 (a+b+1)}
\end{eqnarray}

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

Examples

a = 1:6;
b = (1:6)^-1;
[M,V] = distfun_betastat ( a , b )
me = [..
0.5 ..
0.8 ..
0.9 ..
0.9411765..
0.9615385..
0.9729730..
]';
ve = [..
0.0833333..
0.0457143..
0.0207692..
0.0105454..
0.0059649..
0.0036693..
]';

Authors


Report an issue
<< distfun_betarnd Beta Binomial >>