GMM stimation
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
GMM stimation
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
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
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: GMM stimation
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:
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
Re: GMM stimation
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?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: GMM stimation
What arguments?
To change ser01 you can change:
to be:
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
Re: GMM stimation
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
i would like to stimate like this
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: GMM stimation
Just look up the system gmm estimation section of the command reference. It lists the full set of options.
Follow us on Twitter @IHSEViews
Re: GMM stimation
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
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!!!
Thanks in advance!!!
Re: GMM stimation
only lack the correct specification of the gmm to estimate the routine and to save me manually of statimate very times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: GMM stimation
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
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: GMM stimation
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".
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
Who is online
Users browsing this forum: No registered users and 37 guests