Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1360-standardlibrary-mathematics-stat-mathsubfunctions-statmathcorrelationpearson.md
T
2026-06-23 21:47:51 +08:00

946 B

MathCorrelationPearson

Calculates the Pearson's correlation coefficient.

Version for working with arrays of real values:

bool  MathCorrelationPearson(
   const double&  array1[],  // the first array of values
   const double&  array2[],  // the second array of values
   double&        r          // correlation coefficient
   )

Version for working with arrays of integer values:

bool  MathCorrelationPearson(
   const int&     array1[],  // the first array of values
   const int&     array2[],  // the second array of values
   double&        r          // correlation coefficient
   )

Parameters

array1[]

[in] The first array of values.

array2[]

[in] The second array of values.

r

[out] Variable to store the correlation coefficient.

Return Value

Returns true if successful, otherwise false.