Problem 2

A company gathers the following data:

Year: 1993 1994 1995 1996 1997
Annual Sales (in millions of dollars): 0.8 2 3 4.2 5

Represent the years 1993, ... ,1997 as -2,-1,0,1,2, respectively, and let x denote the year.
Let y denote the annual sales (in millions of dollars).

(a) Find the least squares line relating x and y.

A={{-2,1},{-1,1},{0,1},{1,1},{2,1}}; yy={{0.8},{2},{3},{4.2},{5}};

{{m},{b}}=Inverse[Transpose[A].A].Transpose[A].yy

y[x_]=m*x+b

or, more simply:

[Graphics:1230f97.ansq4gr2.gif][Graphics:1230f97.ansq4gr3.gif]

(b) Use the equation obtained in part (a) to estimate the annual sales for the year 1999.

[Graphics:1230f97.ansq4gr2.gif][Graphics:1230f97.ansq4gr5.gif]