Computes the Pearson correlation of two data sets.

Namespace:  CenterSpace.NMath.Stats
Assembly:  NMathStats (in NMathStats.dll) Version: 3.4.0.0

Syntax

C#
public static double Correlation(
	int[] data1,
	int[] data2
)
Visual Basic (Declaration)
Public Shared Function Correlation ( _
	data1 As Integer(), _
	data2 As Integer() _
) As Double
Visual C++
public:
static double Correlation(
	array<int>^ data1, 
	array<int>^ data2
)

Parameters

data1
Type: array< System..::.Int32 >[]()[]
The first data set.
data2
Type: array< System..::.Int32 >[]()[]
The second set set.

Return Value

Correlation.

Exceptions

ExceptionCondition
CenterSpace.NMath.Core..::.InvalidArgumentException Thrown if data has a length of zero or one.
CenterSpace.NMath.Core..::.MismatchedSizeException Thrown if data1 and data2 have different lengths.

See Also