Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Comparing Nonlinear and Linear Fits in MATLAB for Michaelis-Menten Equation, Summaries of Matlab skills

A step-by-step guide on how to fit the Michaelis-Menten equation to a given dataset using both nonlinear and linear methods in MATLAB. It includes visualizations of the raw data, nonlinear fit, linearized data, and residual plots. The analysis also includes the determination of parameter values, confidence intervals, and r-squared values for both methods, as well as an F-test to compare their statistical significance.

Typology: Summaries

2021/2022

Uploaded on 09/12/2022

shally_866
shally_866 šŸ‡ŗšŸ‡ø

4.5

(27)

265 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Fitting the Michaelis-Menten Equation in MATLAB
Disclaimer: The goal of this example is to walk you through how to conduct a nonlinear fit in MATLAB and
compare the results between a nonlinear fit and linear fit for a given data set. Before reviewing this example
it is recommended that you read over Fitting Curves to Data using Nonlinear Regression and Conducting a
Nonlinear Fit Analysis in MATLAB so that you can be familiar with the theory and functions involved.
Example Problem
The hydrolysis of carbobenzozyglycyl-L-tryptophan catalyzed by pancreatic carboxypeptidase occurs ac-
cording to the reaction:
carbobenzozyglycyl-L-tryptophan + H2O→carbobenzoxyglycine + L-tryptophan
The following data on the rate of formation of L-tryptophan at 25ā—¦C and pH 7.5 was obtained:
Substrate Concentration (mM) Rate (mM sāˆ’1)
2.5 0.024
5.0 0.036
10.0 0.053
15.0 0.060
20.0 0.064
a. Plot the initial rate as a function of substrate concentration. What shape does the data follow?
b. Fit a nonlinear curve to this data of the form f(x, β) = β1x
β2+xusing the nlinfit function in MATLAB.
Plot your fit and the data points on the same graph. Does the fit seem reasonable? Determine the
95% confidence intervals for β1and β2, and find the r2value for the fit. Are they what you expect?
c. Make a residual plot to assess the fit from part b.
d. Now linearize the model using the Lineweaver-Burk method and solve for Vmax and KM. Find the
95% confidence intervals for the slope and intercept of your Lineweaver-Burk plot and determine the
r2value.
e. Make a residual plot to assess the fit from part d.
f. Conduct an F-test to see which model is the better fit. For help with F-tests see Fitting Curves to
Data Using Nonlinear Regression and Using the F-test to Compare Two Models.
g. Based on the above analysis, is one method preferable to the other? Compare the parameter values
found using each method and the result from the F-test.
1
pf3
pf4
pf5

Partial preview of the text

Download Comparing Nonlinear and Linear Fits in MATLAB for Michaelis-Menten Equation and more Summaries Matlab skills in PDF only on Docsity!

Fitting the Michaelis-Menten Equation in MATLAB

Disclaimer: The goal of this example is to walk you through how to conduct a nonlinear fit in MATLAB and compare the results between a nonlinear fit and linear fit for a given data set. Before reviewing this example it is recommended that you read over Fitting Curves to Data using Nonlinear Regression and Conducting a Nonlinear Fit Analysis in MATLAB so that you can be familiar with the theory and functions involved.

Example Problem

The hydrolysis of carbobenzozyglycyl-L-tryptophan catalyzed by pancreatic carboxypeptidase occurs ac- cording to the reaction:

carbobenzozyglycyl-L-tryptophan + H 2 O → carbobenzoxyglycine + L-tryptophan

The following data on the rate of formation of L-tryptophan at 25ā—¦C and pH 7.5 was obtained:

Substrate Concentration (mM) Rate (mM sāˆ’^1 ) 2.5 0. 5.0 0. 10.0 0. 15.0 0. 20.0 0.

a. Plot the initial rate as a function of substrate concentration. What shape does the data follow?

b. Fit a nonlinear curve to this data of the form f (x, β) = (^) ββ 21 +xx using the nlinfit function in MATLAB. Plot your fit and the data points on the same graph. Does the fit seem reasonable? Determine the 95% confidence intervals for β 1 and β 2 , and find the r^2 value for the fit. Are they what you expect?

c. Make a residual plot to assess the fit from part b.

d. Now linearize the model using the Lineweaver-Burk method and solve for Vmax and KM. Find the 95% confidence intervals for the slope and intercept of your Lineweaver-Burk plot and determine the r^2 value.

e. Make a residual plot to assess the fit from part d.

f. Conduct an F-test to see which model is the better fit. For help with F-tests see Fitting Curves to Data Using Nonlinear Regression and Using the F-test to Compare Two Models.

g. Based on the above analysis, is one method preferable to the other? Compare the parameter values found using each method and the result from the F-test.

Example Problem Solution

It is recommended that you try the problem before looking at the solution. For an example of code that could be used to come up with the solution see the Appendix.

