Gaussian distribution

Revision as of 04:48, 2 May 2007 by Lchrisman (talk | contribs)


Gaussian(meanVec : numeric[I],covar : numeric[I,J]; I,J:IndexType)

A multi-variate Gaussian distribution based on a mean vector and covariance matrix. The covariance matrix must symmetric and positive-definite. The meanVec is indexed by I. The covariance matrix is 2-D, indexed by I & J. Indexes I & J should be the same length.

Library

Multivariate Distributions.ana

Example

Index I := [1,2,3,4]
Index J := [1,2,3,4]
Variable M := Table(I)
I → 1 2 3 4
10 -5 0 7
Variable CV := Table(I,J)
I
1 2 3 4
J 1 1 -0.5 0.3 0.7
2 -0.5 1 -0.8 -0.2
3 0.3 -0.8 1 0.4
4 0.7 -0.2 0.4 1
Gaussian( M, CV, I, J ) →

Gaussian1 2.jpg Gaussian1 4.jpg Gaussian2 4.jpg

(The above graphs are scatter plots in sample view, using I as the coordinate index.)

Single Random Sample

Gaussian may be used with the Random function to generate a single random vector, indexed by I, drawn from the multi-variate Gaussian distribution. Using the above variables, the usage is:

Random( Gaussian( M, CV, I, J ) )

Independent samples

The Over parameter can also be used with Gaussian to generate multivariate samples that are independent over additional indexes. For example, to generate an independent Gaussian for each element of Index K, use:

Gaussian( M, CV, I, J, Over: K )

See Also

Comments


You are not allowed to post comments.