Information Technology Reference
In-Depth Information
5.3.1
Approximating Functions by a Constant
Let y
D
y.t/ be a given function defined on the interval Œa; b. We want to compute
a constant approximation of y given by
p.t/
D
˛
(5.104)
for t
2
Œa; b. Our aim is to compute ˛ using the least squares principle. Thus we
want to minimize the integral
Z
b
.p.t /
y.t//
2
dt
D
Z
b
a
.˛
y.t//
2
dt
:
(5.105)
a
Define
F.˛/
D
Z
b
a
.˛
y.t//
2
dt
(5.106)
and compute
F
0
.˛/
D
2
Z
b
a
.˛
y.t//
dt
:
(5.107)
The solution of the equation
F
0
.˛/
D
0
(5.108)
is thus given by
Z
b
1
b
a
˛
D
y.t/
dt
:
(5.109)
a
Here there are several things you should note:
(a) The formula for ˛ is the integral version of the average of y on Œa; b.Inthe
discrete case we would have written
n
X
1
n
˛
D
y
i
;
(5.110)
i D1
ba
n
If y
i
in (
5.110
)isy.t
i
/,wheret
i
D
a
C
it and t
D
,then
Z
b
n
X
n
X
1
n
1
b
a
t
1
b
a
y
i
D
y.t
i
/
y.t/
dt
:
a
i D1
i D1