| residuals.qpm_filtration | R Documentation |
residuals() returns the filter's one-step-ahead prediction errors
for the observed series (type = "innovation"), the same divided by
their standard deviations ("standardized", which is what the
outlier flags use), or the smoothed structural shocks
("shock"). fitted() returns the one-step-ahead predictions of the
observables, so that observed = fitted + innovation.
## S3 method for class 'qpm_filtration'
residuals(object, type = c("innovation", "standardized", "shock"), ...)
## S3 method for class 'qpm_filtration'
fitted(object, ...)
object |
A |
type |
Which residuals to return. |
... |
Unused. |
A data frame with a period column and one column per series.
sol <- qpm_solve(qpm_template("bkl"))
obs <- simulate(sol, nsim = 40, seed = 1, burn = 20)
fit <- qpm_filter(sol, obs[, c("period", "pi", "i", "q")])
head(residuals(fit, "standardized"))
head(fitted(fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.