How to fit a function that has significant changes dependent on small changes of some parameters

4 ビュー (過去 30 日間)
Shaily_T
Shaily_T 2022 年 11 月 27 日
コメント済み: Shaily_T 2022 年 11 月 29 日

Hey,

I am fitting a function to data using curve fitting tool in Matlab. The function is very sensitive to two of the fitting parameters (I have totally 6 fitting parameters) and even a very small change in these two parameters make a huge change in the function. Considering this fact, the upper and lower bound of the parameters is quite large. For example, assume parameter L can vary from 0.0035 to 0.0045 while a change in the order of 0.00400006 can make a huge change in the function and make it something different. I have attached an example of how the function changes, when I change L from 0.00400000 to 0.00400006. As a result when I try to have this fitting parameter in my fit and set the lower and upper bound the same as I mentioned, and let's say an start point of 0.004, Matlab only goes true those small increments changes of this parameter and never try the change in order of something like 0.0042 in the parameter. And I have two parameters like this in my fit. Any comments on how can I overcome this challenge?

Thanks in advance!

  2 件のコメント
John D'Errico
John D'Errico 2022 年 11 月 27 日
編集済み: John D'Errico 2022 年 11 月 27 日
Please stop asking essentially the same question. I just spent 20 minutes writing an answer to your last question. You will need better data, or possibly a better model for your data.
Shaily_T
Shaily_T 2022 年 11 月 28 日
Thanks for your time! But as I mentioned in this question I can find a set of parameters that give a reasonable fit if I have only one or two fitting parameters. This issue arises when I want to have all the parameters as fitting parameters.

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

回答 (1 件)

Matt J
Matt J 2022 年 11 月 28 日
編集済み: Matt J 2022 年 11 月 28 日
Change the units of L to something smaller. Stop trying to measure the distance between houses in kilometers rather than in meters. It would probably also help to change the units of your xdata so that they are ~1e1 rather than ~1e14.
  3 件のコメント
Matt J
Matt J 2022 年 11 月 29 日
編集済み: Matt J 2022 年 11 月 29 日
You could do that, or, if your model function is F(L,x), wrap it with something like,
Fnew=@(deltaL,x) F( 0.004 + deltaL*(1E-8) , x*(1E13) )
You would of course need to adjust the initial guess of the parameters as well, to be consistent with the change of variables.
Shaily_T
Shaily_T 2022 年 11 月 29 日
Thank you so much! I'll try that.

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

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by