I created in Matlab two independent random walk through the command:

y = cumsum(randn(10000,2))

Although the series are clearly independent, when I try to run the function "CommonTrendsTest" in Gretl through the following script:

include CommonTrendsTest.gfn
list totest = v1 v2
trend = 0
matrix NH = CommonTrendsTest(totest)

I get the following output:

                     teststat        cv10%         cv5%         cv1%
K=1=N-1                38,582      0,16200      0,21800      0,38300
K=0                    1960,5      0,60700      0,74800       1,0740 

I have done a lot of tests but I always get results similar to this.

I also tried to implement the Nyblom Harvey Test in Matlab through the following script:

T = size(y,1);
y = y';
mu = mean(y,2); 
e = y-repmat(mu,1);
z = cumsum(e,2); 
C = (1/(T^2))*z*z';
S = (1/T)*e*e';
csi = trace((S^-1)*C);

but I get similar results.

Thank you in advance for your help.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.