[R] Monte carlo simulation in fGARCH
Brajkovic J.
Jurica.Brajkovic at soton.ac.uk
Tue Mar 3 15:04:25 CET 2009
I use fGarch package to estimate AR(1)-ARCH(1) process for a vector of returns. Then, using the estimated parameters I want to simulate 10 000 sample paths where each path has the same length as the vector of returns. So the first line of the code is: spec=garchSpec(model=list(ar= 0.440270860, omega=0.000374365,alpha=0.475446583 , mu=0, beta=0))----
The only way I can think of generating 10 000 sample paths is by looping. But in the line of code that tells R to simulate data - sim<-garchSim(simspec, 100000,extended=F) – I cannot figure out how to make the loop work.
I tried to solve this problem by making only one sample path where, for example, instead of making 3 paths each with 100 observations I have one path with 300 observations. But when I do it, I get weird results.
Can somebody suggest how to modify the code to perform Monte Carlo simulation of GARCH?
Thanks,
Jurica
More information about the R-help
mailing list