Christ, what a stupid mistake. I apologize to everybody that has been
following this conversation.
Τhe correct constant is ln(4/sqrt(2*$pi))= 0.467355827915218...
...and now the code runs smoothly if I include the constant as an
expression, ln(4/sqrt(2*$pi)), it gives a zero gradient and the correct
value for the log-l, and estimates virtually identical with the mle code
without the constant.
It still has problems if I include the constant as a numerical value
0.467355827915218... in which case I get
loglikelihood = -172.877055337 (steplength = 5.36871e-021)
Gradients: 0.98941 -16.941 65.400 61.632 -0.42174 0.31255
-0.078953 0.32094 -0.099944 -0.028678 1.6085 23.937
0.80591 6.6747e-005 0.045333 0.0018853 (norm 7.16e-001)
...which is obviously not at the maximum. Also, here one of the non-negative terms is
estimated as
as close to zero as possible - meaning that the iteration method was led towards negative
values but wasn't
permitted, and this is perhaps why the gradient is not zero.
Also if I truncate the constant to only 7 decimal digits (instead of 15) the code runs and
gives estimates and a non-zero gradient as above, but it also gives the message
"Matrix is not positive definite , Error executing script: halting". Perhaps
this explains some things to those who know more...
Still, Allin thanks, My issue is essentially solved. And apologies again.
Alecos Papadopoulos
Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763
skype:alecos.papadopoulos
On 11/7/2013 19:00, gretl-users-request(a)lists.wfu.edu wrote:
Send Gretl-users mailing list submissions to
gretl-users(a)lists.wfu.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.wfu.edu/mailman/listinfo/gretl-users
or, via email, send a message with subject or body 'help' to
gretl-users-request(a)lists.wfu.edu
You can reach the person managing the list at
gretl-users-owner(a)lists.wfu.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gretl-users digest..."
Today's Topics:
1. Re: Constant in log-likelihood (Alecos Papadopoulos)
2. Re: Constant in log-likelihood (Allin Cottrell)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Jul 2013 19:18:08 +0300
From: Alecos Papadopoulos <papadopalex(a)aueb.gr>
Subject: Re: [Gretl-users] Constant in log-likelihood
To: gretl-users(a)lists.wfu.edu
Message-ID: <51DD8940.4030204(a)aueb.gr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
In model 1 (without the constant in the log-l), the value of the
maximized log-likelihood is -447.
If one wants to arrive at the actual full value of the log-likelihood
one should add to this nobs*ln(4/sqrt(2/$pi)) = 595*0.46.. = 274, and
obtain -447 + 274 = -173.
Now in model 2, parameter estimates are virtually identical with model
1, so one would expect that, since here the constant is already included
in the logl eq., it would arrive at a comparable result with the
corrected full value (i.e. -173), and not +511, which is the value for
the logl given by the code in model 2.
Alecos Papadopoulos
Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763
skype:alecos.papadopoulos
On 10/7/2013 19:00, gretl-users-request(a)lists.wfu.edu wrote:
> ------------------------------ Message: 2 Date: Wed, 10 Jul 2013
> 09:05:57 +0200 (CEST)
> From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
> Subject: Re: [Gretl-users] Graph two densities together and Constant
> in Log Likelihood To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID: <alpine.DEB.2.10.1307100904510.23263(a)ec-4.econ.univpm.it>
> Content-Type: text/plain; charset="iso-8859-15" On Wed, 10 Jul 2013,
> Alecos Papadopoulos wrote:
>> Just a note that
>> in model 2 (that is virtually identical to model 1 as regards to
>> estimates and final gradient values), the value of the logl appears
>> positive.
> Since you add a positive constant to each observation, why would that be
> surprising?
>
> -------------------------------------------------------
> 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
> -------------------------------------------------------
>
> ------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> End of Gretl-users Digest, Vol 78, Issue 12
> *******************************************
>
------------------------------
Message: 2
Date: Wed, 10 Jul 2013 12:43:09 -0400 (EDT)
From: Allin Cottrell <cottrell(a)wfu.edu>
Subject: Re: [Gretl-users] Constant in log-likelihood
To: Gretl list <gretl-users(a)lists.wfu.edu>
Message-ID: <alpine.LFD.2.10.1307101237360.16292@myrtle>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Wed, 10 Jul 2013, Alecos Papadopoulos wrote:
> In model 1 (without the constant in the log-l), the value of the
> maximized log-likelihood is -447.
> If one wants to arrive at the actual full value of the log-likelihood
> one should add to this nobs*ln(4/sqrt(2/$pi)) = 595*0.46.. = 274, and
> obtain -447 + 274 = -173.
ln(4/sqrt(2/$pi)) is not 0.46..., it's 1.612... And multiplication
by 595 gives an add factor of 959. You're calculating using 2*$pi
rather than 2/$pi?
Allin Cottrell
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 78, Issue 13
*******************************************