Problems in using "dwtest"

조회 수: 7 (최근 30일)
Armando MAROZZI
Armando MAROZZI 2020년 4월 4일
댓글: Armando MAROZZI 2020년 4월 4일
I have a simple Tx3 matrix of residuals. I want to apply to it the dwtest to test for autocorrellation (I also used autocorr but still I'd like to see a statistic).
However, when I try to implement it, I get:
dwtest(VAR1.res(:, 1), 'Exact')
Error using qr
Invalid data type. First argument must be double or single.
Error in pvaluedw (line 34)
[Q,~] = qr(X);
Error in dwtest (line 100)
pdw = pvaluedw(dw,X,option);
% but it it is indeed "double"
class(VAR1.res(:,1))
ans =
'double'
What am I doing wrong?

채택된 답변

Tommy
Tommy 2020년 4월 4일
The error is saying the first argument to qr() must be double or single. That first argument is X, and if you comb through dwtest and pvaluedw you'll see that X is actually your second argument to dwtest, in this case 'Exact' - not a double.
You'll have to match the syntax of dwtest from https://www.mathworks.com/help/stats/dwtest.html :
p = dwtest(r,x,'Method','exact')
  댓글 수: 1
Armando MAROZZI
Armando MAROZZI 2020년 4월 4일
thank you Tommy! silly mistake!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by