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,
int length,
Vector<double> weights
)
<ExtensionAttribute>
Public Shared Function WeightedMovingAverage (
vector As Vector(Of Double),
length As Integer,
weights As Vector(Of Double)
) As Vector(Of Double)
public:
[ExtensionAttribute]
static Vector<double>^ WeightedMovingAverage(
Vector<double>^ vector,
int length,
Vector<double>^ weights
)
[<ExtensionAttribute>]
static member WeightedMovingAverage :
vector : Vector<float> *
length : int *
weights : Vector<float> -> Vector<float>
Parameters
- vector
- Type: Extreme.MathematicsVectorDouble
The vector to transform. - length
- Type: SystemInt32
The length of the window over which the average should be computed. - weights
- Type: Extreme.MathematicsVectorDouble
A vector of the same length 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).
Each observation is weighted by the corresponding observation in the weight vector.
The new vector gets the name WMA<n>(<name>,<weight>), where
<name> is the name of the original vector, <weight>
is the name of the weight vector, and <n>.
is the length.
Reference