














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















we are given:
functions
f
1
,... , f
n
, called
regressors
or
basis functions
data
or
measurements
s
i
, g
i
i
,... , m
, where
s
i
and (usually)
m
n
problem:
find coefficients
x
1
,... , x
n
so that
x
1
f
1
s
i
x
n
f
n
s
i
g
i
i
,... , m
i.e.
, find linear combination of functions that fits data
least-squares fit:
choose
x
to minimize total square fitting error:
m
i
=
x
1
f
1
s
i
x
n
f
n
s
i
g
i
2
Least-squares applications
6–
using matrix notation, total square fitting error is
Ax
g
2
, where
ij
f
j
s
i
hence, least-squares fit is given by
x
T
−
1
T
g
(assuming
is skinny, full rank)
corresponding function is
f
lsfit
s
x
1
f
1
s
x
n
f
n
s
applications: –
interpolation, extrapolation, smoothing of data
developing simple, approximate model of data
Least-squares applications
6–
assuming
t
k
t
l
for
k
l
and
m
n
is full rank:
suppose
Aa
corresponding polynomial
p
t
a
0
a
n
−
1
t
n
−
1
vanishes at
m
points
t
1
,... , t
m
by fundamental theorem of algebra
p
can have no more than
n
zeros, so
p
is identically zero, and
a
columns of
are independent,
i.e.
full rank
Least-squares applications
6–
fit
g
t
t/
t
2
with polynomial
m
points between
t
t
least-squares fit for degrees
have RMS errors
, respectively
Least-squares applications
6–
Docsity.com
consider
family
of least-squares problems
minimize
p i
=
x
i
a
i
y
for
p
,... , n
a
1
,... , a
p
are called
regressors
approximate
y
by linear combination of
a
1
,... , a
p
project
y
onto
span
a
1
,... , a
p
regress
y
on
a
1
,... , a
p
as
p
increases, get better fit, so optimal residual decreases
Least-squares applications
6–
solution for each
p
n
is given by
x
(
p
)
ls
Tp
p
−
1
Tp
y
−
1
p
Tp
y
where
p
a
1
a
p
m
×
p
is the first
p
columns of
p
p
p
is the
factorization of
p
p
p
×
p
is the leading
p
p
submatrix of
p
q
1
q
p
is the first
p
columns of
Least-squares applications
6–
we measure input
u
t
and output
y
t
for
t
of unknown system
u
t
y
t
unknown system
system identification problem:
find reasonable model for system based
on measured I/O data
u
y
example with scalar
u
y
(vector
u
y
readily handled): fit I/O data with
moving-average (MA) model with
n
delays
y
t
h
0
u
t
h
1
u
t
h
n
u
t
n
where
h
0
,... , h
n
Least-squares applications
6–
we can write model or predicted output as
y
n
y
n
y
u
n
u
n
u
u
n
u
n
u
u
u
u
n
h
0
h
1
h
n
model prediction error
is
e
y
n
y
n
,... , y
y
least-squares identification:
choose model (
i.e.
h
) that minimizes norm
of model prediction error
e
... a least-squares problem (with variables
h
Least-squares applications
6–
0
10
20
30
40
50
60
70
−1 −2 −3 −
5 4 3 2 1 0
t
solid:
y
(
t
)
: actual output
dashed:
ˆ y
(
t
)
, predicted from model
Least-squares applications
6–
question:
how large should
n
be?
obviously the larger
n
, the smaller the prediction error
on the data used
to form the model
suggests using largest possible model order for smallest prediction error
Least-squares applications
6–
evaluate model predictive performance on another I/O data set
not used to
develop model model validation data set:
0
10
20
30
40
50
60
70
−2 −
4 2 0
0
10
20
30
40
50
60
70
−
5 0
)t( ¯y
t t
)t( ¯u
Least-squares applications
6–
now check prediction error of models (developed using
modeling data
) on
validation data:
0
5
10
15
20
25
30
35
40
45
50
0
0.8 0.6 0.4 0.
1
n
relative prediction error
validation datamodeling data
plot suggests
n
is a good choice
Least-squares applications
6–
least-squares problem in ‘row’ form:
minimize
Ax
y
2
m
i
=
a
Ti
x
y
i
2
where
˜a
Ti
are the rows of
˜a
i
n
x
n
is some vector to be estimated
each pair
a
i
y
i
corresponds to one measurement
solution is
x
ls
m
i
=
a
i
˜a
Ti
−
1
m
i
=
y
i
˜a
i
suppose that
˜a
i
and
y
i
become available sequentially,
i.e.
m
increases
with time
Least-squares applications
6–
we can compute
x
ls
m
m
i
=
˜a
i
a
Ti
−
1
m
i
=
y
i
˜a
i
recursively
initialize
n
×
n
q
n
for
m
m
m
a
m
a
Tm
q
m
q
m
y
m
˜a
m
if
m
is invertible, we have
x
ls
m
m
−
1
q
m
m
is invertible
˜a
1
˜a
m
span
n
(so, once
m
becomes invertible, it stays invertible)
Least-squares applications
6–