Returns a NumericalVariable that represents the ratio of positive to negative values in the specified period..

Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (Extreme.Numerics)

Syntax

Visual Basic (Declaration)
Public Function GetPositiveToNegativeRatio ( _
	length As Integer, _
	referenceVariable As NumericalVariable _
) As NumericalVariable
C#
public NumericalVariable GetPositiveToNegativeRatio (
	int length,
	NumericalVariable referenceVariable
)
C++
public:
NumericalVariable^ GetPositiveToNegativeRatio (
	int length, 
	NumericalVariable^ referenceVariable
)

Parameters

length (System.Int32)
The number of observations in the range.
referenceVariable (Extreme.Statistics.NumericalVariable)
A NumericalVariable whose observations determine whether the current observation is added to the positive or the negative side of the ratio.

Return Value

A NumericalVariable.

Remarks

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.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionlength is less than or equal to zero.
ArgumentNullExceptionreferenceVariable is nullNothingnullptr.
DimensionMismatchException The length of referenceVariable does not match the length of the variable.