Matvec Users’ Guide
Matvec Users' Guide
Matvec Users' Guide
- 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.
13.2. CONTINUOUS DISTRIBUTION 93<br />
Examples<br />
> D = StatDist("Uniform",1, 4)<br />
UniformDist(1,4)<br />
> D.variance()<br />
0.75<br />
> D.pdf([1,2,3,4])<br />
Col 1 Col 2 Col 3 Col 4<br />
Row 1 0.333333 0.333333 0.333333 0.333333<br />
> D.cdf([1,2,3,4])<br />
Col 1 Col 2 Col 3 Col 4<br />
Row 1 0.00000 0.333333 0.666667 1.00000<br />
> D.inv([0,1/3,2/3,1])<br />
Col 1 Col 2 Col 3 Col 4<br />
Row 1 1.00000 2.00000 3.00000 4.00000<br />
> U.sample(1,3)<br />
Col 1 Col 2 Col 3<br />
Row 1 3.59627 1.36787 2.17816<br />
13.2.3 χ 2 distribution<br />
Definition<br />
The random variable X has a non-central χ 2 distribution if its probability density function (pdf) is defined<br />
by<br />
exp(−(x + λ)/2) ∑ ∞<br />
x r/2+j−1 λ j<br />
f(x) =<br />
2 1 2 r Γ(r/2 + j)2 2j j! , 0 ≤ x < ∞ (13.3)<br />
j=0<br />
where r (integer) and λ (real) are the parameters with their ranges r ≥ 1, λ ≥ 0. The parameter r is<br />
commonly called the degrees of freedom and λ non-centrality parameter. In short, we say X ∼ χ 2 (r, λ).<br />
Alternatively, If Z 1 , Z 2 , . . . , Z r are independent and distributed as N(δ i , 1) then the random variable<br />
r∑<br />
X = Z 2<br />
i=1<br />
is called the non-central χ 2 distribution with r degrees of freedom and non-centrality parameter λ = ∑ r<br />
i=1 δ i.<br />
When λ = 0, the p.d.f of χ 2 (r, λ) reduces to<br />
f(x) =<br />
1<br />
Γ(r/2)2 r/2 xr/2−1 e −x/2 , (13.4)<br />
we say X ∼ χ 2 (r) which is commonly called (central) χ 2 distribution.<br />
The central χ 2 distribution is the special case of Gamma distribution: χ 2 (r) = Γ(r/2, 2)<br />
For example, if X 1 , X 2 , . . . , X n is a sample from N(µ, σ 2 ), then<br />
(n − 1) s2<br />
σ 2 ∼ χ2 (n − 1)<br />
and is independent of the sample mean ¯X.<br />
Properties<br />
1. its moment generation function is<br />
2. E(X) = r + λ, Var(X) = 2(r + 2λ).<br />
M(t) = (1 − 2t) −r/2 λt<br />
exp(<br />
1 − 2t ), t < 1 2<br />
3. If χ 2 (r 1 , λ 1 ) and χ 2 (r 2 , λ 2 ) are independent, then χ 2 (r 1 , λ 1 ) + χ 2 (r 2 , λ 2 ) = χ 2 (r 1 + r 2 , λ 1 + λ 2 )