Returns a vector whose observations are the weighted
moving average of the observations of the vector.
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Vector<double> WeightedMovingAverage(
this Vector<double> vector,
Vector<double> weights
)
<ExtensionAttribute>
Public Shared Function WeightedMovingAverage (
vector As Vector(Of Double),
weights As Vector(Of Double)
) As Vector(Of Double)
public:
[ExtensionAttribute]
static Vector<double>^ WeightedMovingAverage(
Vector<double>^ vector,
Vector<double>^ weights
)
[<ExtensionAttribute>]
static member WeightedMovingAverage :
vector : Vector<float> *
weights : Vector<float> -> Vector<float>
Parameters
- vector
- Type: Extreme.MathematicsVectorDouble
The vector to transform. - weights
- Type: Extreme.MathematicsVectorDouble
A Vector containing the weights.
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).
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 vector gets the name WMA<n>(<name>), where
<name> is the name of the original vector and <n> .
is the length of weights.
Reference