smooth.SMA.reapply

SMA.reapply(nsim=1000, type=None, bootstrap=False, heuristics=None, seed=None, **vcov_kwargs)

Re-run the model on the in-sample data for nsim parameter draws.

Python port of R’s reapply.adam (R/reapply.R:87-778). Samples nsim parameter vectors from a multivariate normal centred on coef with covariance from vcov(), clips each draw to the admissible region, then re-runs the shared C++ ADAM kernel (adamCore::reapply) once per draw. The resulting per-draw fitted paths, states, transition / measurement matrices, persistence vectors, and final profiles are returned in a ReapplyResult with array shapes matching R exactly.

Parameters:
  • nsim (int) – Number of parameter draws.

  • bootstrap (bool) – Forwarded to vcov(). True uses the empirical covariance from coefbootstrap() instead of the analytical inverse-Fisher matrix.

  • heuristics (Optional[float]) – Forwarded to vcov() — heuristic diagonal proportion (vcov = diag(|coef| * heuristics)) when set.

  • seed (Optional[int]) – Seed for the MVN sampler. Makes the draw reproducible.

  • **vcov_kwargs – Forwarded to vcov() (step_size, bootstrap kwargs).

Returns:

Container with time_elapsed, y, states (c, n+L, nsim), refitted (n, nsim), fitted, model, transition (c, c, nsim), measurement (n, c, nsim), persistence (c, nsim), profile (c, L, nsim), random_parameters (nsim, k) and nsim.

Return type:

ReapplyResult

Notes

Covers ETS (with bounds="usual", "admissible" or "none") and pure / mixed ARIMA models. External regressors (X) are still rejected — that branch arrives in a follow-up.


Parent Class: SMA