OK, I figured out the correct code, so please confirm that I interpret
correctly.
Restriction criteria has to be written as
scalar check = (alpha>0) && (beta>0)
or in my case as
scalar check = (alpha>0) && (beta>0) && (gamma1>0)
if mle does not find parameters that are consistent with that, I'll get
output
like this
-----------------------------------
Tolerance = 1,81899e-012
Function evaluations: 417
Evaluations of gradient: 58
Model 1: ML, using observations 1-12059
ll = check ? -0.5*(log(h) + (e^2)/h) : NA
Standard errors based on Outer Products matrix
estimate std. error t-ratio p-value
--------------------------------------------------------
mu 0,000277590 NA NA NA
omega 0,0989841 NA NA NA
alpha 0,198343 NA NA NA
beta 0,155879 NA NA NA
gamma1 9,09556e-010 NA NA NA
Log-likelihood 5542,439 Akaike criterion -11074,88
Schwarz criterion -11037,89 Hannan-Quinn -11062,47
---------------------------------
if this is correct please correct section 17.2
All the best,
Davor
On 29.11.2009. 14:02, Davor Horvatic wrote:
OK, I can confirm this, that code runs now but constraint is not
applied, for example
scalar checka = (alpha>0)
scalar checkb = (beta>0)
scalar checkc = (gamma1>0)
scalar check = checka+checkb+checkc
applied to my model gives
estimate std. error t-ratio p-value
-----------------------------------------------------------
mu 0,000115904 0,00314962 0,03680 0,9706
omega 0,0991130 0,00457944 21,64 7,07e-104 ***
alpha 0,199138 0,0100301 19,85 1,02e-087 ***
beta 0,157351 0,0323213 4,868 1,13e-06 ***
gamma1 -1,78166 2,06923 -0,8610 0,3892
I did not supply whole code and data because I want to stick to
avaliable data in the gretle.
If I use only for example scalar check = (alpha>0)
I get:
Data types not conformable for operation
On 29.11.2009. 13:26, Davor Horvatic wrote:
> I'll try immediately, thanks. But still question remains why this
> does not work in original form. I took code from
> the end of section 17.2.
>
> Thanks once more,
> Davor
>
> On 29.11.2009. 13:06, Berend Hasselman wrote:
>
>
>> 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
>> _______________________________________________
>> Gretl-users mailing list
>> Gretl-users(a)lists.wfu.edu
>>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>>
>>
>>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>
>
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users