Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Problems for chapter 8

8.1    Fitting a constant Function using Least squares

use the method of least squares, ind the constant function f (①) = C that best its the data.

(a).   Data set 1:

i

 1

2

3

gi

5/4

4/3

5/12

(b).   Data set 2:

i   

 O.1

O

O.1

gi   

1.4

1.5

1.4

(c).    Given a general data set  (①k, g k) for k = O, 1, . . . , m, ind the constant function f (①) = C that best it the data.  Derive the formula for C.  Does the formula depend on the points ①kAre you surprised with the formula?

8.2    Fitting Functions with one parameter with Least squares

For each of the problem, derive the general formula for general data set  (①i, gi), i = O, 1, . . . , m. Then apply it to the following data set:

i

 1

2

3

gi

5/4

4/3

5/12

(a).    suppose that the table is known to conform to a function like

g = ①2  — ① + c.

what value of c is obtained by the least-squares theory?

(b).    suppose that the table is thought to be represented by a function

g = K . log | ① | .

(Here and below, log denotes the natural log.)  If so, what value for K is the best it according to the least-squares theory?

(c).    Now, if the table is thought to conform to a relationship

g = log(β| ① |),

what is the value of β obtained by the method of least squares?

Hints: There are possibly several ways of solving.  There we suggest two of them. (i) utilize the identity logab = loga + logb; (ii) Express β in terms of (①, g).

You are encouraged to try both.   Do  you  get the same  answer?  would  you like to comment on that?

8.3    The Method of Least squares with polynomial egression

(a).    what straight line best its the following data in the least-squares sense?

i

1

2

3

4

gi

O

1

1

2

(b).    Find the values a and b such that the function     g(①) = a① +b     best approximate

the data:

i   

-O.1

O

O.1

gi   

1.4

1.5

1.4

(c).    Find the  equation of a parabola of form g  = a①2  + b  that best represents the following data, in least-squares sense:

i

-1

O

1

gi

3.1

O.9

2.9

8.4    The method of least squares with non-polynomial functions

(a).    we are given a data set (①k, g k), with k = O, . . . , m.  we seek a function of the form

g(①)  =  asin ① + β cos ①

that best approximates the data.  set up the normal equations, which solve the problem with the method of least squares.

compute the values of a and β which provide the best it to the particular data

i

1.O

1.5

2.O

2.5

gi

1.9O2

O.5447

-O.9453

-2.2O4

(b).    Let  f (①) be a given function and ①k   (k  =  O, . . . m) be a set of points.   what constant c makes the expression

 [f (①k)  cek ]2

as small as possible?

8.5    Miscellaneous Exercises

(a).    show that the solution of the normal equations (8.2.5) (on p. 198 of the textbook) can not give a maximum point for the error function ψ.  (Hint:Recall the 2nd derivative test for multivariable functions.)

(b).    show that if a straight line is itted to a table  (①i, gi) by the method of least squares,  then the  line will pass through the point  (①* , g* ) where ①*   and  g*   are  the averages of the ①i,s and gi,s, respectively.  (Hint:stare at the normal equations (8.2.5) on page 198 in the textbook.)

(c).    An experiment involves two independent variables (①, g) and one dependent vari- able 从 . How can a function

从 (①, g) = a + b① + cg

be itted to the table of points  (①k, gk, 从k) with k  = O, 1, . . . , m? Derive the normal equations.

8.6    Least squares for over-determined systems

(a).    consider the over-determined system

a kjj  = bk ,       O  k  m,       n < m.

In general, since the number of equations m + 1 is larger than the number of unknown n + 1, the system has no solutions.

A“best solution” can be deined as the one that minimizes the error

ψ(0,  1 , . . .  , ①n) = 

Derive the normal equations.

a kj bk)2 .

(b).    Determine the“best solution” (in the least square sense) for the following system

