Correlate With

Revision as of 16:32, 20 April 2007 by Lchrisman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Correlate_With( S, ReferenceS, rankCorr )

Used to specify a distribution having a specified rank correlation with a reference distribution. S is the marginal distribution of the result. ReferenceS is the reference distribution.

Reorders the samples of S so that the result is correlated with the reference sample with a rank correlation close to rankcorr.

Library

Multivariate Distributions.ana

Example

To generate a LogNormal distribution that is highly correlation with Ch1 (which may be any distribution), use e.g.:

Correlate_With( LogNormal(2,3), Ch1, 0.8)

Notes

Most commonly, when the term "correlation" is used, it is implied to mean Pearson Correlation, which is essentially a measure of linearity. Creating a distribution with this measure of correlation makes most sense when the joint distribution is Gaussian, i.e., each marginal distribution is Normal. In this case, you can specify the mean and variance of each variable, and the covariance for each pair of variables, and use the Gaussian function (found in the Multivariate Distribution library) to define the joint distribution. The covariance of two random variables is the correlation of the two variables times the product of their standard deviations, so the Gaussian can be defined directly in terms of Pearson Correlations. The BiNormal function may also be used when defining a 2-D Gaussian.

For non-Gaussian distributions, it is not necessarily possible for two distributions to have a desired Pearson correlation. However, we can ensure a given Rank Correlation, also called Spearman correlation. This is what Correlate_With and Correlate_Dists use.

Correlate_With is the most convenient way for specifying two univariate distributions with a given rank correlation. If you have three or more distributions that are mutually correlated, then you will need a symmetrix matrix of rank correlations, and will need to use the Correlate_Dists function.

Comments


You are not allowed to post comments.