...
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,
thanks a LOT, both for the exp/log trick and for getting the params allright for the
modprint.
Take care,
Daniel