smooth.ADAM.multicov
- ADAM.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 anh-step horizon, returns a symmetric(h, h)matrix where the(i, j)entry is the covariance between thei-step andj-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 existingcovar_anal()for additive errors; falls back to a diagonal built fromvar_anal()for multiplicative-error models on log/positive distributions (matches the dispatch inintervals)."simulated"— averages the empirical covariance acrossnsimsimulator paths. Reuses the existingpredict(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)whereerrorsisrmultistep()’s(T-h, h)output. Mirrors R’smulticov.adamempirical branch (R/adam.R:7090-7092); both languages call the same C++adamCore::ferrorsbackend so the per-cell residuals are bit-equivalent.
h (
int) – Forecast horizon. The returned matrix is(h, h).nsim (
int) – Number of simulator paths whentype="simulated". Ignored otherwise.
- Returns:
Symmetric
(h, h)covariance, indexed and columned by["h1", "h2", ..., "hh"].- Return type:
DataFrame
Notes
Standalone
OMinherits this method and produces a link-scale covariance withtype="analytical". The OM’ssigmaissqrt(mean(residuals²))(mirroring R’ssigma.omin 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.OMGoverrides 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; callmodel.model_a.multicov()andmodel.model_b.multicov()instead.
Parent Class: ADAM