Panel stationarity test with structural breaks Carrion-i-Silvestre et al. (2005)

Dear All,

 

Please I am conducting a unit room test for panel data with multiple structural breaks and have adopted the Carrion-i-Silvestre et al. (2005) test together with the codes in Gauss.

I am currently running the bootstrap with Carrion-i-Silvestre et al. (2005) datasets and codes. I have not changed anything from the original code except the path of the file.

The error message reads " G0159: Wrong number of parameters "-

 

I suspects that the error message is emanating form the lines highlighted in bold black below:´.

Please see below codes and provide your support please!!!

 

 

 

/*
Lectura de la base de dades de PIB per capita
de Maddison.

Període: 1870-1994 per a 17 països (primera columna amb els anys).
*/

new;
cls;

output file = C:\gausslt19\lib\carion_new\carrion.out reset;
outwidth 256;

load odata[125,18]= C:\gausslt19\lib\carion_new\pibpcmad.prn;

aus=ln(odata[.,2]);
aust=ln(odata[.,3]);
bel=ln(odata[.,4]);
can=ln(odata[.,5]);
den=ln(odata[.,6]);
fin=ln(odata[.,7]);
fra=ln(odata[.,8]);
ger=ln(odata[.,9]);
ita=ln(odata[.,10]);
jap=odata[1:15,11]|ln(odata[16:rows(odata),11]);
ned=ln(odata[.,12]);
nze=ln(odata[.,13]);
nor=ln(odata[.,14]);
swe=ln(odata[.,15]);
swi=odata[1:29,16]|ln(odata[30:rows(odata),16]);
uk=ln(odata[.,17]);
usa=ln(odata[.,18]);

print "
/*********************************************************************/
/* Anàlisi */
/*********************************************************************/ " ;

/*data=aust~bel~can~den~fra~jap~usa; @ Data set that RHo at the 1% in Ben-David and Papell (1995) @*/
/*data=aust~bel~can~den~fra~jap~swe~uk~usa; @ Data set that RHo at the 1% and 2.5% in Ben-David and Papell (1995) @*/
/*data=aust~bel~can~den~fin~fra~ger~jap~swe~uk~usa; @ Data set that RHo at the 1, 2.5 and 10% in Ben-David and Papell (1995) @*/
/*data=aus~aust~bel~can~den~fin~fra~ger~ita~jap~ned~nze~nor~swe~swi~uk~usa; @ The Whole data set @*/
data=aus~aust~bel~can~den~fin~fra~ger~ita~ned~nze~nor~swe~uk~usa; @ Countries with complete time series 1870-... @

k=cols(data); @ Number of countries (individuals) @
bigt=rows(data); @ Number of time periods @
kernel=0|5;

m=5; @maximum number of structural changes allowed@

model0=2; @ Model quan no hi ha canvis. Segon model: efectes individuals + tendència @
model = 4; @ Model quan hi ha canvis. Canvis en la mitjana i en el pendent @

/*
model0=1; @ Model quan no hi ha canvis. Primer model: efectes individuals @
model = 3; @ Model quan hi ha canvis. Canvis en la mitjana @
*/

/**********************************************************************************************/
/**********************************************************************************************/

eps1=.15; @Value of the trimming (in percentage) for the construction
and critical values of the supF ype tests (used in the
supF test, the Dmax, the supF(l+1|l) and the sequential
procedure). if these test are used, h below should be set
at int(eps1*bigt). But if the tests are not required, estimation
can be done with an arbitrary h.
There are five options: eps1 = .05, .10, .15, .20 or .25.
for each option, the maximal value of m above is: 10 for eps1 = .05;
8 for eps1 = .10, 5 for eps1 = .15, 3 for eps1 = .20 and 2 for eps1 = .25.@
h=int(eps1*bigt); @minimal length of a segment (h >= q). Note: if
robust=1, h should be set at a larger value.@
/* the following are options if p > 0.
----------------------------------- */
fixb=0; @set to 1 if use fixed initial values for beta@
betaini=0; @if fixb=1, load the initial value of beta.@
maxi=20; @maximum number of iterations for the nonlinear
procedure to obtain global minimizers.@
printd=1; @set to 1 if want the output from the iterations
to be printed.@
eps=0.0001; @criterion for the convergence.@
/*--------------------------------- */

