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 Vector _ ) As NumericalVariable |
| C# |
|---|
public NumericalVariable GetWeightedMovingAverage ( Vector weights ) |
| C++ |
|---|
public: NumericalVariable^ GetWeightedMovingAverage ( Vector^ weights ) |
Parameters
- weights (Extreme.Mathematics.LinearAlgebra.Vector)
- A Vector 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
| Exception | Condition |
|---|---|
| ArgumentNullException | weights is nullNothingnullptr. |
| ArgumentOutOfRangeException | currentWeightIndex is less than zero or greater than or equal to the length of weights. |