residuals.tsets.estimate | R Documentation |
Extract the residual values from an estimated model.
## S3 method for class 'tsets.estimate' residuals(object, raw = FALSE, h = 1, seed = NULL, trace = FALSE, ...)
object |
an object of class “tsets.estimate”. |
raw |
raw residuals are the model based values which for the additive model are on the Box Cox scale, whilst for multiplicative models are equal to actual/fitted - 1. |
h |
the horizon (steps) ahead residuals required. The default represents the standard residuals whilst for h>1 these are the (1:h)-step ahead in-sample predicted residuals for each time point under fixed coefficients. |
seed |
a seed value which initializes the simulated predictive distribution from which the h-step ahead forecasts are made in order to calculate the residuals. |
trace |
whether to show the progress bar for the h-step ahead residuals calculation. The user is expected to have set up appropriate handlers for this using the “progressr” package. |
... |
not currently used. |
For h>1, this is like performing an in-sample backtest starting at time 1 with fixed coefficients. The purpose of having the matrix of h-step ahead residuals is in order to calculate the 1:h covariance matrix as well as the cross 1:h covariance matrix when ensembling series at multiple horizons.
An xts vector of the model residuals for h = 1, else a data.table with rows representing the first prediction date and columns the h-ahead forecast residuals.
The function can use parallel functionality (for h>1) as long as the
user has set up a plan
using the future package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.