Page 1 of 1

System estimation and normality test

Posted: Mon Jun 26, 2017 9:20 am
by Jules89
Dear Tom,

I have a autocorrelated time series, which I want to test for normality.
Therefore I want to estimate the following system of equations by GMM, where I correct the errors for autocorrelation:

x_t = a_1 +error1
(x_t)^2 - 1 = a_2 + error2
(x_t)^3 = a_3 + error3
(x_t)^4 -3 = a_4 +error4

To test normality I want to test the joint hypothesis: a_1=a_2=a_3=a_4 and the four single hypothesis a_i = 0 for i = 1,...,4

My two questions are:
1) Within this framework GMM would correspond to OLS right? Is it therefore possible to estimate the system by SUR?
2) how would I test the joint hypothesis a_1=a_2=a_3=a_4=0?

Thank you

Best Jules

Re: System estimation and normality test

Posted: Mon Jun 26, 2017 10:45 am
by TomDoan
Doesn't that work only if the variance is 1?

Yes, you could use SUR, but it's probably simpler to use NLSYSTEM to do the GMM estimates. See the westcho_summary.rpf program in the West and Cho JOE 1995 replication for an example.

You can just use TEST for that.

Re: System estimation and normality test

Posted: Mon Jun 26, 2017 11:13 am
by Jules89
Yes you are right, I test for Standard normality.

Since i am Not Using any Instruments isnt gmm simply Öls? And wouldnt a simple sur estimate those linear equations simpler?

Best

Jules

Re: System estimation and normality test

Posted: Mon Jun 26, 2017 11:35 am
by TomDoan
It's even simpler than OLS---you can do all of those by just taking means. However, you're doing a joint test and you need a joint covariance matrix of the parameters in order to do that. NLSYSTEM is the simplest way to do that---the whole thing takes about five lines.

Re: System estimation and normality test

Posted: Mon Jun 26, 2017 11:50 am
by Jules89
Thanks a lot. When I do the joint wald Test, do you think I Run into problems regarding the autocorrelation in the series? Or does the newey-west corrected estimator Account for that?

Best

Jules

Re: System estimation and normality test

Posted: Mon Jun 26, 2017 11:57 am
by TomDoan
That's the whole point of doing the robusterrors. The point estimates don't change, but the covariance matrix does.

Re: System estimation and normality test

Posted: Tue Jun 27, 2017 2:39 am
by Jules89
One further question regarding the use of the instruments instruction. In the WESTCHO_SUMMARY.RPF the following code is given

Code: Select all

nonlin(parmset=meanparms) m1 m2 m3 m4
frml f1 = s{0}-m1
frml f2 = (s{0}-m1)^2-m2
frml f3 = (s{0}-m1)^3-m3
frml f4 = (s{0}-m1)^4-m4
*
compute m1=0.0
compute m2=1.0
compute m3=0.0
compute m4=0.5

instruments constant
nlsystem(robust,lags=4,lwindow=newey,parmset=meanparms,inst) 2 * f1 f2 f3 f4
summarize(title="Mean",parmset=meanparms) m1
summarize(title="Standard Deviation",parmset=meanparms) sqrt(m2)
summarize(title="Skewness",parmset=meanparms) m3/m2^1.5
summarize(title="Excess Kurtosis",parmset=meanparms) m4/m2^2.0-3.0
In the formulas f1,...,f4 there is also just an "intercept" estimated, which is mu1,...,m4.
When GMM is applied I am not sure whether I understand the following codeline correctly:

instruments constant

As far as I understand the constants of the four equations are m1,...,m4.
When I apply GMM shouldn't "instruments mu1 mu2 mu3 mu4" be the right code, or does RATS notice that m1,...,m4 are the constants and thats why " instruments constant " is used?

Thanks

Jules

Re: System estimation and normality test

Posted: Tue Jun 27, 2017 9:11 am
by TomDoan
INSTRUMENTS CONSTANT

gives you "method of moments" (which existed long before Hansen's work), that is, it solves

sum (condition) x 1 (i.e. CONSTANT) = 0

The "generalized" in GMM is for the use of the weight matrices which have no effect in this case.

Re: System estimation and normality test

Posted: Tue Jun 27, 2017 10:10 am
by Jules89
AS far as I understand the MM, we have something Like

E(Xu)=0 which is Made feasible by Using Sum(Xu)=0

What do you meaning by" x 1 (i.e. CONSTANT) "?

Thanks jules

Re: System estimation and normality test

Posted: Tue Jun 27, 2017 10:35 am
by TomDoan
You're overthinking this. Isn't sum(X)=sum(X x 1)? CONSTANT = all ones. That's how you tell it you want to do method of moments, use only CONSTANT as an instrument.

Re: System estimation and normality test

Posted: Wed Jul 19, 2017 6:59 am
by Jules89
Hi Tom,

in the post earlier you said that the test instruction can be used to test the joint hypothesis mu_1=...=mu_4=0.

Given some data series, z1m, which I want to test for normality (and which I cannot post here) my code is:

Code: Select all

set mom11 = z1m
set mom12 = (z1m^2) - 1
set mom13 = z1m^3
set mom14 = (z1m^4) - 3


compute start = some date
compute end = some date

nonlin(parmset=moments1) m11 m12 m13 m14
frml f11 = mom11 - m11
frml f12 = mom12 - m12
frml f13 = mom13 - m13
frml f14 = mom14 - m14

compute m11 = 0
compute m12 = 0
compute m13 = 0
compute m14 = 0

instruments constant
nlsystem(robust,lags=6,lwindow=newey,parmset=moments1,instr) start end f11 f12 f13 f14

test(form=CHISQUARED)
# 1 2 3 4 
# 0 0 0 0

Is the test isntruction used correctly to perfom the Wald test with newey west corrected standard errors?
Moreover I get the following result:

Chi-Squared(4)= 8.914077 or F(4,*)= 2.97852 with Significance Level 0.12974656

Is the P-value at the end for the Chi-Squared(4) or the F(4,*) test?

Thank you

Best Jules

Re: System estimation and normality test

Posted: Wed Jul 19, 2017 7:50 am
by TomDoan
They have exactly the same p-value.

Re: System estimation and normality test

Posted: Wed Jul 19, 2017 8:27 am
by Jules89
And the

test(form=CHISQUARED)
# 1 2 3 4
# 0 0 0 0

is the right command to perform the wald test for mu_1=...=mu_4=0 with the above chosen newey west corrected standard errors?

Re: System estimation and normality test

Posted: Wed Jul 19, 2017 8:37 am
by TomDoan
In this case, you could shorten it to just

test(zeros,all)

but what you have will work. The form=chisquared isn't necessary, since that's the form that is provided by NLSYSTEM anyway. However, wouldn't a test for Normality only involve the third and fourth moments? Isn't what you sending to this mean 0 variance 1 pretty much by construction? Adding those two to the joint test would reduce the power to detect deviations from Gaussianity.