Announcement

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

  • Estimate a Component GARCH Model

    I'm trying to estimate a component GARCH model using Stata, but it's not a built-in function. I think it can be done by either modifying -arch- command or writing my own codes and using -ml-. I've tried to use -ml- to estimate an ARCH model (because its log likelihood function is simpler), and my codes are below:

    Code:
    sysuse sp500
    gen r = change/close[_n-1]
    tsset date
    
    program arch
    
    args todo b lnfj
    tempvar xb
    quietly generate double `xb'= `b'[1,1]
    quietly replace `lnfj' = -0.5*ln(2*_pi)-0.5*ln(`b'[2,1]+`b'[2,2]* ///
    (L.r- L.`xb')^2)-0.5*(r-`xb')^2/(`b'[2,1]+`b'[2,2]*(L.r-L.`xb')^2)
    end
    
    ml model gf0 arch (r=) /sigma
    ml check
    Then Stata reports error "could not find feasible values r(491)". Any suggestion?

  • #2
    Solved.

    Comment


    • #3
      Originally posted by Yu Hu View Post
      Solved.
      Hey Yu,
      would you mind posting your solution code? I've ran into a similar problem.
      All the best
      Laura

      Comment

      Working...
      X