On Thu, 26 Jun 2008, Gordon Hughes wrote:
 I have been comparing the output of gretl and Stata for the
half-normal 
 stochastic frontier model (Example 17.1) in the User's Guide.  They are 
 extremely close, which is reassuring.  Without detailed timings my 
 impression is that the execution times are not substantially different - 
 my sample is ~ 550 observations and the model has 13 parameters. 
Phew!
 This exercise prompts me to raise a question.  The default mle setup
 relies upon numerical rather than analytical derivatives.  In the days 
 when I was programming maximum likelihood models, this would have imposed 
 a huge performance penalty.  But writing out all of the derivatives is 
 rather tedious in mle if one wants to test a lot of different 
 specification - unless one does it properly via a function that can parse 
 the number of independent variables, etc. So, the question is - has anyone 
 assessed the performance penalty from using numerical rather than 
 analytical derivatives?  For example, I note that the ZIP model shown as 
 Example 17.3 does not have any deriv statements, so clearly it was not 
 thought worthwhile including them. 
The reason why derivatives were not included in the ZIP example is 
pedagogic: the focus there is on the usage of functions and everything 
else is as simplified as possible. You're welcome to expand it if you 
like.
 One point is that in my experience the use of numerical derivatives
can 
 problems when the starting values are poor.  I found this with the 
 standard deviation parameters (su & sv) in SFA model when I got the scale 
 wrong - mle blew up very quickly reporting that something was not a 
 number.  This should not happen with analytical derivatives. 
Hear, hear.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti