General Look at Linear Regression

真实模型

  • 总体条件期望函数
  • 总体最佳线性近似

YY is a r.v., X=[1X1…Xp−1]TX=\begin{bmatrix}1 & X_{1} & \dots & X_{p-1}\end{bmatrix}^T is a random vector. We have

argmin⁡mE[(Y−m(X))2]=E[Y∣X]\operatorname*{argmin}_{m}\mathbb{E}[(Y-m(X))^{2}]=\mathbb{E}[Y\mid X]

(The proof is not hard. I'd say it's high school level.)

The best linear fit is βTX\beta^TX where

β=argmin⁡β0,βE[(Y−βTX)2]\beta=\operatorname*{argmin}_{\beta_{0},\beta}\mathbb{E}[(Y-\beta^TX)^{2}]

The solution is

β=(E[XXT])−1E[XY]\beta=\big(\mathbb E[XX^T]\big)^{-1}\mathbb E[XY]

Now we have some samples of (Y,X)(Y,X):

[y11x11…x1py21x21…x2p⋮⋮⋮⋱⋮yn1xn1…xnp]\begin{bmatrix} y_{1} & 1 & x_{11} & \dots & x_{1p} \\ y_{2} & 1 & x_{21} & \dots & x_{2p} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ y_{n} & 1 & x_{n1} & \dots & x_{np} \end{bmatrix}

And run OLS on the samples, which is to solve

argmin⁡b0,…,bp∑i=1n(yi−(b0+∑k=1pbkxik))2\operatorname*{argmin}_{b_{0},\dots,b_{p}} \sum_{i=1}^{n} \left( y_{i}-\left( b_{0}+\sum_{k=1}^{p} b_{k}x_{ik} \right) \right)^{2}

This is equal to solve

argmin⁡b0,…,bp1n∑i=1n(yi−(b0+∑k=1pbkxik))2\operatorname*{argmin}_{b_{0},\dots,b_{p}} {\color{red}\frac{1}{n}} \sum_{i=1}^{n} \left( y_{i}-\left( b_{0}+\sum_{k=1}^{p} b_{k}x_{ik} \right) \right)^{2}

Take limit n→∞n\to \infty,

argmin⁡b0,…,bpE[(Y−(b0+∑k=1pbkXk))2]\operatorname*{argmin}_{b_{0},\dots,b_{p}}\mathbb{E}\left[ \left( Y-\left( b_{0}+\sum_{k=1}^{p} b_{k}X_{k} \right) \right)^{2} \right]

We unrigorously passed the lim⁡\lim inside the argmin⁡\operatorname*{argmin} and took the probability limit. The step equating the probability limit to the expectation requires the sampling to satisfy certain conditions, such as weak correlation.

So OLS always estimates β0,β\beta_{0},\beta and it's valid because the estimator is consistent.

数据收集

设计矩阵


General Look at Linear Regression
https://wtx17.github.io/2026/11/25/General Look at Linear Regression/
作者
wtx
发布于
2026年11月25日
更新于
2026年12月2日
许可协议