VectorExtensions.PositiveToNegativeIndex Method
Returns a vector that represents an index comparing
positive to negative values in the specified period..
DefinitionPermalink
Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.0
C#
A vector.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.0
public static Vector<double> PositiveToNegativeIndex(
this Vector<double> vector,
int length,
Vector<double> referenceVariable
)
ParametersPermalink
- vector Vector<Double>
- The vector to transform.
- length Int32
- The number of observations in the range.
- referenceVariable Vector<Double>
- A vector whose value determines whether the current observation is added to the positive or the negative side of the ratio.
Return ValuePermalink
Vector<Double>A vector.
Usage NotePermalink
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<Double>. 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).RemarksPermalink
This method calculates an index that compares the sum of observations within the specified period where the corresponding observation of referenceVariable is positive, to the sum of observations where referenceVariable is negative.
ExceptionsPermalink
Argument | length is less than or equal to zero. |
Argument | referenceVariable is null. |
Dimension | The length of referenceVariable does not match the length of the vector. |