,(2① + 3g = 1,

  4g = 9,

(2①  g =  1.

(c).    Now, expression the system in matrix-vector form

A① = b

where A is a rectangular matrix, which has more rows than columns.  show that the normal equations can be written as

(AT A)① = ATb.

8.7    Application:  A population model

Assume that the growth of the world,s population could be described by the ODE

dtp(t)  =  Kp (t),

where

p   =   world population, in millions of people

t   =   time, measured in years

K   =   growth rate

The general solution of this ODE has the form

p(t) =  .  .                                                 (*) for some constants K, to.  Throughout the past, we have recorded the following historical data:

(a).  consider the new variables g = 1O6/p, and ① = t — 183O.  Rewrite the equation (*) in the form g(①) = ao  + a1.

(b).  use the method of least squares to determine ao  and a1 .

(c).  Going back to the original variables, ind K and to.  Now you can write out the function p(t) that describes the population p as a function of time t.

(d).  use the model to predict the population for t = 198O, t = 2OOO and t = 2O1O. Are you happy with the result? comparing to the actual population in 2O11, which is about 7.1 billions, what would you say about this model?

8.8    Quasi-linear method of least squares

For the table

k

O.O

O.2

O.4

O.6

O.8

1.O

g k

1.996

1.244

O.81O

O.541

O.375

O.259

we seek a least squares approximation of the form

g (①)   =   ao  . (1 十(ea)①(1从))a2  

where ao , a1  and a2  are three unknown coe伍cients.

(a). write the normal equations for your approximation.

Try to reformulate the problem in a suitable away, so that, after a variable change, you get a linear system.

(b).  use Matlab to compute the solution to the normal equations. Make a plot which shows the data points and the least squares approximation (①).  compute the sum of squares

k(Σ)(g k   g (①k))2 .

8.9    The method of least squares in Matlab

Given data set

k  

O

O.1

O.2

O.3

O.4

O.5

O.6

O.7

O.8

O.9

1

g k  

O.7829

O.8O52

O.5753

O.52O1

O.3783

O.2923

O.1695

O.O842

O.O415

O.OO9

O

use Matlab function polyfit to ind respectively the irst, second, fourth and eighth order polynomials that best it the data, using the method of least squares. You should also plot your polynomials, together with the data set.

what to hand in:  The script ile, the plots, and your comments.

8.10    Least squares approximation of functions

Let f (①) be a function deined on the interval [ — 1)1], as

f (①) = { 1(1)        O(1) 三(三) ①(①) 三 1(< O).

we want to approximate f (①) by a function of the form

g(①)  =  a cos(π①) 十 bsin(π①).

Find the best possible constants a and b, by the method of least squares.

8.11    Misc on Fitting Functions

(a).    Find the constant c that makes the expression

l01 (e   c①)2 d①

a minimum.

(b).    Find the constant c for which c① is the best approximation in the sense of least squares to the function sin ① on the interval [o, π/2].

Do the same for e  on  [o, 1].

(c).    In itting a table of values to a function of the form

a + b① -1 + c① -2

we try to make each point lie on the curve. This leads to

a + b①k(-)1  + c①k(-)2 = gk ,       o  k  m.

An equivalent equation is

a①k(2) + b①k  + c = g kk(2) ,       o  k  三 m.

(1)

(2)

Are the least square problems for these two systems (1) and (2) equivalent? Explain in detail.

8.12    prony,s Method in Matlab; Bonus

we describe the prony,s method with n = 1.  To it a table of data of the form

i

1

2

. . .

m

gi

g1

g2

. . .

gm

by the function g = ab , in some least square sense, we can proceed as follows:

(I).    If g is actually ab , then

g k  = abk ,         今    g k+1  = bg k,    k = 1, 2, . . . , m — 1.

So we can determine b irst. Derive the formula for the“best-it” value of b.

(II).    Then we ind a by itting in the function g = ab  using the b determined in (I). Derive the formula for computing a.

(III).   write a Matlab program for this method, and test it on the data with m = 1o and g k  = k2. plot the data together with your ”best itting” function.