24.03.2013 Views

15.4 General Linear Least Squares

15.4 General Linear Least Squares

15.4 General Linear Least Squares

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

666 Chapter 15. Modeling of Data<br />

data points<br />

x1<br />

x2<br />

.<br />

xN<br />

X1( ) X2( ) . . . XM( )<br />

X1(x1)<br />

σ1<br />

X1(x2)<br />

σ2<br />

.<br />

.<br />

.<br />

X1(xN)<br />

σN<br />

basis functions<br />

X2(x1)<br />

σ1<br />

X2(x2)<br />

σ2<br />

X2(xN)<br />

σN<br />

. . . XM(x1)<br />

σ1<br />

. . . XM(x2)<br />

σ2<br />

.<br />

.<br />

.<br />

.<br />

.<br />

. . . XM(xN)<br />

σN<br />

Figure <strong>15.4</strong>.1. Design matrix for the least-squares fit of a linear combination of M basis functions to N<br />

data points. The matrix elements involve the basis functions evaluated at the values of the independent<br />

variable at which measurements are made, and the standard deviations of the measured dependent variable.<br />

The measured values of the dependent variable do not enter the design matrix.<br />

Solution by Use of the Normal Equations<br />

The minimum of (<strong>15.4</strong>.3) occurs where the derivative of χ 2 with respect to all<br />

M parameters ak vanishes. Specializing equation (15.1.7) to the case of the model<br />

(<strong>15.4</strong>.2), this condition yields the M equations<br />

⎡<br />

⎤<br />

N<br />

0=<br />

1<br />

M<br />

⎣yi − ajXj(xi) ⎦ Xk(xi) k =1,...,M (<strong>15.4</strong>.6)<br />

σ<br />

i=1<br />

2 i<br />

j=1<br />

Interchanging the order of summations, we can write (<strong>15.4</strong>.6) as the matrix equation<br />

where<br />

αkj =<br />

N<br />

i=1<br />

Xj(xi)Xk(xi)<br />

σ 2 i<br />

an M × M matrix, and<br />

βk =<br />

N<br />

i=1<br />

yiXk(xi)<br />

σ 2 i<br />

M<br />

j=1<br />

αkjaj = βk<br />

(<strong>15.4</strong>.7)<br />

or equivalently [α] =A T · A (<strong>15.4</strong>.8)<br />

or equivalently [β] =A T · b (<strong>15.4</strong>.9)<br />

Sample page from NUMERICAL RECIPES IN FORTRAN 77: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43064-X)<br />

Copyright (C) 1986-1992 by Cambridge University Press. Programs Copyright (C) 1986-1992 by Numerical Recipes Software.<br />

Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable<br />

files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website<br />

http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!