Last chance! 50% off unlimited learning
Sale ends in
Extract Standardized Residuals from KFS output
# S3 method for KFS
rstandard(model, type = c("recursive", "pearson", "state"),
standardization_type = c("marginal", "cholesky"), zerotol = 0, ...)
KFS object
Type of residuals. See details.
Type of standardization. Either "marginal"
(default) for marginal standardization or "cholesky"
for Cholesky-type standardization.
Tolerance parameter for positivity checking in standardization. Default is zero. The values of D <= zerotol * max(D, 0) are deemed to zero.
Ignored.
For object of class KFS with fully Gaussian observations, several
types of standardized residuals can be computed. Also the standardization
for multivariate residuals can be done either by Cholesky decomposition
"recursive": For Gaussian models the vector standardized one-step-ahead prediction
residuals are defined as
For Gaussian models the component-wise standardized one-step-ahead prediction
residuals are defined as
"state": Residuals based on the smoothed state disturbance terms
"pearson": Standardized Pearson residuals
# NOT RUN {
modelNile <- SSModel(Nile ~ SSMtrend(1, Q = list(matrix(NA))), H = matrix(NA))
modelNile <- fitSSM(inits = c(log(var(Nile)),log(var(Nile))), model = modelNile,
method = "BFGS")$model
# Filtering and state smoothing
out <- KFS(modelNile, smoothing = c("state", "mean", "disturbance"))
plot(cbind(
recursive = rstandard(out),
irregular = rstandard(out, "pearson"),
state = rstandard(out, "state")),
main = "recursive and auxiliary residuals")
# }
Run the code above in your browser using DataLab