smooth.AutoMSARIMA.rstudent
- AutoMSARIMA.rstudent()
Return studentised (leave-one-out) residuals.
Each residual is scaled by the distribution-specific scale estimate recomputed without that observation (leave-one-out). Compared to
rstandard(), the result is more sensitive to individual outliers because no single point inflates the global scale estimate it is judged against.The leave-one-out sums are computed in O(n) using identities such as
Σ e[-i]² = Σ e² − e[i]², avoiding an explicit loop. Degrees of freedom:df = nobs - nparam - 1.Standardisation by distribution:
dnorm:
(e[i] - ē) / √(Σe[-i]² / df)dlaplace:
(e[i] - ē) / (Σ|e[-i]| / df)ds:
(e[i] - ē) / (Σ√|e[-i]| / (2 df))²dgnorm:
(e[i] - ē) / (Σ|e[-i]|^β · β/df)^(1/β)dlnorm:
exp(log_e[i] / √(Σlog_e[-i]² / df)), wherelog_e = log(e) - mean(log e) - σ²/2dinvgauss / dgamma:
e[i] / mean(e[-i])
Mirrors R’s
rstudent.adam().- Returns:
Studentised residuals, length
nobs.- Return type:
NDArray
- Raises:
ValueError – If the model has not been fitted yet.
See also
rstandardSimpler standardised residuals (faster).
outlierdummyOutlier detection based on studentised residuals.
Examples
>>> model = ADAM(model="AAN") >>> model.fit(y) >>> stu_res = model.rstudent() >>> # Studentised residuals are slightly more spread than rstandard >>> stu_res.std() >= model.rstandard().std() True
Parent Class: AutoMSARIMA