Neural Sync Active
Introduction to Linear Regression
Registry Synced
Introduction to Linear Regression
355 words
2 min read
Reading compass
Now ยท ๐ฏ Learning Objectives
Introduction to Linear Regression
๐ฏ Learning Objectives
- Formulate the simple linear regression model
- Estimate parameters using ordinary least squares (OLS)
- Interpret regression coefficients
- Understand assumptions underpinning the model
1.1 Intuition: Finding the Line of Best Fit
Given a scatter plot of points (xiโ,yiโ), we want to find the line that best predicts y from x. "Best" means minimising the sum of squared vertical distances.
๐ Key Insight: Regression is about explaining variation in an outcome variable y using one or more predictor variables x.
1.2 The Simple Linear Regression Model
yiโ=ฮฒ0โ+ฮฒ1โxiโ+ฮตiโWhere:
- yiโ = response (dependent) variable
- xiโ = predictor (independent) variable
- ฮฒ0โ = intercept (expected y when x=0)
- ฮฒ1โ = slope (expected change in y per unit change in x)
- ฮตiโ = random error term, ฮตiโโผN(0,ฯ2)
1.3 Least Squares Estimation
Minimise S(ฮฒ0โ,ฮฒ1โ)=โi=1nโ(yiโโฮฒ0โโฮฒ1โxiโ)2
Normal equations:
Solution:
1.4 Interpretation
- ฮฒ^โ1โ = "a one-unit increase in x is associated with a ฮฒ^โ1โ change in y"
- ฮฒ^โ0โ = "when x=0, the predicted y is ฮฒ^โ0โ" (may not be meaningful if x=0 is outside data range)
โ Practice Questions
Q1: Given data: (1,2), (2,4), (3,5), find ฮฒ^โ0โ and ฮฒ^โ1โ.
Solutionxห=2, yหโ=11/3โ3.67 Sxxโ=(1โ2)2+(2โ2)2+(3โ2)2=1+0+1=2 Sxyโ=(1โ2)(2โ3.67)+(2โ2)(4โ3.67)+(3โ2)(5โ3.67)=(โ1)(โ1.67)+0+(1)(1.33)=1.67+1.33=3 ฮฒ^โ1โ=3/2=1.5 ฮฒ^โ0โ=3.67โ1.5(2)=0.67 y^โ=0.67+1.5x Join Discord NextRegression Applications