<< distfun_binornd Binomial Chi-Squared >>

Distfun >> Distfun > Binomial > distfun_binostat

distfun_binostat

Binomial mean and variance

Calling Sequence

M = distfun_binostat(N,pr)
[M,V] = distfun_binostat(N,pr)

Parameters

pr :

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

N :

a matrix of doubles , the total number of binomial trials . N belongs to the set {1,2,3,4,.......}

M :

a matrix of doubles, the mean

V :

a matrix of doubles, the variance

Description

Computes statistics from the Binomial 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 Binomial Distribution is:

Examples

// Check with expanded N
N = [10 100 1000 10000]
pr = 0.1
[m,v] = distfun_binostat(N,pr)
me = [1 10 100 1000]
ve = [0.9 9 90 900]

//Check with expanded pr
N = 100
pr = [0.1 0.2 0.3 0.4]
[m,v] = distfun_binostat(N,pr)
me = [10 20 30 40]
ve = [9 16 21 24]

//Check with both N and pr expanded
N = [10 100 1000 10000]
pr = [0.1 0.2 0.3 0.4]
[m,v] = distfun_binostat(N,pr)
me = [1 20 300 4000]
ve = [0.9 16 210 2400]

Bibliography

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

Authors


Report an issue
<< distfun_binornd Binomial Chi-Squared >>