WebCab Options and Futures for COM v3.1

FuturesHedging.PearsonCorrelation Method 

Evaluates the Pearson Correlation Coefficient between two market variables from the historical data provided.

public double PearsonCorrelation(
   double[] historical1,
   double[] historical2
);

Parameters

historical1
An array of historical values where the k-th element of the value of the 1-st market variable during the k-th period considered.
historical2
An array of historical values where the k-th element of the value of the 2-nd market variable during the k-th period considered.

Return Value

The correlation between the two market variables.

Remarks

Note that the market variables in question will be a series of historical values which could represent a stock price, futures price, index level, interest rate and so on.

The correlation indicates the association between two variables. The value of the correlation between two variables will lie within the range [-1,1] where a value of:

  1. +1 indicates that the two variables are perfectly correlated meaning that the two variables move in the same direction and in the same proportion.
  2. -1 indicates that the two variables are perfectly negatively correlation meaning that the two variables move in the opposite direction and in the same proportion.
  3. 0 indicates that there is no discernible correlation between the two variables meaning that information regarding the change of one of the variables does not imply (even statistically) a particular movement in the other variable.

See Also

FuturesHedging Class | WebCab.COM.Finance.Futures Namespace