NonLinear Models NonLinear Growth models many models cannot

  • Slides: 55
Download presentation
Non-Linear Models

Non-Linear Models

Non-Linear Growth models • many models cannot be transformed into a linear model The

Non-Linear Growth models • many models cannot be transformed into a linear model The Mechanistic Growth Model Equation: or (ignoring e) “rate of increase in Y” =

The Logistic Growth Model Equation: or (ignoring e) “rate of increase in Y” =

The Logistic Growth Model Equation: or (ignoring e) “rate of increase in Y” =

The Gompertz Growth Model: Equation: or (ignoring e) “rate of increase in Y” =

The Gompertz Growth Model: Equation: or (ignoring e) “rate of increase in Y” =

Non-Linear Regression

Non-Linear Regression

Non-Linear Regression Introduction Previously we have fitted, by least squares, the General Linear model

Non-Linear Regression Introduction Previously we have fitted, by least squares, the General Linear model which were of the type: Y = b 0 + b 1 X 1 + b 2 X 2 +. . . + bp. Xp + e

 • the above equation can represent a wide variety of relationships. • there

• the above equation can represent a wide variety of relationships. • there are many situations in which a model of this form is not appropriate and too simple to represent the true relationship between the dependent (or response) variable Y and the independent (or predictor) variables X 1 , X 2 , . . . and Xp. • When we are led to a model of nonlinear form, we would usually prefer to fit such a model whenever possible, rather than to fit an alternative, perhaps less realistic, linear model. • Any model which is not of the form given above will be called a nonlinear model.

This model will generally be of the form: Y = f(X 1, X 2,

This model will generally be of the form: Y = f(X 1, X 2, . . . , Xp| q 1, q 2, . . . , qq) + e * where the function (expression) f is known except for the q unknown parameters q 1, q 2, . . . , qq.

Least Squares in the Nonlinear Case

Least Squares in the Nonlinear Case

 • Suppose that we have collected data on the Y, – (y 1,

• Suppose that we have collected data on the Y, – (y 1, y 2, . . . yn) • corresponding to n sets of values of the independent variables X 1, X 2, . . . and Xp – (x 11, x 21, . . . , xp 1) , – (x 12, x 22, . . . , xp 2), –. . . and – (x 12, x 22, . . . , xp 2).

 • For a set of possible values q 1, q 2, . .

• For a set of possible values q 1, q 2, . . . , qq of the parameters, a measure of how well these values fit the model described in equation * above is the residual sum of squares function • • where • is the predicted value of the response variable yi from the values of the p independent variables x 1 i, x 2 i, . . . , xpi using the model in equation * and the values of the parameters q 1, q 2, . . . , qq.

 • The Least squares estimates of q 1, q 2, . . .

• The Least squares estimates of q 1, q 2, . . . , qq, are values • which minimize S(q 1, q 2, . . . , qq). • It can be shown that the error terms are independent normally distributed with mean 0 and common variance s 2 than the least squares estimates are also the maximum likelihood estimate of q 1, q 2, . . . , qq).

 • To find the least squares estimate we need to determine when all

• To find the least squares estimate we need to determine when all the derivatives S(q 1, q 2, . . . , qq) with respect to each parameter q 1, q 2, . . . and qq are equal to zero. • This quite often leads to a set of equations in q 1, q 2, . . . and qq that are difficult to solve even with one parameter and a comparatively simple nonlinear model. • When more parameters are involved and the model is more complicated, the solution of the normal equations can be extremely difficult to obtain, and iterative methods must be employed.

 • To compound the difficulties it may happen that multiple solutions exist, corresponding

• To compound the difficulties it may happen that multiple solutions exist, corresponding to multiple stationary values of the function S(q 1, q 2, . . . , qq). • When the model is linear, these equations form a set of linear equations in q 1, q 2, . . . and qq which can be solved for the least squares estimates. • In addition the sum of squares function, S(q 1, q 2, . . . , qq), is a quadratic function of the parameters and is constant on ellipsoidal surfaces centered at the least squares estimates.

Example We have collected data on two variables (Y, X) The model we will

Example We have collected data on two variables (Y, X) The model we will consider is Y = q 1 e-X +q 2 + e The data: (x 1 , y 1) (x 2, y 2) (x 3, y 3) , . . . , (xn, yn)

The predicted value of yi using the model is: The Residual Sum of Squares

The predicted value of yi using the model is: The Residual Sum of Squares is: The least squares estimates of q 1 and q 2 satisfy

Techniques for Estimating the Parameters of a Nonlinear System • In some nonlinear problems

Techniques for Estimating the Parameters of a Nonlinear System • In some nonlinear problems it is convenient to determine equations (the Normal Equations) for the least squares estimates , • the values that minimize the sum of squares function, S(q 1, q 2, . . . , qq). • These equations are nonlinear and it is usually necessary to develop an iterative technique for solving them.

 • In addition to this approach there are several currently employed methods available

• In addition to this approach there are several currently employed methods available for obtaining the parameter estimates by a routine computer calculation. • We shall mention three of these: – 1) Steepest descent, – 2) Linearization, and – 3) Marquardt's procedure.

 • In each case a iterative procedure is used to find the least

