Matvec Users’ Guide
Matvec Users' Guide
Matvec Users' Guide
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
13.2. CONTINUOUS DISTRIBUTION 97<br />
Properties<br />
1. E(X) = r2(r1+δ)<br />
r 1(r 2−2) , for r 2 > 2<br />
2. Var(X) = 2(r 2 /r 1 ) 2 (r 1+δ) 2 +(r 1+2δ)(r 2−2)<br />
(r 2−2) 2 (r 2−4)<br />
for r 2 > 4<br />
<strong>Matvec</strong> interface<br />
An object of F (r 2 , r 2 , δ) can be created by<br />
D = StatDist("F",r1,r2,delta);<br />
D = StatDist("F",r1,r2);<br />
<strong>Matvec</strong> provided several standard member functions to allow user to access most of properties and<br />
functions of F (r 1 , r 2 , δ):<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 />
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 1 , D.parameter(2) returns r 2 , and D.parameter(3) returns δ.<br />
mean D.mean() returns the expected value.<br />
variance D.variance() returns the variance.<br />
Examples<br />
> D = StatDist("F",5,100,0.5)<br />
FDist(5,100,0.5)<br />
> D.mean()<br />
1.12245<br />
> D.sample(1000).mean()<br />
1.11399<br />
> D.variance()<br />
0.536452<br />
> D.pdf(2)<br />
***ERROR***<br />
FDist::pdf(): not available yet: non-centrality<br />
> D.cdf([0.1,1,3])<br />
Col 1 Col 2 Col 3<br />
Row 1 0.00642900 0.520762 0.976739<br />
> D.inv([0.00642900,0.520762,0.976739])<br />
Col 1 Col 2 Col 3<br />
Row 1 0.100000 1.00000 3.00000