a. The following figure shows the plot of the raw data. The slope appears to decrease for increasing concentrations, eventually leveling off. This is expected for enzyme kinetics data. As substrate con- centration increases, the rate also increases. However, the rate approaches a maximum value above which no amount of additional substrate will influence it. This is often referred to as the saturation point.

0.02 2 4 6 8 10 12 14 16 18 20

Substrate Concentration (mM)

Initial rate (mM/s)

Initial Rate vs. Concentration

b. Using MATLAB’s nlinfit command, a curve for this data can be generated. The fit function was f (x, β) = (^) ββ 21 +xx , where β 1 was Vmax and β 2 was KM. The calculated constants with 95% confidence intervals were beta(1)=0.0859 ± (0.0074) mM/s and beta(2)=6.5619 ± (1.5235) mM. The r^2 value was 0.9972. These values were calculated using the methods detailed in the Fitting Curves to Data using Nonlinear Regression document. The plot of the raw data with this fit is shown below. Note that the curve appears to be a good fit for the data, passing through or near each of the data points. MATLAB has minimized the residual sum of squares to produce this model. It iterated through values for the constants β 1 and β 2 until it found values that minimized the sum of the squares of the residuals (data point minus point on curve).

(^100) 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.

15

20

25

30

35

40

45

50

1/[S] (mMāˆ’1)

1/Vo (s/mM)

Lineweaverāˆ’Burk Plot (1/Vo vs. 1/[S])

MATLAB can be used to solve for the intercept and slope. Note 95% confidence intervals are also obtained. If you are unsure how to obtain these values please review the linear fitting tutorial.

  • intercept=1/Vmax= 11.8 ± 1.
  • slope=Km/Vmax=75.43 ± 7.

Extracting Vmax and KM gives:

  • Vmax= 0.0847 mM/s
  • Km=6.3923 mM

Finally, the r^2 value was calculated to be r^2 = 0.9976. The method used was the same as in the nonlinear case and is discussed in the Fitting Curves to Data using Nonlinear Regression document.

e. The residual plot for the linearized data is shown below. Once again, look for patterns, long runs of positive or negative values, or large relative magnitudes. In this case none of these trends can be seen and the residual plot is indicative of a good fit. However, the fact there are only five data points limits the conclusions that can be made from the residual plot alone.

āˆ’0.5 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.

0

1

1/[S] (mMāˆ’1)

Residuals

Residual Plot

f. Conducting the F-test with the linear fit as model 1 and the nonlinear fit as model 2 gives an F-statistic of 3.5603e+05 and a p-value of 7.9913e-09. Interpreting this result, the nonlinear fit is significantly better than the linearized, transformed fit. This result makes sense, because transforming data tends to exaggerate errors.

g. Based on this analysis, both methods provide good fits for the data. The nonlinear case returned 0. ± 0.0074 mM/s for Vmax and 6.5619 ± 0.5235 mM for KM , while the linearized method returned 0. mM/s for Vmax and 6.3923 mM forKM. The values for the linearized method fall within the confidence bounds of the nonlinear version. Additionally, both models had r^2 values close to 1 and residual plots that were indicative of good fits. Despite the apparent similarity in these results, the F-test revealed that the nonlinear fit is statistically better than the linear fit. Linearizing the data makes the parameters easier to calculate by hand, but if a computer is available, the nonlinear method is the better choice.

55 56 % Set up fittype and options 57 ft = fittype( ’poly1’ ); 58 opts = fitoptions( ft ); 59 opts.Lower = [-Inf -Inf]; 60 opts.Upper = [Inf Inf]; 61 62 % Fit model to data and find 95% confidence bounds 63 [xData, yData] = prepareCurveData( 1./substrate, 1./vo ); 64 [fitresult, gof] = fit( xData, yData, ft, opts ); 65 p=polyfit(1./substrate,1./vo,1); 66 67 % Plot linear fit 68 x=linspace(0,.5,1000); 69 line=p(1).x+p(2); 70 figure(4) 71 hold on 72 plot(x,line,’-’) 73 print -depsc rawlin 74 75 % Make residual plot 76 Rlin=(1./vo)-((p(1).(1./substrate)+p(2))); 77 figure(5) 78 clf 79 plot(1./substrate,Rlin,’rp’) 80 hold on 81 plot(x,0,’-’) 82 xlabel(’1/[S] (mM^{-1})’,’FontSize’,14) 83 ylabel(’Residuals’,’FontSize’,14) 84 title(’Residual Plot’,’FontSize’,16) 85 print -depsc linres 86 87 % Determine constants from linear fit 88 Vmax=1/(p(2)); 89 Km=Vmax.*p(1); 90 91 % Determine the r^2 value 92 ssreslin=sum(Rlin.^2); 93 sstotlin=sum((1./vo-mean(1./vo)).^2); 94 rsqrlin=1-(ssreslin/sstotlin); 95 96 % F-test between nonlinear and linear models 97 F=ssreslin./ssresnonlin; 98 df=length(vo)-2; 99 P=1-fcdf(F,df,df);