64
Chapter
3.
Essential
linear
algebra
Example
3.37.
We
assume that data points
(xi,yi)
=
(0.10,1.7805),
(z
2
,!fe)
=
(0.30,2.2285),
(z
3
,2/
3
)
=
(0.40,2.3941),
(0:4,2/4)
=
(0.75,3.2226),
(a*,2/5)
-(0.90,3.5697)
have
been collected
in the
laboratory,
and
there
is a
theoretical reason
to
believe
that
yi
=
axi
+ b
ought
to
hold
for
some choices
of
a, b 6 R. Of
course,
due to
measurement error, this relationship
is
unlikely
to
hold exactly
for any
choice
of
a
and b, but we
would like
to find a and b
that come
as
close
as
possible
to
satisfying
it. If we
define
then
one way to
pose this problem
is to
choose
a and b so
that
ax + be is as
close
as
possible
to y in the
Euclidean
norm.
That
is, we find the
best approximation
to
y
from
W =
span{x,
e).
The
Gram
matrix
is
The
resulting linear model
is
displayed,
together with
the
original data,
in
Figure
3.5.
Example
3.38.
One
advantage
of
working with polynomials instead
of
transcen-
dental
functions like
e
x
is
that polynomials
are
very easy
to
evaluate—only
the
basic
arithmetic operations
are
required.
For
this reason,
it is
often
desirable
to
approx-
imate
a
more complicated
function
by a
polynomial. Considering
f(x]
=
e
x
as a
function
in
(7[0,1],
we find the
best quadratic approximation,
in the
mean-square
sense,
to
f.
A
basis
for the
space
V^
of
polynomials
of
degree
2 or
less
is
{l,x,x
2
}.
and
the
right-hand side
of the
normal equations
is
Solving
the
normal equations yields
64
Chapter 3. Essential linear algebra
Example
3.37.
We assume that data points
(xl,yd
= (0.10,1.7805),
(X2,
Y2)
= (0.30,2.2285),
(X3,
Y3)
= (0.40,2.3941),
(X4,
Y4)
= (0.75,3.2226),
(X5,Y5) = (0.90,3.5697)
have
been
collected in the laboratory, and there is a theoretical reason to believe
that
Yi
= aXi + b ought to hold for some choices
of
a, b E
R.
Of
course, due to
measurement error, this relationship is unlikely to hold exactly for any choice
of
a
and
b,
but
we
would like to find a and b that come
as
close
as
possible to satisfying
it.
If
we
define
Y=[H~:~
,x~
3.2226
3.5697
0.10
I
0.30
0.40
,e
=
0.75
0.90
1
1
1
1
1
then one way to pose this problem is to choose a and b
so
that
ax
+ be is
as
close
as
possible to y
in
the Euclidean norm. That is,
we
find the best approximation to
y from W = span{x, e}.
The Gram matrix is
G = [
x·
x
e·
x ] =
[1.6325
2.45]
x . e
e·
e
2.45
5 '
and the right-hand side
of
the normal equations is
b = [
x·
y ]
==
[ 7.4370 ]
e·
y
13.196·
Solving the normal equations yields
[
a]
==
[ 2.2411 ]
b
1.5409'
The resulting linear model is displayed, together with the original data,
in
Figure
3.5.
Example
3.38.
One advantage
of
working with polynomials instead
of
transcen-
dental functions like
eX
is that polynomials
are
very easy to
evaluate~only
the basic
arithmetic operations
are
required. For this reason,
it
is often desirable to approx-
imate a more complicated function by a polynomial. Considering
f(x)
=
eX
as
a
function
in
C(O,
1],
we
find the best quadratic approximation,
in
the mean-square
sense, to
f.
A basis for the space
P2
of
polynomials
of
degree
2 or less is
{I,
x,
x
2
}.