In Exercises 1-4, find the equation \(y = {\beta _0} + {\beta _1}x\) of the least-square line that best fits the given data points.

4. \(\left( {2,3} \right),\left( {3,2} \right),\left( {5,1} \right),\left( {6,0} \right)\)

Short Answer

Expert verified

The equation of the least-square line that best fits is \(y = 4.3 - 0.7x\).

Step by step solution

01

The design matrix X and observation vector y

Use the x and y coordinates to find the \(X\) and \(y\) matrices.

\(X = \left[ {\begin{aligned}1&2\\1&3\\1&5\\1&6\end{aligned}} \right]\) and \(y = \left[ {\begin{aligned}3\\2\\1\\0\end{aligned}} \right]\)

02

Obtain the normal equations

The normal equation of \(X\beta = y\) can be obtained using \({X^T}X\beta = {X^T}y\), which is equivalent to \(\beta = {\left( {{X^T}X} \right)^{ - 1}}{X^T}y\).

Find \({X^T}X\) as follows:

\(\begin{aligned}{X^T}X &= \left[ {\begin{aligned}1&1&1&1\\2&3&5&6\end{aligned}} \right]\left[ {\begin{aligned}1&2\\1&3\\1&5\\1&6\end{aligned}} \right]\\ &= \left[ {\begin{aligned}{1 + 1 + 1 + 1}&{2 + 3 + 5 + 6}\\{2 + 3 + 5 + 6}&{4 + 9 + 25 + 36}\end{aligned}} \right]\\ &= \left[ {\begin{aligned}4&{16}\\{16}&{74}\end{aligned}} \right]\end{aligned}\)

Find the inverse of \({X^T}X\) as follows:

\(\begin{aligned}{\left( {{X^T}X} \right)^{ - 1}} &= {\left[ {\begin{aligned}4&{16}\\{16}&{74}\end{aligned}} \right]^{ - 1}}\\ &= \frac{1}{{296 - 256}}\left[ {\begin{aligned}{74}&{ - 16}\\{ - 16}&4\end{aligned}} \right]\\ &= \frac{1}{{40}}\left[ {\begin{aligned}{74}&{ - 16}\\{ - 16}&4\end{aligned}} \right]\end{aligned}\)

Find \({X^T}y\) as follows:

\(\begin{aligned}{X^T}y &= \left[ {\begin{aligned}1&1&1&1\\2&3&5&6\end{aligned}} \right]\left[ {\begin{aligned}3\\2\\1\\0\end{aligned}} \right]\\ &= \left[ {\begin{aligned}{3 + 2 + 1 + 0}\\{6 + 6 + 5 + 0}\end{aligned}} \right]\\ &= \left[ {\begin{aligned}6\\{17}\end{aligned}} \right]\end{aligned}\)

03

Solve the normal equation

Substitute the calculated values in \(\beta = {\left( {{X^T}X} \right)^{ - 1}}{X^T}y\) and solve it as follows:

\(\begin{aligned}\beta &= {\left( {{X^T}X} \right)^{ - 1}}{X^T}y\\\beta &= \frac{1}{{40}}\left[ {\begin{aligned}{74}&{ - 16}\\{ - 16}&4\end{aligned}} \right]\left[ {\begin{aligned}6\\{17}\end{aligned}} \right]\\\beta &= \frac{1}{{40}}\left[ {\begin{aligned}{444 - 272}\\{ - 96 + 68}\end{aligned}} \right]\\\beta &= \frac{1}{{40}}\left[ {\begin{aligned}{172}\\{ - 28}\end{aligned}} \right]\\\left[ {\begin{aligned}{{\beta _0}}\\{{\beta _1}}\end{aligned}} \right] &= \left[ {\begin{aligned}{4.3}\\{ - 0.7}\end{aligned}} \right]\end{aligned}\)

Hence, the equation of the least-square line that best fits is \(y = 4.3 - 0.7x\).

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

In Exercises 13 and 14, find the best approximation to\[{\bf{z}}\]by vectors of the form\[{c_1}{{\bf{v}}_1} + {c_2}{{\bf{v}}_2}\].

13.\[z = \left[ {\begin{aligned}3\\{ - 7}\\2\\3\end{aligned}} \right]\],\[{{\bf{v}}_1} = \left[ {\begin{aligned}2\\{ - 1}\\{ - 3}\\1\end{aligned}} \right]\],\[{{\bf{v}}_2} = \left[ {\begin{aligned}1\\1\\0\\{ - 1}\end{aligned}} \right]\]

Suppose \(A = QR\), where \(Q\) is \(m \times n\) and R is \(n \times n\). Showthat if the columns of \(A\) are linearly independent, then \(R\) mustbe invertible.

Compute the quantities in Exercises 1-8 using the vectors

\({\mathop{\rm u}\nolimits} = \left( {\begin{aligned}{*{20}{c}}{ - 1}\\2\end{aligned}} \right),{\rm{ }}{\mathop{\rm v}\nolimits} = \left( {\begin{aligned}{*{20}{c}}4\\6\end{aligned}} \right),{\rm{ }}{\mathop{\rm w}\nolimits} = \left( {\begin{aligned}{*{20}{c}}3\\{ - 1}\\{ - 5}\end{aligned}} \right),{\rm{ }}{\mathop{\rm x}\nolimits} = \left( {\begin{aligned}{*{20}{c}}6\\{ - 2}\\3\end{aligned}} \right)\)

6. \(\left( {\frac{{{\mathop{\rm x}\nolimits} \cdot {\mathop{\rm w}\nolimits} }}{{{\mathop{\rm x}\nolimits} \cdot {\mathop{\rm x}\nolimits} }}} \right){\mathop{\rm x}\nolimits} \)

In Exercises 1-6, the given set is a basis for a subspace W. Use the Gram-Schmidt process to produce an orthogonal basis for W.

6. \(\left( {\begin{aligned}{{}}3\\{ - 1}\\2\\{ - 1}\end{aligned}} \right),\left( {\begin{aligned}{{}}{ - 5}\\9\\{ - 9}\\3\end{aligned}} \right)\)

Compute the least-squares error associated with the least square solution found in Exercise 3.

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free