Previous topic

scikits.timeseries.lib.moving_funcs.mov_average

Next topic

scikits.timeseries.lib.moving_funcs.mov_corr

This Page

scikits.timeseries.lib.moving_funcs.mov_average_expw

mov_average_expw(data, span, tol=9.9999999999999995e-07, dtype=None)

Calculates the exponentially weighted moving average of a series.

Parameters:

data : array-like

Input data, as a sequence or (subclass of) ndarray. Masked arrays and TimeSeries objects are also accepted. The input array should be 1D or 2D at most. If the input array is 2D, the function is applied on each column.

span : int

Time periods. The smoothing factor is 2/(span + 1)

tol : {1e-6, float}, optional

Tolerance for the definition of the mask. When data contains masked values, this parameter determines what points in the result should be masked. Values in the result that would not be “significantly” impacted (as determined by this parameter) by the masked values are left unmasked.

dtype : dtype, optional

Data type of the result.

Returns:

result :

The result is always a masked array (preserves subclass attributes).