Nonlinear Regression 1Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Michael Sokolov ETH Zurich, Institut für Chemie-

Slides:



Advertisements
Similar presentations
Programming Tips: While Loops and Comparisons 1Daniel Baur / Numerical Methods for Chemical Engineerse Daniel Baur ETH Zurich, Institut für Chemie- und.
Advertisements

11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Fixed point iterations and solution of non-linear functions
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Numerical Differentiation and Quadrature (Integration) 1Daniel Baur / Numerical Methods for Chemical Engineers / Numerical Quadrature Daniel Baur ETH Zurich,
Linear Regression 1Daniel Baur / Numerical Methods for Chemical Engineers / Linear Regression Daniel Baur ETH Zurich, Institut für Chemie- und Bioingenieurwissenschaften.
Experimental Design, Response Surface Analysis, and Optimization
Probability & Statistical Inference Lecture 9
11 Simple Linear Regression and Correlation CHAPTER OUTLINE
Simple Linear Regression. G. Baker, Department of Statistics University of South Carolina; Slide 2 Relationship Between Two Quantitative Variables If.
Ch11 Curve Fitting Dr. Deshi Ye
A Mathematica ® based regression analysis program Analisys … A Curve Fitting Application.
Systems of Linear Equations
Response Surface Method Principle Component Analysis
Linear Systems of Equations Ax = b Marco Lattuada Swiss Federal Institute of Technology - ETH Institut für Chemie und Bioingenieurwissenschaften ETH Hönggerberg/
/k 2DS00 Statistics 1 for Chemical Engineering lecture 5.
Response Surfaces max(S(  )) Marco Lattuada Swiss Federal Institute of Technology - ETH Institut für Chemie und Bioingenieurwissenschaften ETH Hönggerberg/
Development of Empirical Models From Process Data
Nonlinear Regression Probability and Statistics Boris Gervits.
Engineering Computation Curve Fitting 1 Curve Fitting By Least-Squares Regression and Spline Interpolation Part 7.
Non Linear Regression Y i = f(  x i ) +  i Marco Lattuada Swiss Federal Institute of Technology - ETH Institut für Chemie und Bioingenieurwissenschaften.
Linear Regression Y i =  0 +  1 x i +  i Marco Lattuada Swiss Federal Institute of Technology - ETH Institut für Chemie und Bioingenieurwissenschaften.
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Ordinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Applications of Differential Equations in Synthetic Biology
Least-Squares Regression
Introduction to Linear Regression and Correlation Analysis
Systems of Linear Equations Iterative Methods
CPE 619 Simple Linear Regression Models Aleksandar Milenković The LaCASA Laboratory Electrical and Computer Engineering Department The University of Alabama.
Simple Linear Regression Models
Stats for Engineers Lecture 9. Summary From Last Time Confidence Intervals for the mean t-tables Q Student t-distribution.
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
1 Dr. Jerrell T. Stracener EMIS 7370 STAT 5340 Probability and Statistics for Scientists and Engineers Department of Engineering Management, Information.
Boundary Value Problems and Least Squares Minimization
2014. Engineers often: Regress data  Analysis  Fit to theory  Data reduction Use the regression of others  Antoine Equation  DIPPR We need to be.
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
1 11 Simple Linear Regression and Correlation 11-1 Empirical Models 11-2 Simple Linear Regression 11-3 Properties of the Least Squares Estimators 11-4.
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
Numerical Differentiation and Quadrature (Integration)
Solution of Nonlinear Functions
IX. Transient Model Nonlinear Regression and Statistical Analysis.
Ordinary Differential Equations (ODEs) 1Michael Sokolov / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Michael Sokolov ETH Zurich, Institut.
MODEL FITTING jiangyushan. Introduction The goal of model fitting is to choose values for the parameters in a function to best describe a set of data.
Engineers often: Regress data to a model  Used for assessing theory  Used for predicting  Empirical or theoretical model Use the regression of others.
Principal Component Analysis (PCA)
Linear Regression 1Michael Sokolov / Numerical Methods for Chemical Engineers / Linear Regression Michael Sokolov ETH Zurich, Institut für Chemie- und.
Chapter 2-OPTIMIZATION G.Anuradha. Contents Derivative-based Optimization –Descent Methods –The Method of Steepest Descent –Classical Newton’s Method.
1 Development of Empirical Models From Process Data In some situations it is not feasible to develop a theoretical (physically-based model) due to: 1.
Stats Methods at IC Lecture 3: Regression.
The simple linear regression model and parameter estimation
Physics 114: Lecture 13 Probability Tests & Linear Fitting
Chapter 7. Classification and Prediction
Regression Analysis AGEC 784.
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Lecture #26 Thursday, November 17, 2016 Textbook: 14.1 and 14.3
Linear Regression.
Probability and Statistics for Computer Scientists Second Edition, By: Michael Baron Section 11.1: Least squares estimation CIS Computational.
Mordechai Shacham, Dept. of Chem
CORRELATION(r) and REGRESSION (b)
Zero of a Nonlinear System of Algebraic Equations f(x) = 0
Modelling data and curve fitting
The Simple Linear Regression Model: Specification and Estimation
Regression Statistics
Simple Linear Regression
Chemical Kinetics The Zeroth Order Integrated Rate Equation
Multiple linear regression
Presentation transcript:

