yes I agree it is numerical, verbose is pasted in the end of this mail.
can you give a hint for correct coding in analytical derivatives based
on example from
the user guide
Using numerical derivatives
Iteration 1: Log-likelihood = -5164,68464253
Parameters: 0,80000 0,010000
Gradients: 6611,3 15150,
Iteration 2: Log-likelihood = -5007,00439481 (steplength = 2,56e-006)
Parameters: 0,81692 0,048785
Gradients: 2015,6 -4870,9
Iteration 3: Log-likelihood = -4902,00993249 (steplength = 1,28e-005)
Parameters: 0,85638 0,039729
Gradients: 392,75 -7567,8
Iteration 4: Log-likelihood = -4795,41281386 (steplength = 0,2)
Parameters: 0,88834 0,026727
Gradients: -453,12 -8951,3
Iteration 5: Log-likelihood = -4709,16114803 (steplength = 0,04)
Parameters: 0,91146 0,015536
Gradients: -541,47 -8246,5
Iteration 6: Log-likelihood = -4684,74981348 (steplength = 0,04)
Parameters: 0,91866 0,011910
Gradients: -407,15 -6983,7
Iteration 7: Log-likelihood = -4668,14930504 (steplength = 5,12e-007)
Parameters: 0,91845 0,0083347
Gradients: 754,33 -2009,4
Iteration 8: Log-likelihood = -4658,70086410 (steplength = 1,28e-005)
Parameters: 0,93374 0,0047633
Gradients: -2,0988 721,75
Iteration 9: Log-likelihood = -4658,61613082 (steplength = 1)
Parameters: 0,93243 0,0053536
Gradients: -33,600 -482,17
Iteration 10: Log-likelihood = -4658,56902045 (steplength = 1)
Parameters: 0,93267 0,0051477
Gradients: 9,8664 0,42141
Iteration 11: Log-likelihood = -4658,56859403 (steplength = 1)
Parameters: 0,93281 0,0051302
Gradients: -4,2876 -3,9686
Iteration 12: Log-likelihood = -4658,56858451 (steplength = 5,12e-007)
Parameters: 0,93281 0,0051281
Gradients: -3,1842 2,6774
Iteration 13: Log-likelihood = -4658,56858083 (steplength = 1,28e-005)
Parameters: 0,93273 0,0051402
Gradients: 2,8855 -3,8492
Iteration 14: Log-likelihood = -4658,56851788 (steplength = 1)
Parameters: 0,93277 0,0051340
Gradients: -0,00016738 -0,0070744
Iteration 14: Log-likelihood = -4658,56851788 (steplength = 1)
Parameters: 0,93277 0,0051340
Gradients: -0,00016738 -0,0070744
--- FINAL VALUES:
Log-likelihood = -4658,56851788 (steplength = 8,192e-010)
Parameters: 0,93277 0,0051340
Gradients: -0,00016738 -0,0070744
Tolerance = 1e-014
Function evaluations: 81
Evaluations of gradient: 14
Model 6: ML, using observations 1-15073
ll = check ? -0.5*(log(h) + (ep^2)/h) : NA
Standard errors based on Outer Products matrix
estimate std. error t-ratio p-value
---------------------------------------------------------
beta 0,932768 0,00109127 854,8 0,0000 ***
gamma1 0,00513404 0,000340124 15,09 1,76e-051 ***
Log-likelihood -4658,569 Akaike criterion 9321,137
Schwarz criterion 9336,378 Hannan-Quinn 9326,193
Using numerical derivatives
Iteration 1: Log-likelihood = -5164,68464253
Parameters: 0,80000 0,010000
Gradients: 6611,3 15150,
Iteration 2: Log-likelihood = -5164,68464226 (steplength = 1e-015)
Parameters: 0,80000 0,010000
Gradients: 6611,3 15150,
Iteration 3: Log-likelihood = -5162,71213034 (steplength = 7,25019e-009)
Parameters: 0,80005 0,010110
Gradients: 6597,2 15001,
Iteration 4: Log-likelihood = -4999,83186015 (steplength = 1)
Parameters: 0,80989 0,022346
Gradients: 4943,9 3877,8
Iteration 5: Log-likelihood = -4936,65882172 (steplength = 1)
Parameters: 0,82176 0,029220
Gradients: 3742,0 -353,86
Iteration 6: Log-likelihood = -4887,66377943 (steplength = 1)
Parameters: 0,84113 0,033645
Gradients: 2248,2 -3968,7
Iteration 7: Log-likelihood = -4844,04014140 (steplength = 1)
Parameters: 0,86243 0,032035
Gradients: 1021,1 -6316,5
Iteration 8: Log-likelihood = -4734,05453612 (steplength = 1)
Parameters: 0,91622 0,017513
Gradients: -1865,2 -11228,
Iteration 9: Log-likelihood = -4734,05453612 (steplength = 1e-015)
Parameters: 0,91622 0,017513
Gradients: -1865,2 -11228,
--- FINAL VALUES:
Log-likelihood = -4734,05453612 (steplength = 1e-015)
Parameters: 0,91622 0,017513
Gradients: -1865,2 -11228,
Tolerance = 1e-014
Function evaluations: 16
Evaluations of gradient: 16
Model 7: ML, using observations 1-15073
ll = check ? -0.5*(log(h) + (ep^2)/h) : NA
Standard errors based on Outer Products matrix
estimate std. error t-ratio p-value
--------------------------------------------------------
beta 0,916221 0,00147268 622,1 0,0000 ***
gamma1 0,0175130 0,000790365 22,16 8,71e-109 ***
Log-likelihood -4734,055 Akaike criterion 9472,109
Schwarz criterion 9487,351 Hannan-Quinn 9477,165
On 5.12.2009. 14:23, Riccardo (Jack) Lucchetti wrote:
On Sat, 5 Dec 2009, Davor Horvatic wrote:
> Concerning mle, I like to test and check results independently and I
> came across
> a problem. [...]
Could you please run the mle command with the --verbose option and
send me the results? I have the feeling you're having a numerical
problem, which can be probably mitigated by re-scaling your dependent
variable (like for example multiplying it by 100). Also, using
analytical derivatives would probably help quite a lot.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti