How to do curve fitting on data with inflection point?

Hello
Dear experts,
I have a scatter plot of data of x and y and I need to fit a curve on them. However, it is obvious that there is no function that can fit the whole range of these data (blue line of the attached picture). So, I need to fit two curves (dashed red line): one is on the data that are less than the inflection point (yellow point), and one for data that are larger than the inflection point. The inflection point can visually be guessed as 0.25, but is there any way that I can calculate the inflection point from the original scatter plot?
Note that I know how to do the curve fitting, and my question is only regarding the inflection point.
Hope this is the appropriate forum to ask this question.
Thank you very much.

1 commentaire

Adam Danz
Adam Danz le 14 Jan 2021
Modifié(e) : Adam Danz le 14 Jan 2021
Why not fit the entire curve to a sigmoid and then extract values less than or greater than x=.25?
Alternatively, but inferior to the suggestion above, would be to separate the curves first and then fit each half to a sigmoid but I can't imagine it would be as good of a fit as fitting the full curve.

Connectez-vous pour commenter.

 Réponse acceptée

Cris LaPierre
Cris LaPierre le 14 Jan 2021
Modifié(e) : Cris LaPierre le 14 Jan 2021
Why do you think there is no equation that can fit this data? This looks like a sigmoid E max model to me. A similar shape is obtained from the Hill equation, too.
Here's a simple example using the Hill equation and trying to match your curve.
mx = 0;
mn = 1;
ec50 = 0.25;
n=5;
x=0:.01:1;
y = mn + (mx-mn)*ec50^n./(ec50^n+x.^n);
plot(x,y)
grid on

6 commentaires

Dear Cris and Adam
Thanks for your response. It is very amazing that the Hill function can get the job done. I was actually able to fit a nice curve to my data using the Hill function (y = mn + (mx-mn)*(ec50^n / (ec50^n+x^n)) (with the fitted curve of (1.017*x^(3.923))/((x^(3.923) + 5.7)) + 0.012), but unfortunately this function is not integrable. If I am going to use the Hill function, it should be integrable, so does it have a form that can be integrated?
Thanks
That sounds like a completely unrelated requirement to the question you posed.
Why does it need to be integrable? Do you need a closed-form solution, or would a numerical method suffice?
Adam Danz
Adam Danz le 14 Jan 2021
Modifié(e) : Adam Danz le 14 Jan 2021
I agree with Cris; why can't you fit with a Hill fcn and then either compute the inflection point given the fit parameters or differentiate the result to very closely approximate the inflection point at the max of the differentiation?
Sorry if my question went off from this topic.
In summary, I need to fit a curve on my original data, and use the fitted equation (closed-form) for some furthur calculations, such as integration and inversion, so the fitted curve should be integrable. I initially didn't know that the Hill function can be fitted on my data, that was why I had to seperate my data by the inflection point. However, I saw that by using the Hill function there is no need to seperate data and there is no need to use inflection point any more. But then I realized that the Hill function is not integrable to a closed-form.
So, I need to fit a curve on the data that has a closed-form and also be integrable.
Regards,
It is possible to numerically integrate it. I'll leave it to others to propose a closed-form solution.
Define your x values, calculate the corresponding y values, and use trapz to numercally integrate.
ec50 = 0.25;
n=5;
x=0:.01:1;
y = 1-ec50^n./(ec50^n+x.^n);
A = trapz(x,y)
A = 0.7330
Thanks Cris. I was able to numerically integrate the Hill function, then I fitted a curve on the integration results and by doing so, I was able to find a closed-form solution.
Your help is appreciated.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by