Wednesday, October 5, 2016

optimization - Algorithm to fit AR(1)/GARCH(1,1) model of log-returns


I am fitting numerically an AR(1)/GARCH(1,1) process to index and stock log-returns, rt=log(Pt/Pt1), where Pt is the price at time t, and thus far am not clear on where the observed log returns would be used in an algorithm. Several author groups have described (some in part) the components of the AR(1)/GARCH(1,1) approach, for example:


E. Zivot: rt=μ+ϕ(rt1μ)+ϵt


Rachev et al: rt=μ+ϕrt1ϵt=σtδt(δt is an innovation)σt=α0+α1ϵ2t1+β1σ2t1


Brummelhuis & Kaufman: Xt=μt+σtϵtμt=λXt1σt=α0+α1(Xt1μt1)2+β1σ2t1


Jalal & Rockinger: μt=ϕXt1ϵt=Xtμtσt=α0+α1ϵ2t1+β1σ2t1


My approach:


μt=μ+ϕrt1ϵt=rtμtσt=α0+α1ϵ2t1+β1σ2t1



Given the multiple descriptions above, my interpretation for an algorithm would be:


Algorithm for AR(1)/GARCH(1,1):



  1. Initialize μ=0, σ1=1, ϵ1=0, μ=ϕ=α0=α1=β1=U(0,1)0.01

  2. For t = 2 to T:

  3. μt=μ+ϕrt1(Log-returns lag-1 input here)

  4. ϵt=rtμt(Log-returns lag-0 input here)


  5. σt=α0+α1ϵ2t1+β1σ2t1





  6. ˆrt=ϕμt1+σtϵtOR:ˆrt=μ+ϕμt1+σtϵt???



  7. Next t

  8. Calculate residual, et=rtˆrt

  9. Determine MSE=1Tte2t


The algorithm proposed above is essentially the recursive part to calculate the predicted log-returns ˆrt from the input observed returns rt. Innovations or random quantiles from a probability distribution [such as N(0,1) or t(ν)] would not be employed here since we are fitting a model, not simulating. During each iteration, the goodness-of-fit based on proposed parameters for the objective function would be based on MSE=1Ttet, which would be minimized via an optimization technique using non-linear regression, finite differencing, or MLE. Metaheuristics could be used as well where initialization of chromosome (particle) values for (μ,ϕ,α0,α1,β1) would occur at the first generation.


In terms of comparing results based R, MATLAB, SAS, etc. the parameterization would be:


mu=μ



ar1=ϕ


garch0=α0


garch1=α1


garch2=β1


I am not sure whether the unconditional mean μ would be needed in line 6 of the algorithm, however. Please comment on correctness of the algorithm, and possibly suggest coding changes. Again, the goal is to algorithmically use numerical methods to solve for the parameters, not R, MATLAB, or SAS, etc.




No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...