« Return to Thread: garchFit and garchSim

Re: garchFit and garchSim

by michal miklovic :: Rate this Message:

Reply to Author | View in Thread

Hi,

I guess you meant 'presample'. It is a matrix of starting values for the modeled series, h.t and innovations (with zero mean and unit variance). Have a look at the help page for garchSpec.
I think the arma simulation is OK if n.ahead = 1. I would say it is possible to simulate an arma process with garchSim when you set the parameters of the conditional distribution to zero but I have never done it myself.

Regards,

Michal




----- Original Message ----
From: Andrey Riabushenko <cdome@...>
To: r-sig-finance@...
Sent: Friday, May 16, 2008 3:35:17 PM
Subject: [R-SIG-Finance] garchFit and garchSim

Hi !

I am trying to fit garch(1,1) model to stock returns using fGarch.

m = garchFit(~garch(1,1), data = returns)


But next I need to do 100 simulations of future returns. I am trying to use
garchSim for that
I have extracted estimated alpha, beta and omega
    params = model@fit$matcoef[,1]
    mu = params[1]
    omega = params[2]
    alpha = params[3]
    beta = params[4]

and i trying to do future simulation of returns
    sim = mu + garchSim(list(alpha = alpha, beta = beta, omega = omega),
resample=???)
   
I see that there is a resample parameter in garchSim function, but can't
figure out how to use it, docs do not help.

Please help me, I am writing my MA theses and only one week is left till
submission and my supervisor can't help with that.


P.S.
Also I have done similar thing, but using arima model. Please, check it if I
am  doing everything right, because I  not sure about it.

forecast_arima = function (returns, n.ahead) {
    model = armaFit(~arma(10, 5), data=returns)
    c = coef(model)
    arma_mean = c["intercept"]
    arma_ar = c[1:10]
    arma_ma = c[11:15]

    m = matrix(NA, n.ahead, MAX_SIM)
                       
    for(i in 1:MAX_SIM) {
    m[,i] = arma_mean + armaSim(list(ar = arma_ar, ma = arma_ma, d=0), n =
n.ahead, start.innov = as.vector(returns))
    }
    return(m)
}


Thank you for you expertise.

_______________________________________________
R-SIG-Finance@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.



     
        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.

 « Return to Thread: garchFit and garchSim

LightInTheBox - Buy quality products at wholesale price!