Correlation

Revision as of 20:35, 31 January 2007 by Lchrisman (talk | contribs)

Computes an estimate of the correlation or weighted correlation between two quantities. The correlation is a measure of the degree of linear dependence and ranges between -1 and 1. A correlation of 0 indicates that the two quantities appear to be independent (although if there is a non-linear relationship, this is not necessarily the case), a positive value indicates that they tend to increase together, while a negative correlation indicates that an increase in one quantity tends to be accompanied by a decrease in the other.

Simple Usage

When X and Y are both uncertain quantities, the correlation is computed by

Correlation(X,Y)

Correlation of Data

If you have a data set containing two variables, A and B, where data points are indexed by J, the correlation of A and B is computed using

Correlation(A,B,J)

Here J is referred to as the running index.

If you have an array in which you want to find the correlation of two columns, then you will apply the subscript operator to extract each column. For example, the following computes the correlation between historical revenue in 2002 and 2003 (where data points are indexed by J).

Correlation( HistoricalRevenue[Year=2002], HistoricalRevenue[Year=2003], J )

Weighted Correlation

Unweighted correlation treats all data or sample points as equally weighted. Weighted correlation computes the correlation when each data point may have a different weight. The optional w parameter may be used to specify a weight, which should be indexed by the running index (or by Run if no running index is specified). For example, the following specifies an importance weight:

Correlation( X,Y, w:sampleImportance )

The global sample weighting, specified by the system variable SampleWeighting, is used by default.

Full Declaration

Correlation(X,Y : Numeric ContextSamp[I] ; I : IndexType=Run ; w : NonNegative ContextSamp[I] = SampleWeighting )

Mathematical Details

Weighted correlation is given by [math]\displaystyle{ {\sum_i { w_i \hat{x}_i \hat{y}_i } \over {\sqrt( \sum_i w_i \hat{x}_i^2 \sum_i w_i \hat{y}_i^2} ) } }[/math]

See Also

Comments


Pdavis2

42 months ago
Score 0
It should be easier to find R-square in a search or index. The user might try Rsqure, R-square, or the math-formatted version with an exponent 2..

You are not allowed to post comments.