Returns a vector that represents the ratio of positive to
negative values in the specified period..
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Vector<double> PositiveToNegativeRatio(
this Vector<double> vector,
int length,
Vector<double> referenceVariable
)
<ExtensionAttribute>
Public Shared Function PositiveToNegativeRatio (
vector As Vector(Of Double),
length As Integer,
referenceVariable As Vector(Of Double)
) As Vector(Of Double)
public:
[ExtensionAttribute]
static Vector<double>^ PositiveToNegativeRatio(
Vector<double>^ vector,
int length,
Vector<double>^ referenceVariable
)
[<ExtensionAttribute>]
static member PositiveToNegativeRatio :
vector : Vector<float> *
length : int *
referenceVariable : Vector<float> -> Vector<float>
Parameters
- vector
- Type: Extreme.MathematicsVectorDouble
The vector to transform. - length
- Type: SystemInt32
The number of observations in the range. - referenceVariable
- Type: Extreme.MathematicsVectorDouble
A vector
whose observations determine whether the current observation is added to the positive or the negative side of the ratio.
Return Value
Type:
VectorDoubleA vector.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
VectorDouble. 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).
This method calculates the ratio of the sum of observations within the specified period where
the corresponding observation of referenceVariable is positive, and the sum of observations where
referenceVariable is negative.
Reference