qis.compute_ewma_realised_tracking_error¶
- qis.compute_ewma_realised_tracking_error(portfolio_nav, benchmark_nav, ewma_span=36, freq='ME', is_log_returns=False)[source]¶
Compute annualised EWMA realised (ex-post) tracking error from NAVs.
Both NAVs are resampled to
freqbefore their period returns are differenced. The EWMA variance recursion and its initialisation come fromcompute_ewm_vol. For pandas frequency aliases, annualisation uses the native periods-per-year factor forfreq, rather than inferring it from the surviving sample. QIS-only schedules retain index-based inference. The firstewma_spanestimates are masked while the EWMA state warms up. For unconditional whole-sample TE and IR scalars, usecompute_te_ir_errorsorcompute_info_ratio_table.- Parameters:
portfolio_nav (Series) – Portfolio NAV time series.
benchmark_nav (Series) – Benchmark NAV time series.
ewma_span (int) – EWMA span in periods of
freq.freq (str) – Resampling frequency; pandas aliases also determine annualisation. None keeps the input grid. None and QIS-only schedules such as
D_8Hretain annualisation inferred from the surviving return index.is_log_returns (bool) – If True, use log returns; otherwise use simple returns.
- Returns:
Annualised realised tracking error named
'Tracking error', indexed by the resampled period and NaN during the EWMA warm-up.- Return type:
Note
The join is
pd.concat([...], axis=1, sort=True).dropna(how='all').ffill(). A benchmark NAV starting before the portfolio NAV should be clipped by the caller, for example withTimePeriod.locate, so the two series share the intended sample.