Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Monte Carlo Simulation to generate garch process

    Can anyone tell what's wrong with my simulation:
    ////////////////////////////////////////the Code:
    clear all
    program define MonteCarlo, rclass
    import excel "C:\Users\altal\OneDrive\Desktop\Udemy\ma1.xls x", sheet("ma1") firstrow

    quietly gen time =_n
    quietly tsset time

    scalar a0 = 0.01
    scalar alpha = 0.05
    scalar beta = 0.6

    gen v=rnormal(0,1)
    gen h=rnormal(0,1)
    generate e=sqrt(h)*v
    replace h=a0+(alpha*(v[_n-1]^2)+ beta)*h[_n-1]



    arch y, arch(1/1) garch(1/1)
    end

    simulate _cons [ARCH]L1.arch [ARCH]L1.garch, reps(500): MonteCarlo

    summarize _cons [ARCH]L1.arch [ARCH]L1.garch
    ////////////////////////////////////
    thanks in advance
Working...
X