On Wed, 4 Feb 2015, Alecos Papadopoulos wrote: > *Based on the above, I tried a simpler case, estimating parameters (no > regression), (and with a sample of 3 so as to do it also by hand and check > results), as follows
[...] > *I guess this is pretty simple, and the problem is just my inexperience, but > I cannot understand the expectations of the software here.* *So I am calling > for help again.** Thank you. 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> ------------------------------------------------------- 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 -------------------------------------------------------