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.

Chapter 13<br />

Statistical Distributions<br />

13.1 Introduction<br />

An object of StatDist class can be created as below:<br />

D = StatDist("name",parameter-list)<br />

where<br />

1. name is one of the followings: Uniform, Normal, ChiSquare, t, F, Gamma, Exponential, Beta, DiscreteUniform,<br />

Poisson, Binomial, NegativeBinomial, Geometric. Hypergeometric, Logistic, Laplace,<br />

InverseGaussian, Cauchy, Weibull, Erlang will be added into the list.<br />

2. parameter-list is a list of scalar values required by the corresponding distribution.<br />

Note that some distributions have their non-centrality parameters. The non-centrality parameter is<br />

always the last one in the parameter list. It is automatically set to zero if users don’t provide it explicitly.<br />

There are nine member functions available now.<br />

pdf D.pdf(x) returns the probability density function values of x which could be a vector or matrix.<br />

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

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

inv x = D.inv(p) is the inverse function of D.cdf(x), where p could be a vector or matrix.<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(i) returns the i’th parameter of the distribution.<br />

mean D.mean() returns the first moment (expected value) of the distribution.<br />

variance D.variance() returns the second central moment (variance) of the distribution.<br />

Here are two examples:<br />

> N = StatDist("Normal",0, 10);<br />

> B = StatDist("Binomial",2, 0.1);<br />

89

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

Saved successfully!

Ooh no, something went wrong!