Quiz 2

Multiple Linear Regression

213 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Multiple Linear Regression ## 2.1 Model Formulation $$ y_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_k x_{ik} + \varepsilon_i $$ In matrix form: $\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \boldsymbol{\varepsilon}$ Where: $$ \mathbf{y} = \begin{pmatrix} y_1 \\ \vdots \\ y_n \end{pmatrix}, \quad...

Multiple Linear Regression

2.1 Model Formulation

yi=β0+β1xi1+β2xi2++βkxik+εiy_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_k x_{ik} + \varepsilon_i
In matrix form: y=Xβ+ε\mathbf{y} = \mathbf{X}\boldsymbol{\beta} + \boldsymbol{\varepsilon} Where:
y=(y1yn),X=(1x11x1k1xn1xnk),β=(β0βk)\mathbf{y} = \begin{pmatrix} y_1 \\ \vdots \\ y_n \end{pmatrix}, \quad \mathbf{X} = \begin{pmatrix} 1 & x_{11} & \cdots & x_{1k} \\ \vdots & \vdots & \ddots & \vdots \\ 1 & x_{n1} & \cdots & x_{nk} \end{pmatrix}, \quad \boldsymbol{\beta} = \begin{pmatrix} \beta_0 \\ \vdots \\ \beta_k \end{pmatrix}

2.2 Normal Equations

XTXβ^=XTy\mathbf{X}^T\mathbf{X}\hat{\boldsymbol{\beta}} = \mathbf{X}^T\mathbf{y}
Solution: β^=(XTX)1XTy\hat{\boldsymbol{\beta}} = (\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{y} (when XTX\mathbf{X}^T\mathbf{X} is invertible)

2.3 Interpretation of Coefficients

Each coefficient β^j\hat{\beta}_j represents the expected change in yy for a one-unit change in xjx_j, holding all other variables constant.

2.4 ANOVA Decomposition

SStotal=SSreg+SSresSS_{total} = SS_{reg} + SS_{res}
R2=SSregSStotalR^2 = \frac{SS_{reg}}{SS_{total}} = proportion of variance explained by the model.

✅ Practice Questions

Q1: For a model with y=β0+β1x1+β2x2+εy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \varepsilon, how do you interpret β^1\hat{\beta}_1?
Solution
β^1\hat{\beta}_1 is the expected change in yy for a one-unit increase in x1x_1, holding x2x_2 constant. It's a partial regression coefficient controlling for the effect of x2x_2. Join Discord PreviousRegression ApplicationsNextGoodness of Fit
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.