qis.compute_rolling_mean_adj

qis.compute_rolling_mean_adj(data, mean_adj_type=MeanAdjType.EWMA, span=None, ewm_lambda=0.94, init_type=InitType.X0, init_value=None, nan_backfill=NanBackfill.FFILL)[source]

observations minus their mean path under mean_adj_type; see compute_roll_mean().

Parameters:
  • data (DataFrame | Series | ndarray) – observations, time along the first axis

  • mean_adj_type (MeanAdjType) – which mean is removed; INSAMPLE is forward-looking

  • span (float | ndarray) – EWMA span; overrides ewm_lambda

  • ewm_lambda (float | ndarray) – EWMA decay

  • init_type (InitType) – EWMA seed when init_value is None; X0 makes the first centred value 0

  • init_value (float | ndarray | None) – explicit EWMA seed

  • nan_backfill (NanBackfill) – EWMA missing-observation policy

Returns:

the centred data, same container and shape as data

Raises:

ValueError – if init_type is InitType.VAR, a variance seed for a mean

Return type:

DataFrame | Series | ndarray