Linear regression models
A regression model writes Y=m(x)+epsilon, with zero mean noise conditional on each supplied predictor value.
On this page 9 sections
01Understand the idea#
A linear regression model describes an output as an intercept plus weighted features, with a residual for what the model does not explain. The weights are shared across observations; feature values change from one observation to the next.
Fix the predictor at . This toy model makes equally likely. Their mean is , even though an individual response can differ.
Write the response as a conditional mean plus noise. The noise must average to zero at each predictor value.
With intercept 2 and weights , observation has fitted value . If the observed target is 11, its residual under the convention observed minus fitted is 2. The fitted value, coefficient vector, and residual are different objects.
, . Give .
Show answer and explanation
; the noise averages to zero.
02For Y=1+2x+epsilon, the mean at x=2 is 5#
For , the mean at is . A response of has noise . The mean describes the conditional distribution; it does not force each response to equal .
, . A learner calls the mean. Repair .
Show answer and explanation
; the noise averages to zero.
03A model may use a supplied feature such as h(x)=x^2#
A model may use a supplied feature such as . The mean is still linear in its coefficients. The transformation is fixed; the additive noise stays separate.
Feature . Offset , coefficient ; variable noise with . Choose .
Show answer and explanation
.
04A closer look#
A model can use transformed features, such as an input squared, while remaining linear in its coefficients. A fitted weight describes the specified model with other features held fixed; it is not automatically a causal effect. Model structure and interpretation should be chosen before fitting.
Keep every supplied predictor term in the conditional mean. Add noise whose conditional mean is zero.
- Specify a conditional mean model separating predictors from residual noise.
Further questions
How can observation rows encode these features and the intercept?
Sources & further reading
- [1]Penn State STAT 501, Lesson 1: Simple Linear Regression ↗Textbook · Book
- [2]