set parameters of nlinfit function

9 ビュー (過去 30 日間)
Mani Ahmadian
Mani Ahmadian 2014 年 9 月 14 日
コメント済み: Star Strider 2014 年 10 月 15 日
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

採用された回答

Star Strider
Star Strider 2014 年 9 月 14 日
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 件のコメント
Mani Ahmadian
Mani Ahmadian 2014 年 9 月 16 日
Of course... you helped me to solve the most parts of my problem. But condition of spherical model doesn't satisfied me. I think it's diagram is out of tune and its mse is a huge value. I guess I have a big calculation or mathematical mistake about it, but I'm not sure where probably it happens.
I downloaded some textbooks about nonlinear curve fitting and I'll study them as soon as possible to have better understand.
Your view points and guidance was very helpful for me. Thank you very much, my friend.
Have a good time. Mani
Star Strider
Star Strider 2014 年 9 月 16 日
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.

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

その他の回答 (1 件)

Mani Ahmadian
Mani Ahmadian 2014 年 10 月 2 日
編集済み: Mani Ahmadian 2014 年 10 月 2 日
Hi again
I'm trying to solve the problem with spherical model fit function, this model has a mathematical formula as below:
I think the un-fit problem is due to two criteria function of above model. I don't know how I should define this type of function to nlinfit.
Would you please help me to solve the problem?
Thanks
Mani
  12 件のコメント
Mani Ahmadian
Mani Ahmadian 2014 年 10 月 15 日
Great
Thanks for your nice job. I'll check it as soon as possible.
Have a nice time
Mani
Star Strider
Star Strider 2014 年 10 月 15 日
My pleasure!
You too!

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

カテゴリ

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