Fit data to a hill equation using lsqnonlin

조회 수: 17 (최근 30일)
Ciaran
Ciaran 2015년 4월 11일
답변: Star Strider 2015년 4월 11일
Hi guys,
I'm trying to fit some data to a hill equation. My X-Axis:
Agonist = [0.1 0.5 1 5 10 19 50 100 114 500 1000 2000];
My Y-Axis:
atRA = [0 0 7 15 30 50 58 80 83 87 90 90];
My function:
function [F] = hill_fit(x,Emax,EC50)
num = Emax*x;
denom = EC50+x
F = num./denom
end
My fitting code:
EMax = 90;
EC50 = 19;
x = lsqnonlin(@hill_fit,Agonist,Emax,EC50,atRA);
However this gives me a shed load of warmings so I don't think its doing what I want it to. In essence all I want to do is fit the data to the hill equation, can anybody help?
Thanks

채택된 답변

Star Strider
Star Strider 2015년 4월 11일
I don’t recognise this particular Hill equation (there are several), but that aside, estimating your parameters and plotting them is relatively straightforward:
Agonist = [0.1 0.5 1 5 10 19 50 100 114 500 1000 2000];
atRA = [0 0 7 15 30 50 58 80 83 87 90 90];
% MAPPING: Emax = b(1), EC50 = b(2)
hill_fit = @(b,x) b(1).*x./(b(2)+x);
b0 = [90; 19]; % Initial Parameter Estimates
B = lsqcurvefit(hill_fit, b0, Agonist, atRA);
AgVct = linspace(min(Agonist), max(Agonist)); % Plot Finer Resolution
figure(1)
plot(Agonist, atRA, 'bp')
hold on
plot(AgVct, hill_fit(B,AgVct), '-r')
hold off
grid
xlabel('Agonist')
ylabel('atRA')
legend('Data', 'Hill Equation Fit', 'Location','SE')
If you’re doing curve-fitting, it’s easiest to use the lsqcurvefit function. It uses lsqnonlin but is specifically designed to make curve-fitting straightforward.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by