Returns a NumericalVariable whose observations are the weighted moving average of the observations of the variable.

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

Syntax

Visual Basic (Declaration)
Public Function GetWeightedMovingAverage ( _
	weights As Double() _
) As NumericalVariable
C#
public NumericalVariable GetWeightedMovingAverage (
	double[] weights
)
C++
public:
NumericalVariable^ GetWeightedMovingAverage (
	array<double>^ weights
)

Parameters

weights ()
A Double array containing the weights.

Return Value

A NumericalVariable.

Remarks

The weights are applied backwards. The first component of weights gives the weight for the current observation, the second component gives the weight for the previous observation, and so on.

The new variable gets the name WMA<n>(<name>), where <name> is the name of the original variable and <n> . is the length of weights.

Exceptions

ExceptionCondition
ArgumentNullExceptionweights is nullNothingnullptr.
ArgumentOutOfRangeExceptioncurrentWeightIndex is less than zero or greater than or equal to the length of weights.