GMM stimation

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

GMM stimation

Postby rogerioms » Tue Dec 01, 2009 10:24 am

Hi,
how I turn the following system for gmm

(ibov*sdf_st)-(1-c(1))
(poup*sdf_st)-(1-c(2))
(ser01*sdf_st)-(1-c(3))

@inst ser01(-1) poup(-1) ibov(-1)

in the programming window? I want to do that because I need to insert a loop that is going ser01 to ser83 and I still want to insert a wald test that jointly
C(1)=0, c(2)=0 and c(3)=0

a sketch would be

for i=1 to 83
equation sei_la.gmm( ) (ibov*sdf_st)-(1-c(1)) (poup*sdf_st)-(1-c(2)) (ser0&"i"*sdf_st)-(1-c(3)) @ ser0&"i"(-1) poup(-1) ibov(-1)
vector(83) var1(i)=@coefs(1) var2(i)=@coefs(2) var3(i)=@coefs(3)
vector(83) t1(i)=@tstats(1) t2(i)=@tstats(2) t3(i)=@tstats(3)

wald c(1)=0, c(2)=0, c(3)=0
vector(83) waldtest(1)=tstatsofwaldtest( )
endfor

thanks in advance

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: GMM stimation

Postby EViews Gareth » Tue Dec 01, 2009 10:38 am

It isn't quite clear what you're trying to do. The first part of your question seems to indicate you're estimating a system, yet the code you gave indicates you're estimating a (single) equation.

If you're trying to estimate a system programmatically, then you want something like:

Code: Select all

system s
s.append (ibov*sdf_st)-(1-c(1))
s.append  (poup*sdf_st)-(1-c(2))
s.append (ser01*sdf_st)-(1-c(3))   
s.append @inst ser01(-1) poup(-1) ibov(-1)
s.gmm
Follow us on Twitter @IHSEViews

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Tue Dec 01, 2009 11:07 am

yes, I am stimating a system, but how do I put the arguments in GMM in that form? and how I can change the series in a loop, for exmplo ser01 to ser83?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: GMM stimation

Postby EViews Gareth » Tue Dec 01, 2009 11:12 am

What arguments?

To change ser01 you can change:

Code: Select all

s.append @inst ser01(-1) poup(-1) ibov(-1)


to be:

Code: Select all

s.append @inst ser!i(-1) poup(-1) ibov(-1)
Follow us on Twitter @IHSEViews

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Tue Dec 01, 2009 11:33 am

gmm=2sls for example, I want to stimate the system GMM using Identity matrix estimation weights - 2SLS coefs with GMM standard errors

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Tue Dec 01, 2009 12:18 pm

i would like to stimate like this Image

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: GMM stimation

Postby EViews Gareth » Tue Dec 01, 2009 12:23 pm

Just look up the system gmm estimation section of the command reference. It lists the full set of options.
Follow us on Twitter @IHSEViews

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Tue Dec 01, 2009 1:12 pm

where am i put gmm=2sls in this code

Code: Select all

scalar i
for !i=1 to 83


   system s
   s.append (ibov*sdf_st)-(1-c(1))
   s.append  (poup*sdf_st)-(1-c(2))
   s.append (ser!i*sdf_st)-(1-c(3))   
   s.append @inst ser!i(-1) poup(-1) ibov(-1)
   s.gmm @gmm=2sls
   s.wald c(1)=0, c(2)=0, c(3)=0
next

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Wed Dec 02, 2009 11:42 am

Instead of the "Linear estimation after one-step weighting standard matrix", I would like to estimate using "Identity matrix estimation weights - 2SLS coefs with GMM standard errors", in other words, if I was using the graphic method instead of programming I would be as if I chose the option of the illustration above

Thanks in advance!!!

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Thu Dec 03, 2009 4:08 am

can nobody help me?

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Thu Dec 03, 2009 5:49 am

only lack the correct specification of the gmm to estimate the routine and to save me manually of statimate very times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: GMM stimation

Postby EViews Gareth » Thu Dec 03, 2009 8:42 am

Did you try looking in the Command Reference?
Follow us on Twitter @IHSEViews

rogerioms
Posts: 21
Joined: Thu Apr 16, 2009 11:33 am

Re: GMM stimation

Postby rogerioms » Thu Dec 03, 2009 3:56 pm

yes, i did. In the Command Reference doesn't clear. I put gmm=2sls as below but that doesn't work, but when I put other arguments works, I tested several forms but none gave me the output that I receive saw graphic way

Code: Select all

 
scalar i
for !i=1 to 75


         system s.gmm(gmm=2sls)
         s.append (ibov*sdf_st)-(1-c(1))
         s.append  (poup*sdf_st)-(1-c(2))
         s.append (stock!i*sdf_st)-(1-c(3))   
         s.append @inst stock!i(-1) poup(-1) ibov(-1)

freeze(tabelasgmm)   s.gmm(gmm=2sls)

vector(75) coef1(!i)=@val(tabelasgmm(12,2))
vector(75) coef2(!i)=@val(tabelasgmm(13,2))
vector(75) coef3(!i)=@val(tabelasgmm(14,2))
vector(75) sterr1(!i)=@val(tabelasgmm(12,3))
vector(75) sterr2(!i)=@val(tabelasgmm(13,3))
vector(75) sterr3(!i)=@val(tabelasgmm(14,3))
vector(75) p1(!i)=@val(tabelasgmm(12,5))
vector(75) p2(!i)=@val(tabelasgmm(13,5))
vector(75) p3(!i)=@val(tabelasgmm(14,5))
vector(75) j(!i)=@val(tabelasgmm(17,3))

delete tabelasgmm

freeze(testewald)   s.wald c(1)=0, c(2)=0, c(3)=0

vector(75) estatwald(!i)=@val(testewald(6,2))
vector(75) pvaluewald(!i)=@val(testewald(6,4))

delete testewald

next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: GMM stimation

Postby EViews Gareth » Thu Dec 03, 2009 4:29 pm

I have no idea where you got the "gmm=2sls" bit from.

The command reference clearly says you use an "e" option for "TSLS estimates with GMM standard errors".

Code: Select all

s.gmm(e)
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 37 guests