smooth.AutoMSARIMA.rstandard
- AutoMSARIMA.rstandard()
Return standardised residuals.
Residuals are scaled by distribution-specific estimates of their scale, corrected for degrees of freedom
df = nobs - nparam. The standardisation formula depends on the fitted distribution:dnorm:
(e - ē) / (σ √(n/df))dlaplace:
e / σ · n/dfds:
(e - ē) / (σ · n/df)²dgnorm:
(e - ē) / (σ^β · n/df)^(1/β), β = shapedlnorm:
exp((log(e) + σ²/2 - mean(·)) / (σ √(n/df)))dinvgauss / dgamma:
e / ē
For a correctly specified model the result should be approximately distributed as the standardised version of the fitted distribution. Mirrors R’s
rstandard.adam().- Returns:
Standardised residuals, length
nobs.- Return type:
NDArray
- Raises:
ValueError – If the model has not been fitted yet.
See also
rstudentLeave-one-out studentised residuals.
outlierdummyOutlier detection based on standardised residuals.
Examples
>>> model = ADAM(model="AAN") >>> model.fit(y) >>> std_res = model.rstandard() >>> # For a well-specified normal model, std_res ≈ N(0, 1) >>> abs(std_res.mean()) < 0.1 True
Parent Class: AutoMSARIMA