On Sat, 24 Jan 2015, Daniel Bencik wrote:
Sven,
thanks. Regardless of how I try to see how this works, I cant figure it out.
The simplest LL I work with is
<hansl>
mle ll = -ln(lambda) - xDepVars[yIdx]/lambda
series lambda = mean(xDepVars[yIdx])
series lambda = c_ + rng * xExpVars[xIdx] + err * lambda(-1)
params c_ rng err
end mle --robust
</hansl>
The idea is to force certain quantities to be positive so that lambda
cannot be negative, eg:
<hansl>
series y = xDepVars[yIdx]
series x = xDepVars[xIdx]
scalar m = mean(y) # assume this is positive
matrix b = zeros(3,1)
mle ll = -ln(lambda) - xDepVars[yIdx]/lambda
series lambda = m
scalar c_ = exp(b[1])
scalar rng = exp(b[2])
scalar err = exp(b[3])
series lambda = c_ + rng * x + err * lambda(-1)
params b
end mle --robust
matrix c = exp(b)
matrix V = $vcv .* (c*c') # delta method
matrix s = sqrt(diag(V))
matrix cs = c ~ s
string parnames = "C_,rng,err"
modelprint cs parnames
</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
-------------------------------------------------------