14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

98 CHAPTER 13. STATISTICAL DISTRIBUTIONS<br />

> D.mgf(2)<br />

***ERROR***<br />

FDist:mgf(): not available yet<br />

> D.nonct(3,0.95)<br />

1.626<br />

13.2.6 Gamma distribution<br />

Definition<br />

The random variable X has a gamma distribution if its probability density function is defined by<br />

f(x) =<br />

1<br />

Γ(α)θ α xα−1 e −x/θ , 0 ≤ x < ∞. (13.8)<br />

where α (real) and θ (real) are the parameters with their ranges α, θ > 0. In short, we say X ∼ Gamma(α, θ).<br />

Properties<br />

1. moment generating function<br />

M(t) =<br />

1<br />

(1 − θt) α , t < 1/θ<br />

2. E(X) = αθ, Var(X) = αθ 2<br />

<strong>Matvec</strong> interface<br />

An object of Gamma(α, θ) can be created by<br />

D = StatDist("Gamma",alpha,theta);<br />

<strong>Matvec</strong> provided several standard member functions to allow user to access most of properties and<br />

functions of Gamma(α, θ):<br />

pdf D.pdf(x) returns the probability density function (pdf) values of x which could be a vector or matrix.<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 α, D.parameter(2) returns θ.<br />

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

variance D.variance() returns the variance.

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

Saved successfully!

Ooh no, something went wrong!