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+β1xi+εiWhere:
- 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−β1xi)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