Solve normal equations

Problem

Fit y^=b+wx\hat{y}=b+wx by ordinary least squares to (0,1)(0,1), (1,2)(1,2), and (2,2)(2,2). Form XTXX^{\mathsf T}X and XTyX^{\mathsf T}y using an intercept column, then solve for (b,w)(b,w).

Reveal answer or reference solution

The normal-equation quantities are

XTX=[3335],XTy=[56].X^{\mathsf T}X=\begin{bmatrix}3&3\\3&5\end{bmatrix},\qquad X^{\mathsf T}y=\begin{bmatrix}5\\6\end{bmatrix}.

Solving gives b=76b=\frac{7}{6} and w=12w=\frac{1}{2}. The fitted values are (76,53,136)(\frac{7}{6},\frac{5}{3},\frac{13}{6}).

Outcome

Previous attempts

Loading attempts saved in this browser…

    Review Screening Results