Still on the mle command.
The argument of the mle command in gretl is actually the log-L
contributions and not the Log-L.
Clearly every combination of parameters that maximize the latter also
maximize the former.
So, as far as the point estimates of the parameters are concerned, it
does not really matters which one is used.
So far I have used mle simply as a maximization BFGS method, and I was
not looking at the covariance or the other ancillary statistics.
In my case working directly with the log-likelihood is much easier cause
I have a quite complex function that returns the SSR and I use it
directly in the command.
In case of homoscedastic normally distributed residuals, the Log-L is
indeed just:
Log-L = -n/2*(ln (ssr/n) + 1 + ln 2pi)
and I can use my function directly in the formula.
On the contrary, working directly with the log-L contributions is not
straightforward in my case.
I would like to know if I could use the covariance matrix and the other
statistics generated by the program (in particular the information
criteria), if, instead of using the Log-L contributions, I simply divide
the Log-L by n.
As far as the covariance is concerned, likely I cannot use the matrix
calculated from the outer product of the gradient, but can I use the
Hessian?
Thanks a lot
Giuseppe
On Wed, 2011-10-26 at 22:59 +0200, Giuseppe Vittucci wrote:
On Wed, 2011-10-26 at 21:28 +0200, Riccardo (Jack) Lucchetti wrote:
> On Wed, 26 Oct 2011, Giuseppe Vittucci wrote:
>
> > The following code (adapted from the manual):
> >
> > mle logl = check ? - ln(pstr_cssr(y,X,q,gamma,c,m,Z) : NA
> > scalar check = (gamma > zeros(r,1)) && (c >= c_min) && (c
<=c_max)
> > params gamma c
> > end mle
> >
> > simply checks that the unconstrained maximum is in the parameter space
> > and returns an error if it is not so.
> > But is there a way to find such a constrained maximum in gretl?
> >
> > If there is not, what is the best way to circumvent the problem?
>
> There isn't. The idea is to check whether the parameters are admissible
> when the loglik is computed, just like you're doing.
>
> A couple of tips:
>
> 1) I suppose gamma is a vector; you can achieve the same result as what
> I think you're tryng to do by writing (gamma > 0) (cool, huh?)
Cool ;-)
>
> 2) if you have constrained parameters, you're probably much better off if
> you use some 1-to-1 transformation to some unbounded parameter. In your
> example, assuming you really mean to use <= and >= rather than strict
> inequalities, you may use
>
> mle logl = ln(pstr_cssr(y,X,q,gamma,c,m,Z)
> matrix gamma = exp(lg)
> scalar c = c_min + 0.5*(sin(ac) + 1)*c_max
> params lg ac
> end mle
>
> and then retrieve the $vcv for your original parametrisation by the delta
> method. Otherwise, if what you mean is really c_min < c < cmax (more
> customary in ml problems), then a nicer alternative is
>
> scalar c = c_min + 0.5*(tanh(ac) + 1)*c_max
>
> or perhaps
>
> scalar c = c_min + cnorm(ac)*c_max
>
> HTH,
Thanks.
Very nice tricks.
PS: Also c, c_min and c_max were vectors but it doesn't matter. ;-)
>
> Riccardo (Jack) Lucchetti
> Dipartimento di Economia
> Università Politecnica delle Marche
>
> r.lucchetti(a)univpm.it
>
http://www.econ.univpm.it/lucchetti
> _______________________________________________ Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users