On Sun, 4 Oct 2015, oleg_komashko(a)ukr.net wrote:
Dear Sven,
Thanks for hopeful comment.
First of all I mean R and Octave, since the are as GNU as Gretl, and
the
only marginal costs are several (dozens) seconds to install. I plan to
include install.packages(c("pkg1","pkg2",....) into the sample
script,
so the user has only to install R and run the sample script once.
I take your point, but it would be better if function packages could be
trusted to rely only on gretl and its own dependencies (gnuplot, latex
etc). Otherwise, users would need to maintain pieces of software they
don't really need just to use ONE feature.
Besides, I would imagine that writing a panel version of the poisson model
is perfectly possible in hansl. For example, what follows is a quick
replication of the fixed-effects Poisson example given in Greene's
textbook (7th ed), p. 822. It took me about half an hour to write it (and
it can surely be optimised, with analytical derivatives and all the rest).
<hansl>
function series llik(series y, series lambda)
ret = -lambda + y*ln(lambda) - lngamma(y+1)
return ok(y) ? ret : 0
end function
function series do_lambda(matrix beta, list X, series y)
series m = exp(lincomb(X, beta))
series ahat = ln(pmean(y) / pmean(m))
return exp(ahat) * m
end function
open
http://www2.econ.univpm.it/servizi/hpp/lucchetti/gretl/rwm.gdt
setobs id year --panel-vars
list X = const age educ hhkids hhninc public
series y = ln(docvis+0.5)
ols y X --quiet
matrix b = $coeff[2:]
list X -= const
ym = pmean(docvis)
smpl ym>0 --restrict
mle ll = llik(docvis, lambda)
series lambda = do_lambda(b, X, docvis)
params b
end mle -vh
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------