set parameters of nlinfit function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mani Ahmadian
el 14 de Sept. de 2014
Comentada: Star Strider
el 15 de Oct. de 2014
Hi
I’m beginner in MATLAB. I have some experimental points and I used nlinfit function to solve my problem and find the best LS curve fitting result. When I use the nlinfit, it pass MSE= 1.5873e+07 and the result is not very good. I attached my data, please check output of nlinfit function to see the output.
Note: I want to find the best curve fitting based on spherical model, soI use: fun = @(p,X) p(1)*(1.5*X/p(2)-0.5*(X/p(2)).^3);
How I should set function’s arguments to reach the best results? Please help me to solve my problem.
Best regards
0 comentarios
Respuesta aceptada
Star Strider
el 14 de Sept. de 2014
One problem might be that you did not completely vectorise your objective function code (notably the divisions and at least one multiplication. I did here, so that could help:
fun = @(p,X) p(1).*(1.5*X./p(2)-0.5*(X./p(2)).^3);
See if running it makes a difference. If it solves your problem, let me know.
I’d actually like to know a bit more about what you did. It would help to know your starting parameter estimates.
Past midnight here, so I’ll run your code with your data later in the morning and see what results I get.
10 comentarios
Star Strider
el 16 de Sept. de 2014
My pleasure!
Compare the MSE values for the various models. If any of the models adequately explain the process that produced your data, those should take precedence. If they all do, then the one with the lowest MSE is likely the correct one. If with the Likelihood Ratio Test they are not significantly different from the one with the lowest MSE, they are all valid. Developing and estimating other models that could explain your data are appropriate and acceptable. If you can find a more appropriate model, fit it as well and compare it to the others. That is the fun — and frustration — of nonlinear parameter estimation and mathematical modeling.
You have fun as well! I wish you well in your research. We’re here if you need us for other MATLAB projects.
Más respuestas (1)
Ver también
Categorías
Más información sobre Nonlinear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!