Title: Least squares method
1Least squares method
Let adjustable parameters for structure
refinement be uj Then if R S w(hkl) (Fobs
Fcalc)2 S w D2 Must get ?R/?ui 0 one
eqn/parameter
hkl
hkl
hkl
hkl
2Least squares method
Let adjustable parameters for structure
refinement be uj Then if R S w(hkl) (Fobs
Fcalc)2 S w D2 Must get ?R/?ui 0 one
eqn/parameter Then S w D ?Fc/?ui 0
hkl
hkl
hkl
hkl
3Least squares
Simple example again
To solve simultaneous linear eqns a11x1
a12x2 y1 a21x1 a22x2
y2 If Then simultaneous eqns given
by A x y
4Least squares
a11x1 a12x2 y1 a21x1 a22x2
y2 Then a11x1 a12x2 y1 e1 a21x1
a22x2 y2 e2 No exact solution as
before but can get best solution by minimizing
S ei
Suppose
2
i
5Least squares
a11x1 a12x2 y1 e1 a21x1 a22x2
y2 e2 No exact solution as before but can
get best solution by minimizing S ei Also note
that no. observations gt no. of variable
parameters (n gt m) Minimize
2
i
6Least squares
Minimize
7Least squares
To illustrate calcn, let n, m 2 (a11x1
a12x2 y1)2 e12 (a21x1 a22x2 y2)2
e22 Take partial derivative wrt x1, set
0 (a11x1 a12x2 y1) a11 0 (a21x1 a22x2
y2) a21 0
8Least squares
To illustrate calcn, let n, m 2 (a11x1
a12x2 y1)2 e12 (a21x1 a22x2 y2)2
e22 Take partial derivative wrt x1, set
0 (a11x1 a12x2 y1) a11 0 (a21x1 a22x2
y2) a21 0 (a11 a11) x1 (a11 a12) x2
(a11) y1 (a21 a21) x1 (a21 a22) x2 (a21)
y2 (a11 a11 a21 a21) x1 (a11 a12 a21
a22) x2 (a11 y1 a21 y2 )
9Least squares
(a11 a11 a21 a21) x1 (a11 a12 a21 a22)
x2 (a11 y1 a21 y2 ) x1 S ai1 x2 S ai1
ai2 S ai1 yi
2
2
2
2
i1
i1
i1
10Least squares
(a11 a11 a21 a21) x1 (a11 a12 a21 a22)
x2 (a11 y1 a21 y2 ) x1 S ai1 x2 S ai1
ai2 S ai1 yi Now consider
2
2
2
2
i1
i1
i1
11Least squares
(a11 a11 a21 a21) x1 (a11 a12 a21 a22)
x2 (a11 y1 a21 y2 ) x1 S ai1 x2 S ai1
ai2 S ai1 yi Now consider AT
A
2
2
2
2
i1
i1
i1
12Least squares
(a11 a11 a21 a21) x1 (a11 a12 a21 a22)
x2 (a11 y1 a21 y2 ) x1 S ai1 x2 S ai1
ai2 S ai1 yi Now consider AT
A And (AT A) x (AT y )
2
2
2
2
i1
i1
i1
13Least squares
In general
14Least squares
In general And (AT A) x
(AT y )
15Least squares
In general (AT A) x
(AT y ) x (AT A)-1 (AT y )
16Least squares
Again ƒs are not linear in
xi
17Least squares
Again ƒs are not linear in
xi Expand ƒs in Taylor series
18Least squares
Again ƒs are not linear in
xi Expand ƒs in Taylor series
19Least squares
Solve, as before
20Least squares
Solve, as before
21Least squares
Solve, as before
22Least squares
Weighting factors matrix
23Least squares
So Need set of initial parameters xjo Problem
solution gives shifts ?xj, not xj
24Least squares
So Need set of initial parameters xjo Problem
solution gives shifts ?xj, not xj Eqns not
exact, so refinement process requires no. of
cycles to complete the refinement Add shifts
?xj to xjo for each new refinement cycle
25Least squares
How good are final parameters? Use usual
procedure to calculate standard deviations,
s(xj) no. observations no.
parameters
26Least squares
Warning Frequently, all parameters cannot be
let go at the same time How to tell which
parameters can be refined simultaneously?
27Least squares
Warning Frequently, all parameters cannot be
let go at the same time How to tell which
parameters can be refined simultaneously?
Use correlation matrix Calc correlation
matrix for each refinement cycle Look for strong
interactions (rij gt 0.5 or lt 0.5,
roughly) If 2 parameters interact, hold one
constant