Mathematical Tools for Physics

(coco) #1
11—Numerical Analysis 338

These linear equations are easily expressed in terms of matrices.


Ca=b,
where
Cνμ=


i

fν(xi)fμ(xi). (46)

ais the column matrix with componentsαμandbhas components



iyifν(xi).
The solution forais
a=C−^1 b. (47)

IfC turned out singular, so this inversion is impossible, the functionsfμwere not independent.
Example: Fit to a straight line


f 1 (x) = 1 f 2 (x) =x.

ThenCa=bis (
N



∑ xi
xi


x^2 i

)(


α 1
α 2

)


=


( ∑


∑ yi
yixi.

)


The inverse is (
α 1
α 2


)


=


1


[


N



x^2 i−

(∑


xi

) 2 ]


( ∑


x^2 i −


xi


xi N

)( ∑


∑ yi
xiyi.

)


(48)


and the best fit line is
y=α 1 +α 2 x


11.7 Euclidean Fit
In fitting data to a combination of functions, the least squares method used Eq. ( 44 ) as a measure of how far the
proposed function is from the data. If you’re fitting to a straight line (or plane if you have more variables) there’s
another way to picture the distance. Instead of measuring the distance from a point to the curveverticallyusing
onlyy, measure it as theperpendiculardistance to the line. Why should this be any better? It’s not, but it does
have different uses, and the primary one is data compression.

Free download pdf