qis.compute_unsmoothed_price_panel¶
- qis.compute_unsmoothed_price_panel(prices, *, frequency, method, span, warmup_period, is_log_returns, factor_prices=None, mean_adj_type=MeanAdjType.NONE, apply_ewma_mean_smoother=False, max_ar_coeff=0.75, min_ar_coeff=0.0, max_factor_beta=1.0, min_factor_beta=0.0, ar_order=1, ar_max_value_for_beta=0.75, ar_min_value_for_beta=0.0, ar_non_negative=False, ar_non_negative_tol=0.0, return_diagnostics=False)[source]¶
Unsmooth supplied native marks per cadence and align reconstructed NAVs to their grid.
Asset returns use no forward filling before sampling. A sampled ending date must have a native mark in its ending calendar month. Missing returns stay unavailable to the regression. Coefficients fitted through t-1 apply at t in the existing QIS engines. Log reconstruction uses
log_returns_to_nav; simple reconstruction usesreturns_to_nav. These operations retain their initialization and gap behavior. Reconstructed period-end NAVs are then aligned to the original grid with a backward as-of lookup, retaining weekend period-end observations. No annualisation is applied.This operation deliberately differs from the existing AR price helpers in sampling, observation support and alignment. It does not select assets or infer their cadence.
- Parameters:
prices (DataFrame) – Native price frame with a unique increasing DatetimeIndex and asset columns.
frequency (str | Series) – Explicit pandas cadence, or Series covering every asset without missing values. Keys must match the horizon mappings; normalize aliases before calling.
method (UnsmoothingMethod) – AR for own-lag regression or JOINT for own-lag plus lagged-factor regression.
span (Mapping[str, int]) – Positive EWMA spans in observations, separately specified for each cadence.
warmup_period (Mapping[str, int]) – Positive warmup counts per cadence; an empty mapping disables this mask. With a nonempty mapping, each asset must have at least warmup + 1 observed returns. This guard does not guarantee regression identification.
is_log_returns (bool) – Explicit log or simple return convention, also used for the factor.
factor_prices (Series | None) – Liquid factor price Series, required for JOINT; unused for AR.
mean_adj_type (MeanAdjType) – Regression mean adjustment. INSAMPLE uses future sample information.
apply_ewma_mean_smoother (bool) – Apply the engine’s additional coefficient smoother.
max_ar_coeff (float) – JOINT upper own-lag bound.
min_ar_coeff (float | None) – JOINT lower own-lag bound, or None for no lower bound.
max_factor_beta (float | None) – JOINT upper lagged-factor bound, or None.
min_factor_beta (float | None) – JOINT lower lagged-factor bound, or None.
ar_order (int) – AR lag order; unused for JOINT.
ar_max_value_for_beta (float | None) – AR upper coefficient-sum bound, or None.
ar_min_value_for_beta (float | None) – AR lower coefficient-sum bound, or None.
ar_non_negative (bool) – Apply the AR nonnegative coefficient-sum policy.
ar_non_negative_tol (float) – AR nonnegative dead-zone tolerance.
return_diagnostics (bool) – Also return long-form fitted/applied coefficients. AR diagnostics contain the coefficient sum and zero factor beta; they do not expose each lag.
- Returns:
A new NAV frame on the original price axes, or (NAV, diagnostics). Diagnostics contain date, ticker, frequency, method, fitted_ar, fitted_lagged_beta, applied_ar, applied_lagged_beta and has_adjusted_return. Applied coefficients are shifted by one observation within each cadence. Inputs are not mutated.
- Raises:
ValueError – For invalid axes, missing cadence/horizons/factor, invalid positive horizon counts, or a history consumed by its requested warmup.
- Return type: