qis.compute_ewm_std1_norm

qis.compute_ewm_std1_norm(data, span=260, mean_adj_type=MeanAdjType.EWMA, is_demean=True, is_nans_to_zero=True)[source]

smoothed, volatility-normalised signal with unit standard deviation for IID input.

With x~_t the (optionally demeaned) data and sigma_t its EWM volatility about zero, the output is c sqrt(N) EWM(x~ / sigma)_t with N = (1 + lambda) / (1 - lambda), the final EWM starting from a zero seed. Demeaning by the same-span EWMA removes the low-frequency content the final EWM keeps and leaves a standard deviation of 1 / sqrt(1 + lambda) (0.71 at span 260) for IID input, so with is_demean=True and MeanAdjType.EWMA the output is multiplied by c = sqrt(1 + lambda); otherwise c = 1. The output then has unit standard deviation for IID input in the stationary limit, with either setting.

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

  • span (float | ndarray) – EWM span of the mean, the volatility and the smoother

  • mean_adj_type (MeanAdjType) – mean removed when is_demean is True

  • is_demean (bool) – remove the mean before normalising

  • is_nans_to_zero (bool) – replace missing outputs, including the warm-up, by zero

Returns:

the normalised signal, same container as data

Return type:

DataFrame | Series