# [Gretl-users] Graph two densities together and Constant in Log Likelihood

Tue Jul 9 22:00:32 EDT 2013

```Ricardo (Jack), thanks for the continuing support.

GRAPH TWO DENSITIES TOGETHER : I saw the function you directed me to in
action using the examples with the series from the gretl data bases, now
I am trying to understand what it actually does and whether it suits my
purposes... Exploration is fun.

CONSTANT IN THE LOG-LIKELIHOOD: I will try what you suggest, and also I
few more things I have in mind, and will report back. 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.

Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763

>> GRAPH OF TWO DENSITIES TOGETHER: Thanks for providing the older link.
>> Although the code there is to plot two densities /consecutively /from left to
>> right, while what I need to do is to /superimpose/ them - and this I realize
>> now has the problem of having two different abscissaes series. Still, I
>> learned something new about handling plots in Gretl.
> Really? Have you seen this?
>
> http://lists.wfu.edu/pipermail/gretl-users/2013-April/008747.html
>
>
>> CONSTANT IN LOG-LIKELIHOOD
>> The basic code *without the constant in the log-l *is (omitting the initial
>> part where OLS executes to obtain initial values)
> [...]
>
>> *COMMENT: **slope coefficients are again comparable and the value of the
>> likelihood is close to what it should have been if its constant term was
>> added afterwards. But the estimates of the three variance terms v0 v1 v2 are
>> totally different, the one reaching the specified boundary of the parameter
>> space (zero). *
> This is very strange indeed. It *may* have something to do with the
> machine epsilon of your computer, but still it's very strange. Basically,
> models 1 and 2 converge to the same maximum (with negligible differences);
> model 3 really doesn't converge at all: BFGS gives you a spurious
> convergence message, but you're not on the maximum. Weird.
>
> Here's a couple of things you may try just to see what happens:
>
> * try using "set bfgs_richardson on"; this uses a different algorithm for
> computing numerical derivatives. Slower, but much more accurate.
>
> * re-parametrise your model so to avoid estimating quantities, such as
> variances, which have a lower bound. Try logarithms instead, for example.
>
>
> -------------------------------------------------------
>     Riccardo (Jack) Lucchetti
>     Dipartimento di Scienze Economiche e Sociali (DiSES)
>
>     Universit? Politecnica delle Marche
>     (formerly known as Universit? di Ancona)
>
>     r.lucchetti at univpm.it
>     http://www2.econ.univpm.it/servizi/hpp/lucchetti
> -------------------------------------------------------
>
> ------------------------------
>

```