##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)
Run the code above in your browser using DataLab