How does Matlab calculate mean squared error in sbiofit?

1 回表示 (過去 30 日間)
Oscar
Oscar 2023 年 1 月 18 日
コメント済み: Oscar 2023 年 1 月 19 日
I'm fitting a simbiology model to experimental data. After the fit I can see that the model fits the data pretty well. However, the MSE property in the optimresults object returns Inf even though the residuals are not Inf (as shown from the optimresults Output property).

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2023 年 1 月 18 日
The MSE could be Inf for several reasons. My guess is that you have a poorly posed fitting problem. Did you see any warning messages during the fit? That might give you additional clues.
Also, you can find the MATLAB code that does this calculation in function calcCovBeta of class SimBiology.fit.internal.FitObject, but let me summarize the calculations here. MSE is the sum of the sequares of the residuals divided by the degrees of freedom. If you try to estimate 2 parameters with 2 observations, your degrees of freedom will be 0, and the MSE will be Inf.
If you still don't understand why the MSE is Inf after reading these details, then I suggest sharing reproduction steps. Then, we can step through the calculations in the debugger and see exactly where and why the Inf value occurs.
  1 件のコメント
Oscar
Oscar 2023 年 1 月 19 日
Hi Arthus, thank you for the prompt response! This answers my question. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

コミュニティ

その他の回答  SimBiology コミュニティ

カテゴリ

Help Center および File ExchangeNonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by