24.03.2013 Views

For example what is the matrix of the linear transformation from R3 ...

For example what is the matrix of the linear transformation from R3 ...

For example what is the matrix of the linear transformation from R3 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example 6. The data points at <strong>the</strong> right have been observed.<br />

It <strong>is</strong> desired to fit a quadratic regression model:<br />

y = x 2 + x + .<br />

Find <strong>the</strong> least squares quadratic polynomial and plot its graph<br />

along with <strong>the</strong> data points. Calculate <strong>the</strong> residual vector .<br />

Solution: We write <strong>the</strong> six equations, one for each data point as<br />

<strong>the</strong> vector equation:<br />

0<br />

<br />

<br />

0<br />

1<br />

<br />

1<br />

4<br />

<br />

<br />

4<br />

0<br />

0<br />

1<br />

1<br />

2<br />

2<br />

X + = y.<br />

1<br />

1<br />

0<br />

<br />

1<br />

<br />

<br />

<br />

2 <br />

1<br />

<br />

<br />

1<br />

<br />

3 0<br />

<br />

<br />

<br />

<br />

1<br />

<br />

4 1<br />

<br />

1<br />

<br />

1<br />

5<br />

<br />

1<br />

<br />

6 <br />

<br />

2<br />

The condition that be orthogonal to <strong>the</strong> columns <strong>of</strong> X <strong>is</strong>:<br />

34<br />

<br />

<br />

18<br />

<br />

10<br />

X T = 0<br />

X T (y – X) = 0<br />

X T X = X T y<br />

18<br />

10<br />

6<br />

10<br />

13<br />

6<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

7 .<br />

<br />

6 <br />

<br />

<br />

<br />

5 <br />

We can solve th<strong>is</strong> by solving <strong>the</strong> system <strong>of</strong> equations by elimination<br />

or using technology to calculate <strong>the</strong> <strong>matrix</strong> inverse. A good website<br />

<strong>is</strong>: http://www.bluebit.gr/<strong>matrix</strong>-calculator/calculate.aspx<br />

The solution <strong>is</strong><br />

<br />

^<br />

34<br />

<br />

<br />

<br />

<br />

^<br />

<br />

18<br />

<br />

^<br />

<br />

10<br />

18<br />

10<br />

6<br />

10<br />

6<br />

<br />

<br />

6 <br />

1<br />

giving us <strong>the</strong> best fit parabola<br />

The residual vector <strong>is</strong><br />

= y – X^ =<br />

13<br />

3<br />

1<br />

<br />

<br />

<br />

7<br />

<br />

6<br />

4<br />

<br />

5 <br />

<br />

1<br />

1 2<br />

y = (x – x + 1) .<br />

2<br />

0<br />

0<br />

<br />

<br />

1<br />

<br />

0<br />

0<br />

1<br />

<br />

1<br />

1<br />

1<br />

4<br />

<br />

<br />

2<br />

<br />

4<br />

0<br />

0<br />

1<br />

1<br />

2<br />

2<br />

6<br />

13<br />

3<br />

1<br />

1<br />

1<br />

<br />

<br />

1<br />

1 <br />

1<br />

1 1 1<br />

<br />

1<br />

<br />

<br />

1<br />

2 2<br />

1 <br />

1<br />

1<br />

1<br />

<br />

1<br />

<br />

1 <br />

As usual, check that <strong>is</strong> orthogonal to <strong>the</strong> columns <strong>of</strong> X .<br />

1 13<br />

1 <br />

<br />

1<br />

3 <br />

<br />

<br />

7<br />

<br />

1<br />

2 <br />

2 <br />

<br />

5 <br />

<br />

1 <br />

x y<br />

0 0<br />

0 1<br />

1 0<br />

1 1<br />

2 1<br />

2 2<br />

23C approximation and best-fit. 6<br />

3<br />

2<br />

1<br />

0<br />

3<br />

2<br />

1<br />

0<br />

y<br />

y<br />

0 1 2 3<br />

0<br />

0<br />

<br />

<br />

0<br />

<br />

0<br />

<br />

1<br />

1<br />

u v <br />

1<br />

1<br />

4<br />

2<br />

<br />

<br />

4<br />

<br />

2<br />

u•u = 34<br />

v•v = 10<br />

w•w = 6<br />

u•v = v•u = 18<br />

u•w = w•u = 10<br />

v•w = w•v = 6<br />

1<br />

<br />

<br />

1<br />

<br />

1<br />

w <br />

1<br />

1<br />

<br />

<br />

1<br />

y= (x^ 2 - x + 1)/2<br />

0 1 2 3<br />

x<br />

x<br />

0<br />

<br />

<br />

1<br />

<br />

0<br />

y <br />

1<br />

1<br />

<br />

<br />

2<br />

Having seen th<strong>is</strong> picture, can<br />

you see a way you might have<br />

deduced that th<strong>is</strong> would have to<br />

be <strong>the</strong> answer without doing<br />

any work at all?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!