Difference between revisions of "MultiNormal"
(Added example) |
|||
Line 1: | Line 1: | ||
[[Category:Multivariate Distribution Functions]] | [[Category:Multivariate Distribution Functions]] | ||
[[Category:Doc Status D]] <!-- For Lumina use, do not change --> | [[Category:Doc Status D]] <!-- For Lumina use, do not change --> | ||
+ | |||
= MultiNormal( m, s, c, i, j ) = | = MultiNormal( m, s, c, i, j ) = | ||
Line 11: | Line 12: | ||
Multivariate Distribution.ana | Multivariate Distribution.ana | ||
− | = | + | = Example = |
+ | |||
+ | Index I := [1,2,3,4] | ||
+ | Index J := [1,2,3,4] | ||
+ | {| border="1" | ||
+ | |+ Variable M := Table(I) | ||
+ | ! I → !! 1 !! 2 !! 3 !! 4 | ||
+ | |- | ||
+ | | || 10 || -5 || 0 || 7 | ||
+ | |} | ||
+ | |||
+ | {| border="1" | ||
+ | |+ Variable S := Table(I) | ||
+ | ! I → !! 1 !! 4 !! 16 !! 9 | ||
+ | |- | ||
+ | | || 10 || -5 || 0 || 7 | ||
+ | |} | ||
+ | |||
+ | {| border="1" | ||
+ | |+ Variable Cor := Table(I,J) | ||
+ | ! !! !! colspan="4" | I | ||
+ | |- | ||
+ | ! !! !! 1 !! 2 !! 3 !! 4 | ||
+ | |- | ||
+ | ! rowspan="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 | ||
+ | |} | ||
+ | |||
+ | :MultiNormal( M, S, C, I, J ) → | ||
+ | |||
+ | [[image:Gaussian1_2.jpg]] | ||
+ | [[image:Gaussian1_4.jpg]] | ||
+ | [[image:Gaussian2_4.jpg]] | ||
+ | |||
+ | (The above graphs are scatter plots in sample view, using I as the coordinate index.) | ||
+ | |||
+ | == Single Random Sample == | ||
+ | |||
+ | MultiNormal 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( MultiNormal( M, CV, I, J ) ) | ||
− | + | == Independent samples == | |
− | |||
− | + | The Over parameter can also be used with MultiNormal to generate multivariate samples that are independent over additional indexes. For example, to generate an independent MultiNormal for each element of Index K, use: | |
− | MultiNormal( | + | MultiNormal( M, CV, I, J, Over: K ) |
− | |||
= See Also = | = See Also = |
Revision as of 17:58, 2 May 2007
MultiNormal( m, s, c, i, j )
A multi-variate normal (or Gaussian) distribution with mean m, standard deviation s, and correlation matrix cm. m and s may be scalar or indexed by i. cm must be symmetric, positive-definite, and indexed by i & j, which must be the same length.
Multinormal uses a correlation matrix. Compare with Gaussian, which also defines a multi-variate normal but which uses a covariance matrix.
Library
Multivariate Distribution.ana
Example
Index I := [1,2,3,4] Index J := [1,2,3,4]
I → | 1 | 2 | 3 | 4 |
---|---|---|---|---|
10 | -5 | 0 | 7 |
I → | 1 | 4 | 16 | 9 |
---|---|---|---|---|
10 | -5 | 0 | 7 |
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 |
- MultiNormal( M, S, C, I, J ) →
(The above graphs are scatter plots in sample view, using I as the coordinate index.)
Single Random Sample
MultiNormal 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( MultiNormal( M, CV, I, J ) )
Independent samples
The Over parameter can also be used with MultiNormal to generate multivariate samples that are independent over additional indexes. For example, to generate an independent MultiNormal for each element of Index K, use:
MultiNormal( M, CV, I, J, Over: K )
See Also
- Gaussian : Multivariate normal specified using covariance rather than correlation.
- Normal : 1-D normal distribution
- BiNormal, Normal_correl : 2-D normal distributions
- Random
- Correlation : For estimating a sample correlation matrix from data.
Enable comment auto-refresher