• In each case a iterative procedure is used to find the least squares estimators. • That is an initial estimates, , for these values are determined. • The procedure than finds successfully better estimates, that hopefully converge to the least squares estimates,

Steepest Descent • The steepest descent method focuses on determining the values of q

Steepest Descent • The steepest descent method focuses on determining the values of q 1, q 2, . . . , qq that minimize the sum of squares function, S(q 1, q 2, . . . , qq). • The basic idea is to determine from an initial point, and the tangent plane to S(q 1, q 2, . . . , qq) at this point, the vector along which the function S(q 1, q 2, . . . , qq) will be decreasing at the fastest rate. • The method of steepest descent than moves from this initial point along the direction of steepest descent until the value of S(q 1, q 2, . . . , qq) stops decreasing.

 • It uses this point, as the next approximation to the value that

• It uses this point, as the next approximation to the value that minimizes S(q 1, q 2, . . . , qq). • The procedure than continues until the successive approximation arrive at a point where the sum of squares function, S(q 1, q 2, . . . , qq) is minimized. • At that point, the tangent plane to S(q 1, q 2, . . . , qq) will be horizontal and there will be no direction of steepest descent.

 • It should be pointed out that the technique of steepest descent is

• It should be pointed out that the technique of steepest descent is a technique of great value in experimental work for finding stationary values of response surfaces. • While, theoretically, the steepest descent method will converge, it may do so in practice with agonizing slowness after some rapid initial progress.

 • Slow convergence is particularly likely when the S(q 1, q 2, .

• Slow convergence is particularly likely when the S(q 1, q 2, . . . , qq) contours are attenuated and banana-shaped (as they often are in practice), and it happens when the path of steepest descent zigzags slowly up a narrow ridge, each iteration bringing only a slight reduction in S(q 1, q 2, . . . , qq).

 • A further disadvantage of the steepest descent method is that it is

• A further disadvantage of the steepest descent method is that it is not scale invariant. • The indicated direction of movement changes if the scales of the variables are changed, unless all are changed by the same factor. • The steepest descent method is, on the whole, slightly less favored than the linearization method (described later) but will work satisfactorily for many nonlinear problems, especially if modifications are made to the basic technique.

Steepest Descent Steepest descent path Initial guess

Steepest Descent Steepest descent path Initial guess

Linearization • The linearization (or Taylor series) method uses the results of linear least

Linearization • The linearization (or Taylor series) method uses the results of linear least squares in a succession of stages. • Suppose the postulated model is of the form: Y = f(X 1, X 2, . . . , Xp| q 1, q 2, . . . , qq) + e • Let be initial values for the parameters q 1, q 2, . . . , qq. • These initial values may be intelligent guesses or preliminary estimates based on whatever information are available.

 • These initial values will, hopefully, be improved upon in the successive iterations

• These initial values will, hopefully, be improved upon in the successive iterations to be described below. • The linearization method approximates f(X 1, X 2, . . . , Xp| q 1, q 2, . . . , qq) with a linear function of q 1, q 2, . . . , qq using a Taylor series expansion of f(X 1, X 2, . . . , Xp| q 1, q 2, . . . , qq) about the point and curtailing the expansion at the first derivatives. • The method then uses the results of linear least squares to find values, that provide the least squares fit of of this linear function to the data.

 • The procedure is then repeated again until the successive approximations converge to

• The procedure is then repeated again until the successive approximations converge to hopefully at the least squares estimates:

Linearization Contours of RSS for linear approximatin 2 nd guess Initial guess

Linearization Contours of RSS for linear approximatin 2 nd guess Initial guess

Contours of RSS for linear approximatin 3 rd guess 2 nd guess Initial guess

Contours of RSS for linear approximatin 3 rd guess 2 nd guess Initial guess

4 th guess Contours of RSS for linear approximatin 3 rd guess 2 nd

4 th guess Contours of RSS for linear approximatin 3 rd guess 2 nd guess Initial guess

The linearization procedure has the following possible drawbacks: 1. It may converge very slowly;

The linearization procedure has the following possible drawbacks: 1. It may converge very slowly; that is, a very large number of iterations may be required before the solution stabilizes even though the sum of squares S(q 1, q 2 , …, qp) may decrease consistently as the number of iterations increase. This sort of behavior is not common but can occur. 2. It may oscillate widely, continually reversing direction, and often increasing, as well as decreasing the sum of squares. Nevertheless the solution may stabilize eventually. 3. It may not converge at all, and even diverge, so that the sum of squares increases iteration after iteration without bound.

 • The linearization method is, in general, a useful one and will successfully

• The linearization method is, in general, a useful one and will successfully solve many nonlinear problems. • Where it does not, consideration should be given to reparameterization of the model or to the use of Marquardt's procedure.

Example Non-Linear Regression

Example Non-Linear Regression

In this example we are measuring the amount of a compound in the soil:

In this example we are measuring the amount of a compound in the soil: 1. 2. 3. 4. 5. 6. 7. 8. 7 days after application 14 days after application 21 days after application 28 days after application 42 days after application 56 days after application 70 days after application 84 days after application

This is carried out at two test plot locations 1. Craik 2. Tilson 6

This is carried out at two test plot locations 1. Craik 2. Tilson 6 measurements per location are made each time

The data

The data

Graph

Graph

The Model: Exponential decay with nonzero asymptote a c

The Model: Exponential decay with nonzero asymptote a c

Some starting values of the parameters found by trial and error by Excel

Some starting values of the parameters found by trial and error by Excel

Non Linear least squares iteration by SPSS (Craik)

Non Linear least squares iteration by SPSS (Craik)

ANOVA Table (Craik) Parameter Estimates (Craik)

ANOVA Table (Craik) Parameter Estimates (Craik)

Testing Hypothesis: similar to linear regression Caution: This statistic has only an approximate F

Testing Hypothesis: similar to linear regression Caution: This statistic has only an approximate F – distribution when the sample size is large

Example: Suppose we want to test H 0: c = 0 against HA: c

Example: Suppose we want to test H 0: c = 0 against HA: c ≠ 0 Complete model Reduced model

ANOVA Table (Complete model) ANOVA Table (Reduced model)

ANOVA Table (Complete model) ANOVA Table (Reduced model)

The Test

The Test

Use of Dummy Variables Non Linear Regression

Use of Dummy Variables Non Linear Regression

The Model: or where

The Model: or where

The data file

The data file

Non Linear least squares iteration by SPSS

Non Linear least squares iteration by SPSS

ANOVA Table Parameter Estimates

ANOVA Table Parameter Estimates

Testing Hypothesis: Suppose we want to test H 0: Da = a 1 –

Testing Hypothesis: Suppose we want to test H 0: Da = a 1 – a 2 = 0 and Dk = k 1 – k 2 = 0

The Reduced Model: or

The Reduced Model: or

ANOVA Table Parameter Estimates

ANOVA Table Parameter Estimates

The F Test Thus we accept the null Hypothesis that the reduced model is

The F Test Thus we accept the null Hypothesis that the reduced model is correct