That worked perfectly, thanks!
Alecos Papadopoulos
Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763
skype:alecos.papadopoulos
On 4/2/2015 19:00, gretl-users-request(a)lists.wfu.edu wrote:
There were a couple of syntax error when declaring/calling functions:
(a)
you didn't use the "return" keyword in your negbr/posbr functions, and (b)
you shouldn't use type specifiers (scalar, series etc) when calling your
functions. See below:
<hansl>
nulldata 4
series Z = {-1, 1, 2, 1}
scalar s1 = 1
scalar s2 = 1
function series negbr(series Z, scalar s1, scalar s2)
return -ln(s1+s2)+ (1/s2)*Z
end function
function series posbr(series Z, scalar s1, scalar s2)
return -ln(s1+s2)-(1/s1)*Z
end function
function series loglik(series Z, scalar s1, scalar s2)
series liky = (Z>0)? posbr(Z, s1, s2): negbr(Z, s1, s2)
return liky
end function
mle logl = loglik(Z, s1, s2)
params s1 s2
end mle --verbose
</hansl>