refit {garchx}R Documentation

Refit a model to new data

Description

Refit a model to new data, typically for cross-validation purposes. Re-estimation (reestimate) is optional (the default is FALSE).

Usage

##generic:
refit(object, ...)

##S3 method for 'garchx' objects:
## S3 method for class 'garchx'
refit(object, newy = NULL, newxreg = NULL,
  backcast.value = NULL, reestimate = FALSE, ...)

Arguments

object

an object of class garchx

newy

vector, the new 'y' data, see garchx

newxreg

the new 'xreg' data, if any, see garchx

backcast.value

NULL or a non-negative numeric, see garchx

reestimate

logical. If FALSE (default), then the estimates from object are used on the new data. If TRUE, then the model is re-estimated using the new data

...

further arguments passed to or from other methods

Details

refit.garchx is a convenience function to facilitate cross-validation and related analyses.

Value

A list of class 'garchx'

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

See Also

garchx

Examples

##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)


[Package garchx version 1.5 Index]