14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

100 CHAPTER 13. STATISTICAL DISTRIBUTIONS<br />

cdf D.cdf(x) returns the cumulative distribution function (cdf) values of x which could be a vector or<br />

matrix.<br />

mgf D.mgf(t) returns the moment-generating function (mgf) values of t which could be a vector or matrix.<br />

inv D.inv(p) is the inverse function of D.cdf(x), where p could be a vector or matrix. That is if p =<br />

D.cdf(x), then x = D.inv(p).<br />

sample D.sample(), D.sample(n), and D.sample(m,n) return a random scalar or a vector of size n or a matrix<br />

of size m by n.<br />

parameter D.parameter(1) returns θ.<br />

mean D.mean() returns the expected value.<br />

variance D.variance() returns the variance.<br />

Examples<br />

> D = StatDist("Exponential",10)<br />

ExponentialDist(10)<br />

> D.sample(1000).mean()<br />

9.69597<br />

> D.pdf([0,2,10])<br />

Col 1 Col 2 Col 3<br />

Row 1 0.100000 0.0818731 0.0367879<br />

> D.cdf([0,2,10])<br />

Col 1 Col 2 Col 3<br />

Row 1 0.00000 0.181269 0.632121<br />

> D.inv([0,0.181269,0.632121])<br />

Col 1 Col 2 Col 3<br />

Row 1 5.63450e-07 2.00000 10.0000<br />

13.2.8 Beta distribution<br />

Definition<br />

The random variable X has a non-central beta distribution if its probability density function is defined by<br />

f(x) = .... (13.10)<br />

where α (real), β (real) and λ (real) are the parameters with their ranges α, β > 0 and λ ≥ 0. In short, we<br />

say X ∼ Beta(α, β, λ).<br />

If λ = 0, then its pdf reduces to<br />

f(x) =<br />

Γ(α + β)<br />

Γ(α)Γ(β) xα−1 (1 − x) β−1 , 0 < x < 1 (13.11)<br />

we say X ∼ Beta(α, β) which is commonly called (central) Beta distribution.<br />

Alternatively, if X 1 ∼ χ 2 (r 1 , λ) and X 2 ∼ χ 2 (r 2 ) are independent, then the ratio<br />

X =<br />

is defined as a non-central beta distribution Beta(r 1 /2, r 2 /2, λ)<br />

Properties<br />

1. for X ∼ Beta(α, β), E(X) = α<br />

α+β , Var(X) =<br />

X 1<br />

X 1 + X 2<br />

(13.12)<br />

αβ<br />

(α+β+1)(α+β) 2 .

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!