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:
Then Stata reports error "could not find feasible values r(491)". Any suggestion?
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
Comment