Professional Documents
Culture Documents
winter 2024
Week Topic
1 Introduction
2–3 Solving nonlinear equations in one variable
4–5 Solving systems of (non)linear equations
6 Computational complexity
6–8 Interpolation and least squares
9–10 Differentiation
10 Integration
11–12 Initial value problems & APS
12 Revision
Outline
functions, e.g. 4
◮ hard-to-evaluate functions 2
◮ solutions to differential or −2
functional equations. −4
guaranteed. −8
−3 −2 −1 0 1 2 3 4
stems from 2
◮ uncertainty in measurements, 0
◮ cumulating numerical error,
◮ stochastic processes, −2
◮ ... −4
low-order polynomial 4
the data. 0
approximant will be −4
over-determined. −6
There are more conditions of the form P(xi ) = yi then there are
coefficients in P. This leads to an overdetermined system of
linear equations:
A ~x = ~b
x1 −2x2 = 21
1.5
x1 −x2 = 1
x1 +x2 = −1
◮ N = 3 equations 1
◮ M = 2 unknowns 0.5
x2
0
◮ Overdetermined
(N > M) −0.5
◮ No solution exists −1
−1.5
◮ In matrix form,
−2
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2
x1
1 −2 1/2
1 −1 x1 = 1
x2
1 1 −1
the residual of ~y is
~r (~y ) = ~b − A~y
the residual of ~y is
~r (~y ) = ~b − A~y
the residual of ~y is
~r (~y ) = ~b − A~y
M
X
Φ∞ (~y ) : = k~b − A~y k∞ = max |bk − Ak ℓ yℓ |
1≤k ≤N
ℓ=1
= maximum abs. value of components of residual.
N M
1 ~ 1X X
Φ1 (~y ) : = kb − A~y k1 = |bk − Ak ℓ yℓ |
N N
k =1 ℓ=1
= average of abs. value of residual components.
1 ~
Define Φ(~y ) : = kb − A~y k22
N
N M
!2
1 X X
= bk − Ak ℓ yℓ
N
k =1 ℓ=1
= Mean-square residual of ~y .
1 ~
Define Φ(~y ) : = kb − A~y k22
N
N M
!2
1 X X
= bk − Ak ℓ yℓ
N
k =1 ℓ=1
= Mean-square residual of ~y .
∂
[Φ(~x ∗ )] = 0 (k = 1 : M)
∂xk∗
AT A~x ∗ = AT ~b
A = np.array([[1.0,-2.0],[1.0,-1.0],[1.0,1.0]])
b = np.array([0.5,1.0,-1.0])
xstar = np.linalg.lstsq(A,b)
Π1 (xk ) = a0 + a1 xk = yk (k = 0 : n)