フィルターのクリア

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

3 ビュー (過去 30 日間)
Vincent Moron
Vincent Moron 2013 年 1 月 11 日
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 Center および File ExchangeModel Building and Assessment についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by