How can I create a modified curve fitting function?

Hi,
i want to fit a recovery curve of my experiment to the following expression:
F(t)=k*exp(-D/2t)[I0(D/2t)+I1(D/2t)]
where I0 and I1 are the modified Bessel fundtions of the first kind of zero and first order. I want to determine D and k.
Is there any simple solution for this problem?
Thanks for helping

5 件のコメント

John D'Errico
John D'Errico 2017 年 3 月 19 日
Why do you need a "modified" curvefitting tool? Is there any reason why the many such tools already in existence will not work? Thus why not use nlinfit, lsqnonlin, lsqcurvefit, or the curvefitting toolbox itself? There are probably others I've just forgotten to add in that list. And, yes, you could use a tool like fminsearch too.
Christian
Christian 2017 年 3 月 19 日
Thank you for that fast answer.
I want to use this function because it is published frequently in the literature. It is used to evaluate results from FRAP experiments.
Unfortunately I'm a noob regarding matlab (and computer science, programming).
I've already checked the matlab curve fitting tool for that function and tried to find a script in the internet without any success.
Is it possible to use this function in matlab?
Star Strider
Star Strider 2017 年 3 月 19 日
It is straightforward to write your own anonymous function to do that. See the section on ‘Anonymous Functions’ in the documentation on Function Basics. Then use the Statistics and Machine Learning Toolbox function nlinfit and its friends nlparci and nlpredci.
Christian
Christian 2017 年 3 月 19 日
Okay, thank you. I'll try that.
Star Strider
Star Strider 2017 年 3 月 19 日
My pleasure.
If you have problems, post your code. We can help.

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

回答 (2 件)

John D'Errico
John D'Errico 2017 年 3 月 19 日
編集済み: John D'Errico 2017 年 3 月 19 日

2 投票

Yes. Of course it is possible to do this. What toolbox do you have available? It sounds like the curve fitting TB is what you have. READ THE HELP. Look at the examples provided.
You said modified first kind Bessel, so you would use besseli. I'll get you started:
I0 = @(z) besseli(0,z);
I1 = @(z) besseli(1,z);
F = @(P,t) P(1)*exp(-P(2)/2*t).*(I0(P(2)/2*t)+I1(P(2)/2*t));
The curve fitting toolbox should be able to use this, as well as nlinfit and lsqcurvefit.
Note that I made the assumption that D/2t should be interpreted as (D/2)*t, NOT as D/(2*t).

3 件のコメント

Christian
Christian 2017 年 3 月 20 日
Thank you for that John.
Right, I have the curve fitting TB available. I've selected the "Costum Equation" in the drop down menu and written the following expression into the box:
k*exp(-((D/2)*t))*(besseli(0,((D/2)*t))+besseli(1,(D/2)*t))
Is this correct? Matlab caluculates a fitting function with this input but I'm not sure if this is it.
Christian
Christian 2017 年 3 月 20 日
I think the fitting function is okay. Maybe the results are so confusing because the upper and lower limits of the Parameters are not defined correctly?
Sung YunSing
Sung YunSing 2021 年 8 月 18 日
Hi just want to mention that if you were working at FRAP, maybe D/(2*t) is more conform to the origin FRAP equation.

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

Christian
Christian 2017 年 3 月 20 日

0 投票

I've tried this now.

カテゴリ

質問済み:

2017 年 3 月 19 日

コメント済み:

2021 年 8 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by