Hi,

the correct order in presample is: innovations, h.t and returns. Next, I think it is necessary to first define a model by garchSpec and then use the definition to simulate it, have a look at the documentation. Btw, you can put 'mu' into the definition instead of adding it to the simulated series. I would set n.start = 0 in case of 'extending' an analysed series by simulation. n.start should be used when you simulate a series that is not 'appended' to another series.
Concerning the arma simulation, I had another look at it and now I understand what you are doing and I think it is OK. Sorry for the confusion.
Next time you post a question to mailing list, please indicate the version of R and packages you are using. It could be helpful because some packages get updated quite frequently.

Regards,

Michal




----- Original Message ----
From: Andrey Riabushenko <cdome@bk.ru>
To: michal miklovic <mmiklovic@yahoo.com>; r-sig-finance@stat.math.ethz.ch
Sent: Saturday, May 17, 2008 11:33:16 AM
Subject: Re: [R-SIG-Finance] garchFit and garchSim

Thanks a lot. I am making progress, but still some problems left
I am running

returns = as.vector(returns)
model = garchFit(~garch(1,1), data=returns)

params = model@fit$matcoef[,1]
mu = params[1]
omega = params[2]
alpha = params[3]
beta = params[4]

presample = cbind(returns, residuals(model, standardize =TRUE), model@h.t)

sim = mu + garchSim(list(alpha = alpha, beta = beta, omega = omega), 
n=n.ahead, n.start = length(returns), presample=presample)

But what I get is
head(sim) 
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 

What it is wrong?


Also it is not clear why arima simulation is wrong  if n.ahead > 1, I need 
more than 1 for my study?

> The modeled series is readily available - in your case it is 'returns'. h.t
> can be obtained by m@h.t and starting values for the innovations, i.e. the
> standardised residuals, can be obtained by residuals(m, standardize =
> TRUE).
>
> Hope this helps.
>
> Michal
>
>
>
>



      
	[[alternative HTML version deleted]]

