[Gretl-users] maximum like. conditions

Berend Hasselman bhh at xs4all.nl
Sun Nov 29 07:06:18 EST 2009


On 29-11-2009, at 12:27, Davor Horvatic wrote:

> ? mle ll = check ? (-0.5*(log(h) + (e^2)/h))
> ? series e = y - mu
> ? series h = var(y)
> ? series h = omega + alpha*(e(-1))^2 + beta*h(-1)
> ? scalar check = (alpha>0) & (beta>0)
> ? params mu omega alpha beta
> ? end mle
> Syntax error in command line
> 
> Error executing script: halting
>> end mle


A.
---------------------------------------------
I replaced the & in the scalar check = .. line  with &&
and got this

? mle ll = check ? (-0.5*(log(h) + (e^2)/h)) : NA
? series e = y - mu
? series h = var(y)
? series h = omega + alpha*(e(-1))^2 + beta*h(-1)
? scalar check = (alpha>0) && (beta>0)
? params mu omega alpha beta
? end mle
Data types not conformable for operation

Error executing script: halting
> end mle

B.
----------------------------------------------
I replaced the line scalar check ... by the following three lines

scalar checka = (alpha>0)
scalar checkb = (beta>0)
scalar check = checka+checkb

and now the script runs without error to completion.

Berend


More information about the Gretl-users mailing list