On Thu, 16 Mar 2017, Sven Schreiber wrote:
Am 16.03.2017 um 08:39 schrieb Riccardo (Jack) Lucchetti:
> On Thu, 16 Mar 2017, Alecos Papadopoulos wrote:
>
>> In mle estimation, we can constrain the permissible space for the
>> parameters under estimation like this:
>>
>> mle logl = check ? p*ln(ax) - lngamma(p) - ln(x) - ax : NA
>> series ax = alpha*x
>> scalar check = (alpha>0) && (p>0)
>> params alpha p
>> end mle
>>
>> Do we use the same syntax when using nls, non-linear least-squares?
>> The general difference in syntax that I can see, is that in mle we
>> define directly the function that is to be maximized, while in nls we
>> define the regression function... so maybe the syntax for the
>> constraint should be different?
I'd say the standard trick is to map the parameter to the admissible range
with an appropriate function (usually exp, log, or a cdf). So here using
exp(alpha2) instead of alpha, for example, which is guaranteed to be
positive. Of course a little more work then has to be done at the end to back
out the right confidence interval.
True.
> NLS is a special case of MLE. All you have to do is define a
nonlinear
> function for the mean and plug it into a normal density.
As usually Jack provides the deeper insight, but by that logic we wouldn't
need the NLS command in gretl...
Well, part of the reason is historical. The nls command predates mle. But
also, NLS models enjoy some distinctive features so that IMO it's nice to
have a convenient shortcut.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------