least-squares
- L. Olson
Department of Computer Science University of Illinois at Urbana-Champaign
1
least-squares L. Olson Department of Computer Science University - - PowerPoint PPT Presentation
least-squares L. Olson Department of Computer Science University of Illinois at Urbana-Champaign 1 polling data Suppose we are given the data { ( x 1 , y 1 ) , ..., ( x n , y n ) } and we want to find a curve that best fits the data. 2
Department of Computer Science University of Illinois at Urbana-Champaign
1
2
3
4
5
2 = rTr = (b − Ax)T(b − Ax) = bTb − 2xTA Tb + xTA TAx
6
1 >> A = rand(10,10); 2 >> cond(A) 3
4 >> cond(A’*A) 5
8
9
2 = (Qv)T(Qv) = vTQTQv = vTv = ||v||2 2.
10
r2
2 = b − Ax2 2 =
R
2
=
R
2
=
R
2
R
2
=
c2
Rx1
2
=
c2
2
= ||c1 − Rx1||2
2 + ||c2||2 2
11
1 q2 = 0 and q2 = a2 + cq1. That is,
1 q2 = 0 = qT 1 a2 + cqT 1 q1
12
1 q2 = 0 = qT 1 a2 + cqT 1 q1
1 a2
1 q1
1 a2
1 q1
2 a3
2 q2
1 a3
1 q1
13
i aj
qT
i qi , j > i 14
1
1 q1
1 (I − q1qT 1
1 q1
15
1 function [Q,R] = gs_qr (A) 2 3 m = size(A,1); 4 n = size(A,2); 5 6 for i = 1:n 7
8
9
10
11
12
13 end 14 15 end 16
1
n
17
2 = ||b − Ax||2 2.
2 = ||b − Ax||2 2 = ||b − USVTx||2 2
2 = ||UTb − UTUSVTx||2 2 = ||UTb − SVTx||2 2
18
2 = ||c − Sy||2 2
2 = k
n
i
σi for 1 i k.
19
r
i
i b.
20