Stats.Covariance Method
Definition
Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Covariance<T>(ValueTuple<Vector<T>, Vector<T>>) | Gets the covariance between two sets of values. |
Covariance<T>(Vector<T>, Vector<T>) | Gets the covariance between two sets of values. |
Covariance<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Boolean) | Gets the covariance between two sets of values. |
Covariance<T>(ValueTuple<Vector<T>, Vector<T>>)
Gets the covariance between two sets of values.
public static double Covariance<T>(
this (Vector<T> , Vector<T> ) data
)
Parameters
- data ValueTuple<Vector<T>, Vector<T>>
- A tuple of two numerical vectors.
Type Parameters
- T
Return Value
DoubleThe covariance between the two sets of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ValueTuple<Vector<T>, Vector<T>>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Argument | One of the vectors in the data tuple is null. |
Dimension | The length of the first vector in data does not equal the length of the second vector. |
Covariance<T>(Vector<T>, Vector<T>)
Gets the covariance between two sets of values.
public static double Covariance<T>(
this Vector<T> values1,
Vector<T> values2
)
Parameters
Type Parameters
- T
Return Value
DoubleThe covariance between the two sets of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Argument | values1 is null. -or- values2 is null. |
Dimension | The length of values1 does not equal the length of values2. |
Covariance<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Boolean)
Gets the covariance between two sets of values.
public static double Covariance<T>(
this ReadOnlySpan<T> values1,
ReadOnlySpan<T> values2,
bool skipMissingValues
)
Parameters
- values1 ReadOnlySpan<T>
- A read-only span.
- values2 ReadOnlySpan<T>
- A read-only span.
- skipMissingValues Boolean
- Optional. Specifies whether missing values should be excluded from the calculation. The default is false.
Type Parameters
- T
Return Value
DoubleThe covariance between the two sets of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Dimension | The length of values1 does not equal the length of values2. |