Page 1 of 1

GMM and covariance among factors

Posted: Thu Jun 06, 2019 2:48 pm
by RDS
Given the 7 variables (y1,...,y7) and the tree factors (x1, x2 and x3), is it possible to save the covariance of factors x1, x2 and x3 using GMM, after solving the system below?

system SDF
SDF.append ( y1*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y2*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y3*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y4*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y5*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y6*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF.append ( y7*(1 - c(1)*(x1 - c(4)) - c(2)*(x2 - c(5)) - c(3)*(x3 - c(6))) ) = 0 @ c
SDF_all_{%type}.append ( X1 - c(4) ) = 0 @ c
SDF_all_{%type}.append ( x2 - c(5) ) = 0 @ c
SDF_all_{%type}.append ( x3 - c(6) ) = 0 @ c

param c(1) 0.9 c(2) 0.9 c(3) 0.9 c(4) 0.9 c(5) 0.9 c(6) 0.9
'Sequential weighting matrix & coefficient iteration
'Cross section (White Cov) will result in GMM estimates robust to heteroskedasticity of unknown form
SDF_all_{%type}.gmm(instwgt=white,method=nstep,wtype=istdev,s)

Re: GMM and covariance among factors

Posted: Thu Jun 20, 2019 7:23 am
by RDS
I am able to save the coefficients of this system in a Table, for example
Table(1,1) = SDF.c(1)
but I am not able to save the standard errors

do you have a suggestion?

Re: GMM and covariance among factors

Posted: Thu Jun 20, 2019 7:45 am
by RDS
problem solved

Table = SDF.@stderrs(1)

Re: GMM and covariance among factors

Posted: Thu Jun 20, 2019 7:52 am
by RDS
No, actually not, because @stderrs(1) refers to the 1st coefficient, which is not necessarily c(1)

How can I get the standard errors, which are associated directly to the parameter c(1): something like @stderrs(c(1))?.

Re: GMM and covariance among factors

Posted: Thu Jun 20, 2019 8:15 am
by EViews Gareth
No, you'll have to work out the translation manually.