qis.unsmooth_returns_ar1_ewma¶
- qis.unsmooth_returns_ar1_ewma(returns, span=20, mean_adj_type=MeanAdjType.EWMA, warmup_period=10, max_value_for_beta=0.75, min_value_for_beta=-0.25, apply_ewma_mean_smoother=True, non_negative=False, non_negative_tol=0.0, insufficient_data=InsufficientData.NAN)[source]¶
rolling AR(1) unsmoother; a shim over
adjust_returns_with_arwithar_order=1.Retained for existing callers and for its AR(1) defaults, which differ from the general engine:
span=20andwarmup_period=10. New code should calladjust_returns_with_ardirectly and state the order.- Parameters:
returns (DataFrame) – observed returns of the appraisal-based series, one column per fund
span (int) – EWM span of the rolling AR(1) beta estimate
mean_adj_type (MeanAdjType) – mean subtracted before estimating the beta; see
MeanAdjTypewarmup_period (int | None) – leading periods blanked while the EWM state converges
max_value_for_beta (float | None) – cap on the estimated beta. The inversion divides by
1 - beta, so the cap is what keeps the denominator away from zero; the default 0.75 holds it at or above 0.25min_value_for_beta (float | None) – floor on the estimated beta, below which negative autocorrelation is treated as noise rather than smoothing
apply_ewma_mean_smoother (bool) – smooth the estimated beta itself before inverting
non_negative (bool) – clip the unsmoothed returns at
non_negative_tolnon_negative_tol (float) – the clipping level used when
non_negativeinsufficient_data (InsufficientData) – what to do with a column that cannot be identified; see
InsufficientData
- Returns:
the unsmoothed returns, the estimated betas and the regression R-squared, each in the shape of
returns- Return type: