View source: R/garchx-source-code.R
refit | R Documentation |
Refit a model to new data, typically for cross-validation purposes. Re-estimation (reestimate
) is optional (the default is FALSE
).
##generic: refit(object, ...) ##S3 method for 'garchx' objects: ## S3 method for class 'garchx' refit(object, newy = NULL, newxreg = NULL, backcast.value = NULL, reestimate = FALSE, ...)
object |
an object of class |
newy |
vector, the new 'y' data, see |
newxreg |
the new 'xreg' data, if any, see |
backcast.value |
|
reestimate |
logical. If |
... |
further arguments passed to or from other methods |
refit.garchx
is a convenience function to facilitate cross-validation and related analyses.
A list of class 'garchx'
Genaro Sucarrat, http://www.sucarrat.net/
garchx
##simulate from a garch(1,1): set.seed(123) y <- garchxSim(1000) ##estimate garch(1,1) model: mymod <- garchx(y) ##new data (e.g. 'out-of-sample' or 'test' data): yy <- garchxSim(100) ##apply the estimates of 'mymod' on yy data: refit(mymod, newy=yy)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.