Page 1 of 1
GMM stimation
Posted: Tue Dec 01, 2009 10:24 am
by rogerioms
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
Re: GMM stimation
Posted: Tue Dec 01, 2009 10:38 am
by EViews Gareth
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
Re: GMM stimation
Posted: Tue Dec 01, 2009 11:07 am
by rogerioms
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?
Re: GMM stimation
Posted: Tue Dec 01, 2009 11:12 am
by EViews Gareth
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)
Re: GMM stimation
Posted: Tue Dec 01, 2009 11:33 am
by rogerioms
gmm=2sls for example, I want to stimate the system GMM using Identity matrix estimation weights - 2SLS coefs with GMM standard errors
Re: GMM stimation
Posted: Tue Dec 01, 2009 12:18 pm
by rogerioms
i would like to stimate like this

Re: GMM stimation
Posted: Tue Dec 01, 2009 12:23 pm
by EViews Gareth
Just look up the system gmm estimation section of the command reference. It lists the full set of options.
Re: GMM stimation
Posted: Tue Dec 01, 2009 1:12 pm
by rogerioms
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
Re: GMM stimation
Posted: Wed Dec 02, 2009 11:42 am
by rogerioms
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!!!
Re: GMM stimation
Posted: Thu Dec 03, 2009 4:08 am
by rogerioms
can nobody help me?
Re: GMM stimation
Posted: Thu Dec 03, 2009 5:49 am
by rogerioms
only lack the correct specification of the gmm to estimate the routine and to save me manually of statimate very times
Re: GMM stimation
Posted: Thu Dec 03, 2009 8:42 am
by EViews Gareth
Did you try looking in the Command Reference?
Re: GMM stimation
Posted: Thu Dec 03, 2009 3:56 pm
by rogerioms
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
Re: GMM stimation
Posted: Thu Dec 03, 2009 4:29 pm
by EViews Gareth
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".