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 freq before their period returns are differenced. The EWMA variance recursion and its initialisation come from compute_ewm_vol. For pandas frequency aliases, annualisation uses the native periods-per-year factor for freq, rather than inferring it from the surviving sample. QIS-only schedules retain index-based inference. The first ewma_span estimates are masked while the EWMA state warms up. For unconditional whole-sample TE and IR scalars, use compute_te_ir_errors or compute_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_8H retain 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:

Series

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 with TimePeriod.locate, so the two series share the intended sample.