Previous topic

scikits.timeseries.lib.moving_funcs.mov_corr

Next topic

scikits.timeseries.lib.moving_funcs.mov_max

This Page

scikits.timeseries.lib.moving_funcs.mov_cov

mov_cov(x, y, span, bias=0, dtype=None)

Calculates the moving covariance of two 1-D arrays.

Parameters:

x : array-like

First array to be included in the calculation. x must be a ndarray or a subclass of ndarray, such as MaskedArray or TimeSeries objects. In that case, the type is saved.

y : array-like

Second array to be included in the calculation. x must be a ndarray or a subclass of ndarray, such as MaskedArray or TimeSeries objects. In that case, the type is saved.

span : int

Size of the filtering window.

dtype : dtype, optional

Data type of the result.

Returns:

result :

The result is always a masked array (preserves subclass attributes). The result at index i uses values from [i-span:i+1], and will be masked for the first span values. The result will also be masked at i if any of the input values in the slice [i-span:i+1] are masked.