Nonlinear Regression 1Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Michael Sokolov ETH Zurich, Institut für Chemie- und Bioingenieurwissenschaften ETH Hönggerberg / HCI F135 – Zürich

Example: Puromycin  Puromycin is an antibiotic used in bio-research to select cells modified by genetic engineering  The Michaelis-Menten model for enzyme kinetics relates the initial velocity of an enzymatic reaction to the substrate concentration x by the equation  At high concentrations, the velocity is essentially constant (θ 1 ), while at low concentrations it is a linear function of the concentration 2Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Puromycin Kinetics 3Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression The model:

Model Linearization  The initial model reads  This can be rearranged to  Renaming the variables yields a linear model 4Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Linearized Model: Fit 5Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Regression Line  1 =  2 =

Regression from Linearized Model 6Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Regression from linearized model  1 =  2 =

Nonlinear Regression  The objective function of non-linear regression reads where y is the vector of responses, x is the vector of observations, θ is the vector of parameters and f is the nonlinear model function  In the 2-parameter case, we can plot S(θ) as a function of the parameter values to look for a minimum 7Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Objective Function S(θ) 8Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Minimum Estimated value of  from linearization

Minimization of S(θ)  If we linearize the model with respect to the parameters, we get where J(θ 0 ) is the Jacobian matrix of f with respect to θ, evaluated at θ 0  In this case, the residuals are  If we now define the objective function in terms of the residuals, we can apply the Gauss-Newton method 9Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Analogy:

Gauss-Newton Method applied to S(θ) 10Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Convergence path of Gauss- Newton Method (  1 ) opt = (  2 ) opt =

Nonlinear Regression 11Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression Nonlinear Regression Regression from linearized model

Matlab Nonlinear Regression Routines  There are several options for doing nonlinear regression:  lsqcurvefit  lsqcurvefit : Best for quickly fitting models to data; Not much statistical output; Provides more numerical information and options; Can use bounded parameter ranges  nlinfit  nlinfit : General nonlinear regression routine; Provides some statistical output  NonLinearModel  NonLinearModel : Most useful for nonlinear regression; All statistical and numerical tools in one place; Works analogously to LinearModel  fitnlm  fitnlm : new version of NonLinearModel (since 2013b) 12Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Using the Nonlinear Regression Routines  First we need to create a function that takes as inputs a vector b, the model parameters, and a vector (or matrix) x, the data points of the observed variables, and returns as output a vector (or matrix) y, the model responses  Then we use one of the nonlinear regression routines: 13Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Plotting the Fitted Curves  Plotting is as simple as calling the cost function or the predict routine of the NonLinearModel 14Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Tukey-Anscombe Plots  Plot of residuals vs. fitted values 15Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Normal Probability Plot 16Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Estimation of the Confidence Intervals 17Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Exercise 1  The product of a chemical reaction contains 50% chlorine at the time of production. The amount of chlorine subsequently drops over time. A model is proposed to predict the chlorine concentration as a function of time: where X is the fraction of chlorine in the product, t is the time and α and β are the model parameters. 18Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Assignment 1 1.Find online the data file chlorine.dat which contains the measurements and some code to load the data. 2.Plot the chlorine concentration as a function of time. Would a linear model seem feasible? 3.Determine suitable initial values for the nonlinear regression by linearizing the model and using linear regression to estimate the parameters. regress LinearModel  Use either regress or a LinearModel to perform the linear regression.  Since the dependence is exponential, simply use a log-model to linearize the model: 19Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Assignment 1 (Continued) 4.Write a model function of the form  function XCl = chlorinemodel(par, t)  where par(1) will be α and par(2) will be β 5.Fit a nonlinear model to the data by using one of the functions given on slide 12. Plot the model with the data, and report the parameters. NonLinearModel dataset  If you use NonLinearModel, you can use as input either a dataset or the measurements as X, y pair. 20Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Exercise 2  An experiment was conducted to evaluate the effect of two different methionin nutrition supplements (sourceA and sourceB) on the growth of newborn turkeys. The turkeys were separated into 10 experimental units with 15 birds each. For each supplement, the amount fed was varied between 0.04% and 0.44% of the total food. The target variable, the mean body weight of the units, is expressed as a function of the dosage of the two supplements, according to the following non-linear model where Y is the mean weight, and x A and x B are the dosages of the two supplements, respectively. 21Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Exercise 2 (Continued)  The model assumes that the intercept θ 1 and the horizontal asymptote θ 1 + θ 2 are the same for both supplements, and that only the growth rates θ 3 *θ 4 and θ 3 for supplements A and B, respectively, are different. The question is whether one of the supplements is superior, i.e. whether θ 4 is significantly different from unity. 22Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression

Assignment 2 1.Find online the data file turkeyweight.dat and some code to load the data into Matlab. 2.Find suitable initial values for the parameters by linearizing the model.  If you cannot solve this use θ 1 = 638, θ 2 = 175, θ 3 = 5 and θ 4 = 1. 3.Write a model function of the form  function y = turkeymodel(theta, x) nlinfit NonLinearModel 4.Perform the nonlinear regression, using nlinfit or NonLinearModel. 5.Are the growth rates for the two supplements significantly different, i.e. is θ 4 significantly different from unity? nlparci coefCI  Use either nlparci or coefCI to estimate the confidence intervals. 23Michael Sokolov / Numerical Methods for Chemical Engineers / Nonlinear Regression