- Nonlinear regression model - MATLAB - MathWorks India
- Evaluating Goodness of Fit - MATLAB & Simulink - MathWorks India
fitnlm interpretation of results
12 views (last 30 days)
Show older comments
Hi everyone
I have fitted a regression curve to my data using weighted least square method by fitnlm. The question is :
According to the properties below, how can I realize if the results from fitnlm are reasonable? The R-Squared and Coefficients are as attached below. The result of my fit is also shown below.
Thanks
Pooneh
0 Comments
Answers (1)
Avadhoot
on 30 Oct 2023
Hi Pooneh,
I understand that you have fitted a non-linear model to your data, and you want to analyse the goodness of fit for the model using its parameters.
As you have used a non-linear model, the residual equation,
SST = SSR + SSE
does not hold true. As a result of that the value of R2 comes out to be negative. Hence R2 cannot be used as a metric for measuring goodness of fit. You can use the values of MSE and RMSE to get an idea of the variance of the error. But it is useful only if the error term is Gaussian in nature.
Other parameters like “tStat”, “pValue” and “SE” indicate that the model is poorly fitting the data as the "pValue" is very low and "tStat" and "SE" are high.
Lastly, you can use the plot of actual vs predicted values to understand if the fit is optimal or not. From the plot it can be seen that the model is a poor fir for the data.
You can refer to the following documentation for more information about non-linear models and goodness of fit:
I hope it helps.
0 Comments
See Also
Categories
Find more on Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!