Non Linear Regression Problem

조회 수: 5 (최근 30일)
J.Cam
J.Cam 2020년 5월 11일
댓글: Image Analyst 2020년 5월 20일
I have tried to attempt this question however I don't know if I'm on the right track. I have already done (i), my difficulty is in (ii).
clear all
clc
syms x y a b
X=[1:1:10];
Y=[0.5379,0.827,1.2654,1.5324,1.717,1.3983,1.6844,1.6892,1.506,1.707];
a = [1;0;0;0;0;0;0;0;0;0;0];
b = [1;0;0;0;0;0;0;0;0;0;0];
c = [0;0;0;0;0;0;0;0;0;0;0];
u = [((a(1)*x)/(b(1)+x)) , ((a(1)*2*x)/(b(1)+2*x)), ((a(1)*3*x)/(b(1)+3*x)), ((a(1)*4*x)/(b(1)+4*x)), ((a(1)*5*x)/(b(1)+5*x)), ((a(1)*6*x)/(b(1)+6*x)), ((a(1)*7*x)/(b(1)+7*x)), ((a(1)*8*x)/(b(1)+8*x)), ((a(1)*9*x)/(b(1)+9*x)), ((a(1)*10*x)/(b(1)+10*x))]';
B0=[a(1);b(1)];
U = [0;0;0;0;0;0;0;0;0;0;0];
for i=2:11
U(i-1) = [((a(i-1)*1)/(b(i-1)+1)) , ((a(i-1)*2)/(b(i-1)+2)), ((a(i-1)*3)/(b(i-1)+3)), ((a(i-1)*4)/(b(i-1)+4)), ((a(i-1)*5)/(b(i-1)+5)), ((a(i-1)*6)/(b(i-1)+6)), ((a(i-1)*7)/(b(i-1)+7*x)), ((a(i-1)*8)/(b(i-1)+8)), ((a(i-1)*9)/(b(i-1)+9)), ((a(i-1)*10)/(b(i-1)+10))]';
Jac = jacobian([((a*1)/(b+1)) , ((a*2)/(b+2)), ((a*3)/(b+3)), ((a*4)/(b+4)), ((a*5)/(b+5)), ((a*6)/(b+6)), ((a*7)/(b+7)), ((a*8)/(b+8)), ((a*9)/(b+9)), ((a*10)/(b+10))], [a,b] );
r = u - U(i-1);
c = [a(i-1);b(i-1)] - inv(J(i-1)'.* J(i-1)).*(J(i-1)'.*r(i-1));
c
a(i) = c(1);
b(i) = c(2);
end

채택된 답변

Image Analyst
Image Analyst 2020년 5월 12일
That equation is "the rate equation" and I have attached a demo for solving it using fitnlm().
% Fit a vertically shifted version of the the Fluorescence Recovery Curve (Michaelis-Menten function).
% One common non-linear equation is the Michaelis-Menten function,
% which is used to describe the reaction rate as a function of substrate concentration.
% The Michaelis-Menten function is characterized by a steep rise that gradually flattens into a plateau.
For your assignment you would want the Equation 1 version where no vertical offset is allowed (shown by the red equation above, not the green one).
  댓글 수: 5
J.Cam
J.Cam 2020년 5월 20일
So what is left in my assignment is to do a for loop to obtain estimates of b(1) and b(2) for 10 times right?
Image Analyst
Image Analyst 2020년 5월 20일
Well it looks like your homework wants you to do it a certain way instead of using the built in function - they want you to do it manually according to their recipe. Sorry, but I don't have the time to devote to it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by