考慮歷史 Dow Jones 指數如下圖所示 令 $v(t)$ 表示 從1795年到 2019年每年的 Dow Jones 指數其中 $t=1,1,\ldots,T$ 且 $t=1$表示 1795年,$t=T$表示至今 (上圖為2019年,但任意年皆可)。由上圖,我們假設 $v_t$ 可由以下 指數函數 近似:亦即 $v: \mathbb{N} \to \mathbb{R}$ 滿足 \[ v(t):= e^{at+b} \]其中 $t=1,...,T$,$a,b$ 為 待估計參數。我們想問是否能找出 $a,b$ 使得我們可以用此模型來預估未來 Dow Jones 指數的走向: 上述問題可化簡為回歸問題。首先對 $v_t$ 等式兩邊同取 $\log$,我們可得 \[ \log v(t) = at+b \]故對任意 $t=1,...,T$我們有 \[ \begin{bmatrix}\log v(1)\\\log v(2)\\ \vdots \\ \log v(T) \end{bmatrix} = \begin{bmatrix}1 & 1 \\ 2 & 1 \\ 3 & 1\\ \vdots & \vdots \\ T & 1 \end{bmatrix} \begin{bmatrix} a\\b\end{bmatrix} \] 令 ${\bf x}=[a \;\; b]^T$,${\bf b}=\begin{bmatrix}\log v(1) & \log v(2) & \vdots \log v(T) \end{bmatrix}^T$ 且 $$A:=\begin{bmatrix}1 & 1 \\ 2 & 1 \\ 3 & 1\\ \vdots & \vdots \\ T & 1 \end{bmatrix} \in \mathbb{R}^{T \times 2} $$ 則我們得到 $ A{\bf x} = {\bf b} $ 。由於 $T>>2$,方程 $A{\bf x} = {\bf b}$無解 (參閱 comment 2),但我們可問是否有近似解。為此, 欲求解 ${\bf x}$ 一種常見的手段是採用最小平方法:
If you can’t solve a problem, then there is an easier problem you can solve: find it. -George Polya