blackblack
picture picture

Ch 3.1: Linear Regression

Lecture 4 - CMSE 381
Michigan State University
::
Dept of Computational Mathematics, Science /span> Engineering
Wed Jan 21, 2026
Announcements

Last time:

Covered in this lecture

Section 1 picture picture

Simple Linear Regression
Setup

Y β0 + β1X

SVG-Viewer needed.

” .... “is approximately modeled as”

Setup

Y β0 + β1X

SVG-Viewer needed.

” .... “is approximately modeled as”
Example

screenshot of the
advertising data set
Least squares criterion: Setup How do we estimate the coefficients?

scatter plot with linear fit and
residuals
Least squares criterion: RSS

left: contour plots of residual sum of squares in beta0-beta1
plane. Right: Three dimensional plot of RSS versus beta0 and
beta1.
sales β0 + β1TV
Residual sum of squares RSS is 𝑅𝑆𝑆 = e12 + + e n2 = i(yi β^0 β^1xi)2
picture
Least squares criterion
picture picture
Find β0 and β1 that minimize the RSS.
Least squares coefficient estimates

min β0,β1 i(yi β^0 β^1xi)2

∂𝑅𝑆𝑆 β^0 = 2 i(yi β^0 β^1xi) = 0 ∂𝑅𝑆𝑆 β^1 = 2 ixi(yi β^0 β^1xi) = 0

β^1 = i=1n(xi x¯)(yi y¯) i=1n(xi x¯)2 β^0 = y¯ β^1x¯
Coding group work

Next time

Next time:

Screenshot of the course schedule
from lectures 1 to 10.

Announcements