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(
	DoubleVector data1,
	DoubleVector data2
)
Visual Basic (Declaration)
Public Shared Function Correlation ( _
	data1 As DoubleVector, _
	data2 As DoubleVector _
) As Double
Visual C++
public:
static double Correlation(
	DoubleVector^ data1, 
	DoubleVector^ data2
)

Parameters

data1
Type: CenterSpace.NMath.Core..::.DoubleVector
The first data set.
data2
Type: CenterSpace.NMath.Core..::.DoubleVector
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