필터 지우기
필터 지우기

why regstats give an error when I try to build a quadratic model

조회 수: 3 (최근 30일)
Hello
I am trying a very simple model for a parabola with noise
>> Y=sin([0:0.01:pi])+rand(1,315)/1; >> X=[1:315]+rand(1,315); >> % X is my data and Y is considered to be the response >> regstats(Y,X,'quadratic')
returns
Warning: The exact method is impossible. Will be forced to use approximate method. > In stats/private/pvaluedw at 46 In dwtest at 74 In regstats at 352 In regstats at 155
If I inverse
>> s=regstats(X,Y,'quadratic')
>> s.rsquare
ans =
1.3575e-04
it works but then the rsquare is close to zero while it is a simple parabola and the model should be efficient. I expect a rsquare close to 1 ?
Any help for the two different issues is welcome
Vincent
Thanks in advance
Vincent

채택된 답변

Tom Lane
Tom Lane 2013년 1월 11일
편집: Tom Lane 2013년 1월 11일
The warning is just an indication that the significance of the Durbin-Watson statistic is outside the range of a table of exact values, so the quantity is being approximated. That should not be a problem for you.
When I try your example I get rsquare around 0.5 each time. If you plot X vs. Y you will see there is substantial scatter, so I would not expect a value near 1. I can't reproduce your result showing a value near 0.

추가 답변 (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