Qu-Perron test multivariate breakpoint test

I am running the Qu-Perron test But I get the message "Undefined symbols: mainp." or "G0008 : Syntax error '#include mbreak.src" 'The link where the code can be downloaded is: http://people.bu.edu/perron/code.html

I check the prg file and scr file, I put them in the same folder under GAUSS scr folder.

could you please give some suggestions.

Thanks

I use the example Qu provides and try to run the code:

new;
library pgraph;
format /ld 6,3;
cls;

@select your output file@

output file = mbr-out.out reset;

@load the data@

load data[150,5]=data1.dat;

T=100

y = data[2 : T,.];
z = ones(T - 1, 1)~data[1 : T - 1.];
_S = eye(6);

@Specify the matrix _S (here the first and second regressors are used in the
first equation and the first and third regressors are used in the second equation)@

@set the maximum number of breaks allowed. If use the WDmax test set m=5, since the critical values reported
correspond to this case@

m=2;

@If you have restrictions, specify the matrix R (here only the constants (first
regressor) is allowed to change in each equation).
if you do not have restrictions, set R=eye(cols(_S)*(m+1))@

R={1 0 0 0 0 0 0 0,
0 1 0 0 0 0 0 0,
0 0 1 0 0 0 0 0,
0 0 0 1 0 0 0 0,
0 0 0 0 1 0 0 0,
0 1 0 0 0 0 0 0,
0 0 0 0 0 1 0 0,
0 0 0 1 0 0 0 0,
0 0 0 0 0 0 1 0,
0 1 0 0 0 0 0 0,
0 0 0 0 0 0 0 1,
0 0 0 1 0 0 0 0
};

@set the trimming parameter that specifies the minimal length of a segment as a proportion of the sample size.@

trm=0.2;

@set brv=1 when allowing breaks in the covariance matrix of the errors; otherwise, set brv=0@

brv=0;

@set brbeta=1 when allowing breaks in regression coefficients; otherwise, set brbeta=0.@

brbeta=1;

@set vauto=1 when applying a correction for serial correlation in the errors
(in which case Andrews' (1991) method is used to construct the robust
covariance matrix.@

vauto=0;

@set to prewhit=1 if you want to apply an AR(1) pre-whitening when estimating the
robust covariance matrix (see Andrews and Monahan (1992).@

prewhit=0;

@Set hetq=1 if you want to allow the distribution of the regressors to change across
regimes (this is used only when constructing confidence intervals for the estimates
of the break dates. For the construction of the test hetq=1 always.@

hetq=0;

/*Call the main procedure*/

call mainp(m,cols(_S),z,y,cols(y),trm,T,brv,brbeta,vauto,hetq,prewhit);

#include mbreak.src;

end;

4 Answers



0



I downloaded the original code from the link that you posted and was able to run it without a problem. I compared the file mbreak2.prg with the code you posted and noticed some problems towards the top of the file. When I replace the section of the code you posted from @select your output file@ to the initialization of _S with this code from the main2.prg from the link:

@select your output file@

output file = mbr-out.out reset; 

@load the data@

load data[150,5]=data1.dat;                  

@Set your T by n matrix of dependent variables@                                  
y=data[.,1:2];  

@Set your T by q matrix of regressors@  

z=data[.,3:5];   

@Specify the number of observations@

T=rows(y);    

@Specify the matrix _S (here the first and second regressors are used in the 
first equation and the first and third regressors are used in the second equation)@                      

_S={1 0 0 0,                              
    0 1 0 0,                              
    0 0 0 0,  
    0 0 1 0, 
    0 0 0 0, 
    0 0 0 1};

The code runs without problem.

aptech

1,323


0



Thank you for your answer.

I also tried this, but still failed, may I ask how did you work in GAUSS?

Do I need to set directory before using GAUSS?

My step is as follow:

  • move the files data1.dat, mbreak2.prg, and mbreak.src to the main folder of GAUSS.
  • Open Gauss and open these three files.
  • Run the file mbreak2.prg, and get the error message. G0008 : Syntax error '#include mbreak.src'.

I will be appreciated if you can help me.

Thank you for your time and I am looking forward to your response.

 

 

 



0



Oh..I think I see the problem now. I suspect that you are copying-and-pasting the program contents into the GAUSS command window. This will indeed give you the error, G0008 : Syntax error '#include mbreak.src'.

The #include command cannot be run from the command window and it is not a good practice to copy-and-paste a program file into the command input window anyway.

You should change your GAUSS working directory to be the same directory with the code and then either enter:

run mbreak2.prg

in the GAUSS command window, or use the Run button on the toolbar to run the program.

aptech

1,323


0



Yes, it Works !!

I can continue my research.

Thank you so much.

 

Your Answer


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 30 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy