smooth.AutoMSARIMA.multicov

AutoMSARIMA.multicov(type='analytical', h=10, nsim=1000)

Covariance matrix of multi-step-ahead forecast errors.

Mirrors R’s multicov.adam (R/adam.R:7051-7236). For an h-step horizon, returns a symmetric (h, h) matrix where the (i, j) entry is the covariance between the i-step and j-step forecast errors. Useful for cumulative-forecast variance, joint prediction-interval construction, and multi-step diagnostics.

Parameters:
  • type (str) –

    • "analytical" — closed-form from the state-space matrices (F, W, g, σ²). Uses the existing covar_anal() for additive errors; falls back to a diagonal built from var_anal() for multiplicative-error models on log/positive distributions (matches the dispatch in intervals).

    • "simulated" — averages the empirical covariance across nsim simulator paths. Reuses the existing predict(interval="simulated", scenarios=True) machinery so distribution-specific error generation, scale de-biasing, and occurrence handling are consistent with the prediction-interval path.

    • "empirical" — rolling-origin cross-product: (errorsᵀ errors) / (nobs - h) where errors is rmultistep()’s (T-h, h) output. Mirrors R’s multicov.adam empirical branch (R/adam.R:7090-7092); both languages call the same C++ adamCore::ferrors backend so the per-cell residuals are bit-equivalent.

  • h (int) – Forecast horizon. The returned matrix is (h, h).

  • nsim (int) – Number of simulator paths when type="simulated". Ignored otherwise.

Returns:

Symmetric (h, h) covariance, indexed and columned by ["h1", "h2", ..., "hh"].

Return type:

DataFrame

Notes

Standalone OM inherits this method and produces a link-scale covariance with type="analytical". The OM’s sigma is sqrt(mean(residuals²)) (mirroring R’s sigma.om in R/om.R), so the returned matrix is the covariance of multi-step forecast errors on the link-transformed (logit / log-odds) scale, not on the probability axis. type="simulated" is not yet supported on OM because the occurrence-aware predict route does not populate the scenarios matrix the simulated branch relies on.

OMG overrides this method to raise — the joint occurrence model’s multi-step distribution does not have a closed-form covariance in terms of the per-sub-model state-space matrices; call model.model_a.multicov() and model.model_b.multicov() instead.


Parent Class: AutoMSARIMA