EGCITEST: Error using lagmatrix (line 25) lagmatrix: wrong # of input arguments. Please, can someone help? thx
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
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...
0 个评论
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!