| MovingWindowFilterExponentiallyWeightedMovingAverageCoefficients Method |
Returns a vector of exponentially weighted moving average (EWMA) coefficients of length n.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static DoubleVector ExponentiallyWeightedMovingAverageCoefficients(
int n
)
Public Shared Function ExponentiallyWeightedMovingAverageCoefficients (
n As Integer
) As DoubleVector
public:
static DoubleVector^ ExponentiallyWeightedMovingAverageCoefficients(
int n
)
static member ExponentiallyWeightedMovingAverageCoefficients :
n : int -> DoubleVector
Parameters
- n Int32
- Exponential moving average filter length.
Return Value
DoubleVectorThe vector of coefficients implementing an exponentially weighted moving average filter.
Exceptions Remarks As the number of EWMA coefficients increases, the filter will capture at most %86.47 of the total weight
due to the finite length of the filter. The filter length
and the exponential weight
are related by
.
Example
DoubleVector coef = MovingWindowFilter.ExponentiallyWeightedMovingAverageCoefficients( 18 );
MovingWindowFilter EWMAfilter = new MovingWindowFilter( 0, coef.Length - 1, coef );
DoubleVector filtered = EWMAfilter.Filter( data );
See Also