EGCITEST: Error using lagmatrix (line 25) lagmatrix: wrong # of input arguments. Please, can someone help? thx

7 ビュー (過去 30 日間)
Vincenzo Di Gennaro
Vincenzo Di Gennaro 2013 年 12 月 30 日
回答済み: Ali Komai 2019 年 4 月 2 日
Hello,
I am trying to use built-in fx to check cointegration but when I use adftest and egcitest (I have the econometric package installed) I get the following msg:
EDU>> doc egictest
EDU>> load Data_Canada
Y = Data(:,3:end);
names = series(3:end);
plot(dates,Y)
legend(names,'location','NW')
grid on
EDU>> [h,pValue,stat,cValue,reg] = egcitest(Y,'test',...
{'t1','t2'});
Error using lagmatrix (line 25)
lagmatrix: wrong # of input arguments
Error in adftest>runReg (line 686)
yLags = lagmatrix(y,0:(testLags+1));
Error in adftest (line 414)
testReg = runReg(i,y,testT,testLags,testModel,needRegOut);
Error in egcitest/runRReg (line 1043)
[~,~,testStat] = adftest(res,'lags',testLags,'test',testType);
Error in egcitest (line 397)
testStat = runRReg;
Please, anyone can help?
thx a lot

回答 (2 件)

steve
steve 2014 年 1 月 22 日
I believe there is a conflict between the matlab standard function "lagmatrix" and the "lagmatrix that comes with the spatial econometrics package. I had the same problem - it does away if you delete the spatial econometrics package from the path file. Although this is not an ideal solution...

Ali Komai
Ali Komai 2019 年 4 月 2 日
I had a strange variation of this error and thought I post it. Steve is correct that the error is caused by a conflicting file of the spatial econometrics toolbox and taking the later from the matlab-path solves the problem but (here comes the funny part) the error reoccurs when egcitest is used in a parfor-loop!
Although I do not understand how this is possible. Even if the file of the spatial econometrics toolbox is NOT on the matlab path, it will be chosen in a parfor-loop over the file with the same name in the econometrics toolbox. I solved the issue now by renaming the file from the spatial econometrics toolbox.

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by