Announcement

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

  • Garch(1,1) model does not converge:*flat log likelihood encountered, cannot find uphill direction

    Hello,

    I am using 5 minute Bitcoin/USD logreturns since 2017 (n=256,705) and am trying to estimate a GARCH(1,1) model.

    The upcoming error " r(430) flat log likelihood encountered, cannot find uphill direction " seems to be an error that is frequently occurring in this context.
    The solutions I found using this Forum and the Stata guides can be summarized as follows:

    1) eliminate outliers
    2) set initial values
    3) change convergence criteria

    1) I winsorized the data to eliminate the possibility that outliers are the reason for non-convergence
    2) I used the following code: arch logreturn_w, arch(1) garch (1) from(0.008 0.9 0.1 0.001, copy)
    3)
    I used the following code: arch logreturn_w, arch(1) garch (1) tolerance(0.1) nrtolerance(0.1) ltolerance(0.1)

    I also tried several different starting values and tolerances, all of them without successful conversion.
    Could you please check, if there is a problem with the codes (since I am not allowed to use another way to eliminate outliers)?
    Stata runs the maximum-likelihood estimation so I assume there is no syntax error etc, but maybe the values are unreasonable?

    In addition, there might be other ways to handle the upcoming problem that I have not found or read about, yet?


    Thanks a lot for any help in advance.
    Mathis


  • #2
    You didn't get a quick answer. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.
    When you say "you are not allowed" it sounds like this is a homework problem. We don't do homework for you.

    As for not converging, that often happens in maximum likelihood. There are several alternative ways to try to get such convergence - look at ml in the documentation. Different starting values and different optimization procedures might help. I might try estimating the model with regression just to see if it shows something funny.

    Comment


    • #3
      Hello Phil, thanks for your reply and input, here all the information according to the FAQ:

      Sample data:
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str19 date_excel float logreturn_w
      "2017-08-01 00:00:00"    .003866881
      "2017-08-01 00:05:00"  -.0039149816
      "2017-08-01 00:10:00"  -.0039149816
      "2017-08-01 00:15:00"    .003866881
      "2017-08-01 00:20:00"    -.00258099
      "2017-08-01 00:25:00"    .003866881
      "2017-08-01 00:30:00"   .0012411993
      "2017-08-01 00:35:00"  -.0039149816
      "2017-08-01 00:40:00"    .003866881
      "2017-08-01 00:45:00"  -.0014726965
      "2017-08-01 00:50:00"  -.0039149816
      "2017-08-01 00:55:00"    .003866881
      "2017-08-01 01:00:00"  -.0039149816
      "2017-08-01 01:05:00"  -.0039149816
      "2017-08-01 01:10:00"  -.0016280806
      "2017-08-01 01:15:00"   .0003843745
      end
      Codes used:
      Code:
      arch logreturn_w, arch(1) garch (1)
      Code:
      arch logreturn_w, arch(1) garch (1) tol(0.1) ltol(0.1) nonrtolerance
      Code:
      arch logreturn_w, arch(1) garch (1) from(0.01 0.1 0.8 0.01)
      Output:
      Code:
      . arch logreturn_w, arch(1) garch (1) tol(0.1) ltol(0.1) nonrtolerance
      
      (setting optimization to BHHH)
      Iteration 0:   log likelihood =  45239.996  
      Iteration 1:   log likelihood =  45569.447  
      Iteration 2:   log likelihood =  45576.752  
      Iteration 3:   log likelihood =  45581.538  
      Iteration 4:   log likelihood =  45585.638  
      (switching optimization to BFGS)
      Iteration 5:   log likelihood =  45588.601  
      BFGS stepping has contracted, resetting BFGS Hessian (0)
      Iteration 6:   log likelihood =  45613.634  
      BFGS stepping has contracted, resetting BFGS Hessian (1)
      Iteration 7:   log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (2)
      Iteration 8:   log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (3)
      Iteration 9:   log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (4)
      Iteration 10:  log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (5)
      Iteration 11:  log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (6)
      Iteration 12:  log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (7)
      Iteration 13:  log likelihood =  45613.634  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (8)
      Iteration 14:  log likelihood =  45613.634  (backed up)
      (switching optimization to BHHH)
      Iteration 15:  log likelihood =  45613.634  (backed up)
      Iteration 16:  log likelihood =  45615.321  
      Iteration 17:  log likelihood =  45615.441  
      Iteration 18:  log likelihood =  45615.505  
      Iteration 19:  log likelihood =  45615.525  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (9)
      Iteration 20:  log likelihood =  45615.534  
      BFGS stepping has contracted, resetting BFGS Hessian (10)
      Iteration 21:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (11)
      Iteration 22:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (12)
      Iteration 23:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (13)
      Iteration 24:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (14)
      Iteration 25:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (15)
      Iteration 26:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (16)
      Iteration 27:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (17)
      Iteration 28:  log likelihood =  45615.534  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (18)
      Iteration 29:  log likelihood =  45615.534  (backed up)
      (switching optimization to BHHH)
      Iteration 30:  log likelihood =  45615.534  (backed up)
      Iteration 31:  log likelihood =  45615.539  
      Iteration 32:  log likelihood =  45615.543  
      Iteration 33:  log likelihood =  45615.547  
      Iteration 34:  log likelihood =  45615.551  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (19)
      Iteration 35:  log likelihood =  45615.554  
      BFGS stepping has contracted, resetting BFGS Hessian (20)
      Iteration 36:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (21)
      Iteration 37:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (22)
      Iteration 38:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (23)
      Iteration 39:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (24)
      Iteration 40:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (25)
      Iteration 41:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (26)
      Iteration 42:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (27)
      Iteration 43:  log likelihood =  45615.554  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (28)
      Iteration 44:  log likelihood =  45615.554  (backed up)
      (switching optimization to BHHH)
      Iteration 45:  log likelihood =  45615.554  (backed up)
      Iteration 46:  log likelihood =  45615.556  
      Iteration 47:  log likelihood =  45615.559  
      Iteration 48:  log likelihood =  45615.562  
      Iteration 49:  log likelihood =  45615.565  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (29)
      Iteration 50:  log likelihood =  45615.567  
      BFGS stepping has contracted, resetting BFGS Hessian (30)
      Iteration 51:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (31)
      Iteration 52:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (32)
      Iteration 53:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (33)
      Iteration 54:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (34)
      Iteration 55:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (35)
      Iteration 56:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (36)
      Iteration 57:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (37)
      Iteration 58:  log likelihood =  45615.567  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (38)
      Iteration 59:  log likelihood =  45615.567  (backed up)
      (switching optimization to BHHH)
      Iteration 60:  log likelihood =  45615.567  (backed up)
      Iteration 61:  log likelihood =  45615.569  
      Iteration 62:  log likelihood =  45615.572  
      Iteration 63:  log likelihood =  45615.576  
      Iteration 64:  log likelihood =   45615.58  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (39)
      Iteration 65:  log likelihood =  45615.582  
      BFGS stepping has contracted, resetting BFGS Hessian (40)
      Iteration 66:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (41)
      Iteration 67:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (42)
      Iteration 68:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (43)
      Iteration 69:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (44)
      Iteration 70:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (45)
      Iteration 71:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (46)
      Iteration 72:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (47)
      Iteration 73:  log likelihood =  45615.582  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (48)
      Iteration 74:  log likelihood =  45615.582  (backed up)
      (switching optimization to BHHH)
      Iteration 75:  log likelihood =  45615.582  (backed up)
      Iteration 76:  log likelihood =  45615.584  
      Iteration 77:  log likelihood =  45615.587  
      Iteration 78:  log likelihood =  45615.589  
      Iteration 79:  log likelihood =  45615.591  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (49)
      Iteration 80:  log likelihood =  45615.594  
      BFGS stepping has contracted, resetting BFGS Hessian (50)
      Iteration 81:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (51)
      Iteration 82:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (52)
      Iteration 83:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (53)
      Iteration 84:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (54)
      Iteration 85:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (55)
      Iteration 86:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (56)
      Iteration 87:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (57)
      Iteration 88:  log likelihood =  45615.594  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (58)
      Iteration 89:  log likelihood =  45615.594  (backed up)
      (switching optimization to BHHH)
      Iteration 90:  log likelihood =  45615.594  (backed up)
      Iteration 91:  log likelihood =  45615.595  
      Iteration 92:  log likelihood =  45615.596  
      Iteration 93:  log likelihood =  45615.598  
      Iteration 94:  log likelihood =  45615.599  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (59)
      Iteration 95:  log likelihood =    45615.6  
      BFGS stepping has contracted, resetting BFGS Hessian (60)
      Iteration 96:  log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (61)
      Iteration 97:  log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (62)
      Iteration 98:  log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (63)
      Iteration 99:  log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (64)
      Iteration 100: log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (65)
      Iteration 101: log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (66)
      Iteration 102: log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (67)
      Iteration 103: log likelihood =    45615.6  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (68)
      Iteration 104: log likelihood =    45615.6  (backed up)
      (switching optimization to BHHH)
      Iteration 105: log likelihood =    45615.6  (backed up)
      Iteration 106: log likelihood =  45615.602  
      Iteration 107: log likelihood =  45615.603  
      Iteration 108: log likelihood =  45615.603  
      Iteration 109: log likelihood =  45615.605  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (69)
      Iteration 110: log likelihood =  45615.605  
      BFGS stepping has contracted, resetting BFGS Hessian (70)
      Iteration 111: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (71)
      Iteration 112: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (72)
      Iteration 113: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (73)
      Iteration 114: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (74)
      Iteration 115: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (75)
      Iteration 116: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (76)
      Iteration 117: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (77)
      Iteration 118: log likelihood =  45615.605  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (78)
      Iteration 119: log likelihood =  45615.605  (backed up)
      (switching optimization to BHHH)
      Iteration 120: log likelihood =  45615.605  (backed up)
      Iteration 121: log likelihood =  45615.606  
      Iteration 122: log likelihood =  45615.607  
      Iteration 123: log likelihood =  45615.607  
      Iteration 124: log likelihood =  45615.608  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (79)
      Iteration 125: log likelihood =  45615.608  
      BFGS stepping has contracted, resetting BFGS Hessian (80)
      Iteration 126: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (81)
      Iteration 127: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (82)
      Iteration 128: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (83)
      Iteration 129: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (84)
      Iteration 130: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (85)
      Iteration 131: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (86)
      Iteration 132: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (87)
      Iteration 133: log likelihood =  45615.608  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (88)
      Iteration 134: log likelihood =  45615.608  (backed up)
      (switching optimization to BHHH)
      Iteration 135: log likelihood =  45615.608  (backed up)
      Iteration 136: log likelihood =  45615.609  
      Iteration 137: log likelihood =  45615.609  
      Iteration 138: log likelihood =   45615.61  
      Iteration 139: log likelihood =   45615.61  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (89)
      Iteration 140: log likelihood =   45615.61  
      BFGS stepping has contracted, resetting BFGS Hessian (90)
      Iteration 141: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (91)
      Iteration 142: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (92)
      Iteration 143: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (93)
      Iteration 144: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (94)
      Iteration 145: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (95)
      Iteration 146: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (96)
      Iteration 147: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (97)
      Iteration 148: log likelihood =   45615.61  (backed up)
      BFGS stepping has contracted, resetting BFGS Hessian (98)
      Iteration 149: log likelihood =   45615.61  (backed up)
      (switching optimization to BHHH)
      Iteration 150: log likelihood =   45615.61  (backed up)
      Iteration 151: log likelihood =  45615.611  
      Iteration 152: log likelihood =  45615.611  
      Iteration 153: log likelihood =  45615.611  
      Iteration 154: log likelihood =  45615.612  
      (switching optimization to BFGS)
      BFGS stepping has contracted, resetting BFGS Hessian (99)
      Iteration 155: log likelihood =  45615.612  
      flat log likelihood encountered, cannot find uphill direction
      r(430);

      Please note that the listed codes are extracted from the documentation and do not seem to achieve convergence. Changing the tolerance levels for example does not change anything in the output. Trying different starting values also didn't turn out successful. That's why I wanted to check whether the codes are alright, and whether there are other ideas to help convergence.

      Comment

      Working...
      X