why regstats give an error when I try to build a quadratic model
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
Tom Lane
am 11 Jan. 2013
Bearbeitet: Tom Lane
am 11 Jan. 2013
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Model Building and Assessment finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!