qis.compute_roll_mean¶
- qis.compute_roll_mean(data, mean_adj_type=MeanAdjType.EWMA, span=None, ewm_lambda=0.94, init_value=None, nan_backfill=NanBackfill.FFILL)[source]¶
mean path of each column under a mean-adjustment convention, same shape as the input.
- Parameters:
data (DataFrame | Series | ndarray) – observations, time along the first axis
mean_adj_type (MeanAdjType) –
NONEgives zeros;INSAMPLEthe full-sample mean of each column, ignoring missing values and repeated on every row, which is forward-looking and belongs in descriptive exhibits, never inside a backtest;EXPANDINGthe expanding mean up to each row;EWMAthe EWM mean, point in timeinit_value (float | ndarray) – EWMA seed; the first observation when None
nan_backfill (NanBackfill) – EWMA missing-observation policy
- Returns:
the mean path, same container and shape as
data- Raises:
TypeError – for an unsupported container or
mean_adj_type- Return type: