How to calculate r squared from a given cos regression model
1 回表示 (過去 30 日間)
古いコメントを表示
Hi i am a new learner, i got confused how can i calculate like this,
if there's two sets,
x = [0.0000 0.5236 1.0472 1.5708 2.0944 2.6180 3.1416]
y = [2.7600 -2.3902 1.3800 0.0000 -1.3800 2.3902 -2.7600]
and the given function, y = a ∗ cos(5x), find the r squared for this function
0 件のコメント
採用された回答
Rik
2020 年 3 月 16 日
y_fit = a ∗ cos(5*x)
err=y-y_fit;
SSres=sum(err.^2);
SStot=sum((y-mean(y)).^2);
rsq=1-(SSres./SStot);
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!