| residuals.dlmFiltered {dlm} | R Documentation |
The function computes one-step forecast errors for a filtered dynamic linear model.
## S3 method for class 'dlmFiltered':
residuals(object, ..., type = c("standardized", "raw"), sd = TRUE)
object |
An object of class "dlmFiltered", such as the
output from dlmFilter. |
... |
Unused additional arguments. |
type |
Should standardized or raw forecast errors be produced? |
sd |
When TRUE, standard deviations are returned as well. |
A vector or matrix (in the multivariate case) of one-step forecast
errors, standardized if type = "standardized". Time series
attributes of the original observation vector (matrix) are retained by
the one-step forecast errors.
If sd = TRUE then the returned value is a list with the
one-step forecast errors in component res and the corresponding
standard deviations in component sd.
Giovanni Petris GPetris@uark.edu
Harrison and West, Bayesian forecasting and dynamic models (2nd ed.), Springer (1997).
## diagnostic plots nileMod <- dlmModPoly(1, dV = 15099.8, dW = 1468.4) nileFilt <- dlmFilter(Nile, nileMod) res <- residuals(nileFilt, sd=FALSE) qqnorm(res) tsdiag(nileFilt)