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.

96 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 />

nonct D.nonct(cv,p) returns non-centrality value given the critical value (cv) and p value (cdf). Both cv and<br />

p could be either vector or matrix as long as the sizes are the same.<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 r, degree of freedom; whereas D.parameter(2) returns δ, non-centrality parameter.<br />

mean D.mean() returns the expected value of X ∼ t(r, δ).<br />

variance D.variance() returns the variance of X ∼ t(r, δ).<br />

Examples<br />

> D = StatDist("t",15,2)<br />

tDist(15,2)<br />

> D.mean()<br />

2.10746<br />

> D.variance()<br />

1.32782<br />

> D.pdf(2)<br />

***ERROR***<br />

tDist::pdf(): non-centrality: not available<br />

> D.cdf([-1,0,1,5])<br />

Col 1 Col 2 Col 3 Col 4<br />

Row 1 0.00165624 0.0227501 0.158591 0.986127<br />

> D.inv([0.00165624,0.0227501, 0.158591,0.986127])<br />

Col 1 Col 2 Col 3 Col 4<br />

Row 1 -1.00000 -0.000122502 0.999999 5.00002<br />

> D.nonct(5,0.986127)<br />

1.99998<br />

> D.sample(3)<br />

i = 1 i = 2 i = 3<br />

0.952105 2.99387 0.707365<br />

13.2.5 F distribution<br />

Definition<br />

If U 1 ∼ χ 2 (r 1 , δ) and U 2 ∼ χ 2 (r 2 ) are independent then the random variable<br />

X = U 1/r 1<br />

U 2 /r 2<br />

is called the non-central F distribution with r1 (integer) and r2 (integer) degrees of freedom and noncentrality<br />

parameter δ (real), denoted by F (r 1 , r 2 , δ) where r 1 , r 2 ≥ 1 and δ ≥ 0.

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

Saved successfully!

Ooh no, something went wrong!