robust=0; @set to 1 if want to allow for heterogeneity
and autocorrelation the in residuals, 0 otherwise.
The method used is Andrews(1991) automatic
bandwidth with AR(1) approximation and the
quadratic quernel. Note: Do not set to 1 if
lagged dependent variables are included as
regressors.@
prewhit=0; @set to 1 if want to apply AR(1) prewhitening
prior to estimating the long run covariance
matrix@
hetdat=1; @Option for the construction of the F-tests.
Set to 1 if want to allow different moment matrices of the
regressors accross segments. if hetdat = 0, the same
moment matrices are assumed for each segment and estimated
from the full sample. It is recommended to set hetdat=1. if p > 0
set hetdat = 1.@
hetvar=1; @Option for the construction of the F-tests.
Set to 1 if want to allow for the variance of the residuals
to be different across segments. if hetvar=0, the variance
of the residuals is assumed constant across segments
and constructed from the full sample. This option is not available
when robust = 1.@
hetomega=1; @Used in the construction of the confidence
intervals for the break dates. if hetomega=0,
the long run covariance matrix of zu is assumed
identical accross segments (the variance of the
errors u if robust = 0).@
hetq=1; @Used in the construction of the confidence
intervals for the break dates. if hetq=0,
the moment matrix of the data is assumed
identical accross segments.@
doglobal=1; @set to 1 if want to call the procedure
to obtain global minimizers.@
dotest=1; @set to 1 if want to construct the sup F,
UDmax and WDmax tests. doglobal must be set
to 1 to run this procedure.@
dospflp1=1; @set to 1 if want to construct the sup(l+1|l)
tests where under the null the l breaks are
obtained using global minimizers. doglobal
must be set to 1 to run this procedure.@
doorder=1; @set to 1 if want to call the procedure that
selects the number of breaks using information
criteria. doglobal must be set to 1 to run
this procedure.@
dosequa=1; @set to 1 if want to estimate the breaks
sequentially and estimate the number of
breaks using the supF(l+1|l) test.@
dorepart=1; @set to 1 if want to modify the
break dates obtained from the sequential
method using the repartition method of
Bai (1995), Estimating breaks one at a time.
This is needed for the confidence intervals
obtained with estim below to be valid.@
estimbic=1; @set to 1 if want to estimate the model with
the number of breaks selected by BIC.@
estimlwz=0; @set to 1 if want to estimate the model with
the number of breaks selected by LWZ.@
estimseq=0; @set to 1 if want to estimate the model with
the number of breaks selected using the
sequential procedure.@
estimrep=0; @set to 1 if want to esimate the model with
the breaks selected using the repartition
method.@
estimfix=0; @set to 1 if want to estimate the model with
a prespecified number of breaks equal to fixn
set below.@
fixn=0;

/*****************************************************************************/
/*****************************************************************************/

if model == 3;
z=ones(bigt,1); @ Matrix conformeb by the elements that are allowed to change @
q=cols(z); @ Number of regressors z @
x=0;
p=0;
elseif model == 4;
z=ones(bigt,1)~seqa(1,1,bigt); @ Matrix conformeb by the elements that are allowed to change @
q=cols(z); @ Number of regressors z @
x=0;
p=0;
endif;

@ Matrices of results @
numkpss=zeros(k,1);
denkpss=zeros(k,1);
m_lee_est=zeros(k,4);
m_tb=zeros(1,m);
m_tb2=zeros(1,m);

m_deter=zeros(bigt,k);

j=1;
do until j>k;

{datevec,nbreak,mbic,mlwz,supfl,dateseq,ftest,wftest,reparv}=pbreak(bigt,data[.,j],z,q,m,h,eps1,robust,prewhit,hetomega,
hetq,doglobal,dotest,dospflp1,doorder,dosequa,dorepart,estimbic,estimlwz,
estimseq,estimrep,estimfix,fixb,x,q,eps,maxi,fixb,betaini,printd,hetdat,hetvar,fixn);

nbr=nbreak[2]; @ Numero de canvis detectats pel procediment sequencial al 5% de significacio @

/*nbr=mbic;*/

nbr=mlwz;

if nbr > 0;
tb=selif(datevec[.,nbr],datevec[.,nbr] .gt 0);
{kpsstest,num,den} = pankpss(data[.,j],tb,model,kernel);

deter=dekpss(model,bigt,tb);
beta=data[.,j]/deter;
m_deter[.,j] =deter*beta;

elseif nbr == 0;
{kpsstest,num,den} = pankpss(data[.,j],0,model0,kernel);

z=dekpss(model0,bigt,0);
beta=data[.,j]/z;
m_deter[.,j] =z*beta;

endif;

numkpss[j]=num;
denkpss[j]=den;
m_lee_est[j,.]=kpsstest~nbr~mbic~mlwz;

m_tb=m_tb|datevec;
m_tb2=m_tb2|reparv;

j=j+1;
endo;

test_hom=meanc(numkpss)./meanc(denkpss); @ Assuming homogeneous long-run variance @
test_het=meanc(m_lee_est[.,1]); @ Assuming heterogeneous long-run variance @

m_tb=m_tb[2:rows(m_tb),.];

test_mean=zeros(k,1);
test_var=zeros(k,1);

j=1;
do until j>k;
if m_lee_est[j,2] > 0;
temp1=m_tb[(j*m)-m+1:(j*m),.];
temp2=calcdem(model,temp1[.,m_lee_est[j,2]],bigt); @ Computes the mean and variance @
test_mean[j]=temp2[1];
test_var[j]=temp2[2];
elseif m_lee_est[j,2] == 0;
temp2=calcdem(model0,0,bigt); @ Computes the mean and variance @
test_mean[j]=temp2[1];
test_var[j]=temp2[2];
endif;
j=j+1;
endo;

