1

I am using a panel data of n=478 and t=1988-2014, daily data. I use GARCH model and loop code. Each time when running the regression, the following appears, can somebody please help me figure out?

my code is:

forvalues i=1 (1) 478 {
     arch ut rmrf smb hml umd if id==`i', earch(1) egarch(1) distribution(t) 
     predict variance if id==`i', variance 
     replace var2=variance if id==`i'
     drop variance
}

every time, the loop are stopped because of:

flat log likelihood encountered, cannot find uphill direction

I tried different distribution, different garch model, like GARCH(1,1), EGARCH(1,1), OR EGARCH(1,2), all of them cannot work through all panel data.

P.S. I used code to drop missing data before doing the loop garch

I really grateful if someone could help me to address this problem.

henriquehbr
  • 1,063
  • 4
  • 20
  • 41
Y. LI
  • 21
  • 3
  • cross-posted https://www.statalist.org/forums/forum/general-stata-discussion/general/1438117-can-t-find-uphill-direction-when-using-garch-loop-working-on-panel-data – Nick Cox Apr 07 '18 at 15:47
  • This looks like a problem with your data or your model choice. I see no programming question here. – Nick Cox Apr 07 '18 at 15:48
  • YES, I post it on both forum. I searched Google before and almost reply is data or model problem. But, is there anyway that I can figure out the exactly problem? (1). I have the time gap for regression, should I -tsfill- the gap? but, there will be missing data. (2). Actually, before running GARCH, I dropped the missing data first. (3). I also tried to drop if return==0, cause in some id, the portfolio return shows continuous 0. I guess this might influence iteration. but it doesn't work as well – Y. LI Apr 07 '18 at 17:51
  • .(4). I found some people suggest -e(sample)- at the end of prediction code, but I can't understand why? is it helpful? (5) if it is the model problem, does it imply that my data not suitable the garch model? but the data works on Eviews with GARCH. (6) is it would be better if I change the daily data to monthly? but the observation is about 288, is it will influence the accuracy of estimation? – Y. LI Apr 07 '18 at 17:51
  • one of my friends even suggest me to use another computer. Does it could be the computer issue? – Y. LI Apr 07 '18 at 18:04
  • I doubt that a different computer would help, but I can't help you work out what the problem is. That's the difficulty: the program didn't converge and there is no evidence here that helps anybody else do anything but guess. – Nick Cox Apr 08 '18 at 08:37
  • I see! what a shame. A good thing is that, ever time, when STATA get stuck in converge, the variance still can be predicted for the portfolio of prior id. So, I skip that id portfolio and start again from the next one. Then, I will back to try different GARCH-type model to estimate variance of rest portfolio. I guess it could be a way, because I tried that use GARCH(1,1) and EGARCH(1,1) for the same id portfolio, there is no big different between conditional variance. What do you think? – Y. LI Apr 08 '18 at 09:30
  • Sorry, but you're asking statistical questions about a class of models I've never used on data we can't see, and I can't comment. I suggest that you ask a new question on Statalist, but "why doesn't a model fit data I don't show you" rarely gets good answers. Stack Overflow is for programming questions. – Nick Cox Apr 08 '18 at 09:40
  • Hi Nick, I am really grateful for your reply and suggestions. Yes, I will try to post a new one later. I also got some information from Statalist. That's sooo good. Many thanks again. – Y. LI Apr 08 '18 at 16:36

0 Answers0