残差二乗和
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
プロットした図にそのデータの近似直線の追加とその近似直線とデータの残差二乗和をもとめるにはどうしたら良いでしょうか。
1 Kommentar
Antworten (2)
Hiro Yoshino
am 10 Jan. 2020
(x, y)データが入ったtableデータを用意します (variable name は x, yとかにします)
linear_model = fitlm(table, "y~x");
plot(linear_model)
で直線がピッと引かれます。
y~xの書き方はwilkinson's notationの表記といい、他にもモデルの表現の方法はありますが、覚えておくと便利です。
linear_modelはlinear modelクラスのインスタンスで、その中には色々と情報が入っていますので
properties(linear_model)
とやってみてみてください。統計量や推定したパラメータの信頼区間等も見つかります。
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!