test_mean=meanc(test_mean);
test_var=meanc(test_var);

testd_hom=sqrt(k)*(test_hom-test_mean)./sqrt(test_var);
testd_het=sqrt(k)*(test_het-test_mean)./sqrt(test_var);

print "************************************";
print "Results for the PANKPSS test ";
print "************************************";

print "Stationarity test with structural breaks (homogeneous): " testd_hom "with p-val: " cdfnc(testd_hom);
print "Stationarity test with structural breaks (heterogeneous): " testd_het "with p-val: " cdfnc(testd_het);

print "Nombre de breaks permesos com a maxim" m;
print "Matriu de tests individuals" m_lee_est;
print "Nombre d'observacions" rows(data);
print "Punts de trencament estimats" m_tb;

@++++++++++++@
@ Bootstrap @
@++++++++++++@

n=cols(data);
t=rows(data);
m_res=zeros(t,n); @ Matriu per deixar els residus @

i=1;
do until i>n; @ Residuals @
m_res[.,i]=data[.,i]-m_deter[.,i];
i=i+1;
endo;

re=2000; @ Nombre de rèpliques del Bootstrap @
m_kpss_hom=zeros(re,1);
m_kpss_het=zeros(re,1);
m_had_test=zeros(n,3);

j=1;
do while j<=re;
tt=rows(m_res);
m_resb=zeros(t+30,n);

i=1;
do while i<=rows(m_resb);
ord=trunc(((tt-1)-1+1)*rndu(1,1)+1);
m_resb[i,.]=m_res[ord,.];
i=i+1;
endo;

m_resb=m_resb[31:rows(m_resb),.];

yb=m_resb;

i=1;
do until i>n;
yb[.,i]=m_deter[.,i]+m_resb[.,i];
i=i+1;
endo;

i=1;
do until i>n;

temp1=m_tb[(i*m)-m+1:(i*m),.]; @ Matrix of Breaks @
dd_tb=temp1[.,m_lee_est[i,2]];

if nbr > 0;
dd_tb=selif(dd_tb,dd_tb .gt 0);
{kpsstest,num,den} = pankpss(yb[.,i],dd_tb,model,kernel);
elseif nbr == 0;
{kpsstest,num,den} = pankpss(yb[.,i],0,model0,kernel);
endif;

numkpss[i]=num;
denkpss[i]=den;
m_lee_est[i,.]=kpsstest~nbr~mbic~mlwz;

i=i+1;
endo;

test_hom=meanc(numkpss)./meanc(denkpss); @ Assuming homogeneous long-run variance @
test_het=meanc(m_lee_est[.,1]); @ Assuming heterogeneous long-run variance @

m_kpss_hom[j,.]=sqrt(n)*(test_hom-test_mean)./sqrt(test_var);
m_kpss_het[j,.]=sqrt(n)*(test_het-test_mean)./sqrt(test_var);

j=j+1;
endo;

e=0.01|0.025|0.05|0.1|0.9|0.95|0.975|0.99;

print "Homogeneous";
q=quantile(m_kpss_hom,e);
e~q;

print "Heterogeneous";
q=quantile(m_kpss_het,e);
e~q;

/****************************************/
/****************************************/

#include c:\josepll\articles\mariam\breaks\brcode2.src;
#include granada.src;

2 Answers



0



Hello,

This error generally occurs because the incorrect number of parameters are being passed into a GAUSS procedure.

I tested this on my own computer using the Carrion-i-Silvestre et al. (2005) code and discovered that, in my case, the error was being caused by a call to the ols in the brcode2.src.

The GAUSS procedure ols is an intrinsic GAUSS procedure. However, it a separate ols function was also defined by one of my installed libraries.

The intrinsic GAUSS ols requires three inputs, as is provided by the call to ols in the brcode2.src file. However, the ols procedure defined in the additional library only required two inputs.

Erica

Eric

105


0



Hallo Erica,

Thank you for the information. There were 2 additional files "Brcode2.src" and "grananda.src" which are together with the carrion zip file. I run then separately before bootstrapping. It worked perfectly. Thank you so much for your input.

Appreciated

Your Answer

2 Answers

0

Hello,

This error generally occurs because the incorrect number of parameters are being passed into a GAUSS procedure.

I tested this on my own computer using the Carrion-i-Silvestre et al. (2005) code and discovered that, in my case, the error was being caused by a call to the ols in the brcode2.src.

The GAUSS procedure ols is an intrinsic GAUSS procedure. However, it a separate ols function was also defined by one of my installed libraries.

The intrinsic GAUSS ols requires three inputs, as is provided by the call to ols in the brcode2.src file. However, the ols procedure defined in the additional library only required two inputs.

Erica

0

Hallo Erica,

Thank you for the information. There were 2 additional files "Brcode2.src" and "grananda.src" which are together with the carrion zip file. I run then separately before bootstrapping. It worked perfectly. Thank you so much for your input.

Appreciated


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.