Fit data to a hill equation using lsqnonlin
17 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!