Thanks.... It works fine!!!
On Sat, Nov 24, 2018, 6:11 PM Allin Cottrell <cottrell(a)wfu.edu wrote:
On Sat, 24 Nov 2018, Olasehinde Timmy wrote:
> Dear Professors,
>
> I am writing to ask for your guidance. I am trying to estimate a system
of
> two variables jointly using multinormal distribution, however, my effort
> has not been successful.
>
> Please, see the code/syntax I am trying to run in the bold form below.
> Could you please help to see if something was not right with the code.
>
> I hope to receive a response from you soon.
>
> #The hansl syntax#
> *scalar beta1= 4.3 *
> *scalar beta2= 0.16 *
> *scalar alfa1= 0.0097*
> *scalar alfa2= 0.02*
> *scalar mlog2pi = 2*log(2*acos(-1))*
> *series e1= a - beta1 - beta2*a(-1)*
> *series e2= b - alfa1 - alfa2*b(-1)*
> *series es1 = e1^2*
> *series es2 = e2^2*
> *series v1= var(e1)*
> *series v2= var(e2)*
> *series v12 = cov(e1,e2)*
> *series de = v1*v2 - v12^2*
> *series iv1 = v1/de*
> *series iv2 = v2/de*
> *series iv3 = v12/de*
> *mle ll = -0.5*(mlog2pi + log(de) + (iv1*es1 + iv2*es2 + 2*iv3*e1*e2)) *
> * params beta1 beta2 alfa1 alfa2*
> * end mle*
You need to make your parameters do something, and you can do that by
moving the relevant series calculations into the "mle" block -- then
the various series will be updated when the parameters are changed. So
something like the following:
<hansl>
nulldata 100
series a = normal()
series b = normal()
scalar beta1 = 4.3
scalar beta2 = 0.16
scalar alfa1 = 0.0097
scalar alfa2 = 0.02
scalar mlog2pi = 2*log(2*acos(-1))
mle ll = -0.5*(mlog2pi + log(de) + (iv1*es1 + iv2*es2 + 2*iv3*e1*e2))
series e1 = a - beta1 - beta2*a(-1)
series e2 = b - alfa1 - alfa2*b(-1)
series es1 = e1^2
series es2 = e2^2
series v1 = var(e1)
series v2 = var(e2)
series v12 = cov(e1,e2)
series de = v1*v2 - v12^2
series iv1 = v1/de
series iv2 = v2/de
series iv3 = v12/de
params beta1 beta2 alfa1 alfa2
end mle
</hansl>
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users