人工智能教程 - 数学基础课程1.3 - 高等代数(一)-13-16 最小二乘

最小二乘

在这里插入图片描述
y = C+ Dt

最佳总误差最小(optimal = overall error as small as I can)

make it

{ C + D = 1 C + 2 D = 2 C + 3 D = 2 \left\{\begin{matrix} C+ D = 1 \\ C+ 2D = 2 \\ C+ 3D = 2 \end{matrix}\right. C+D=1C+2D=2C+3D=2

联立无解,但可以有最优解(they don’t have a solution.but they 've got a best solution)

Ax = b

[ 1 1 1 2 1 3 ] [ C D ]   = [ 1 2 3 ] \begin{bmatrix} 1&1 \\ 1&2 \\ 1&3 \\ \end{bmatrix}\begin{bmatrix} C \\ D \\ \end{bmatrix} \ =\begin{bmatrix} 1 \\ 2 \\ 3 \\ \end{bmatrix} 111123[CD] =123

Minimize: ∣ ∣ A x − b ∣ ∣ 2 = ∣ ∣ e ∣ ∣ 2 ||Ax-b||^2=||e||^2 Axb2=e2
= e 1 2 + e 2 2 + e 3 2 =e_1^2+e_2^2+e_3^2 =e12+e22+e32
= ( C + D − 1 ) 2 + ( C + 2 D − 2 ) 2 + e 3 2 =(C+D-1)^2+(C+2D-2)^2+e_3^2 =(C+D1)2+(C+2D2)2+e32

实际上做的是线性回归分析
(It’s going to do regression here,linear regression)

最小二乘(Least squares)应用最为广泛,但是有点太容易受到离群量(outliners)的影响

(because it’s a little overcomplensates for outliners)

Find x ^ = [ C ^ D ^ ] , P \widehat x = \begin{bmatrix} \widehat C\\ \widehat D \end{bmatrix}, P x =[C D ],P

“^” 为最优的估计(they 're the estimated the best line, not the perfect line)

{ A T . A . x ^ = A T . b P = A x ^ \left\{\begin{matrix} A^T.A.\widehat x=A^T.b \\ P=A\widehat x\end{matrix}\right. {AT.A.x =AT.bP=Ax

[ 1 1 1 1 2 3 ] [ 1 1 ∣   1 1 2 ∣   2 1 3 ∣   2 ]   = [ 3 6 ∣   5 6 14    ∣   11 ] \begin{bmatrix} 1&1&1 \\ 1&2&3 \\ \end{bmatrix}\begin{bmatrix} 1&1&| \ 1 \\ 1&2&| \ 2 \\ 1&3&|\ 2 \\ \end{bmatrix} \ =\begin{bmatrix} 3&6&| \ 5 \\ 6&14& \ \ | \ 11 \\ \end{bmatrix} [111213]111123 1 2 2 =[36614 5   11]

正规方程组(normal equation): { 3 C + 6 D = 5 6 C + 14 D = 11 \left\{\begin{matrix} 3C+ 6D = 5 \\ 6C+ 14D = 11 \end{matrix}\right. {3C+6D=56C+14D=11

{ C = 2 3 D = 1 2 \left\{\begin{matrix} C=\frac{2}{3} \\ D=\frac{1}{2} \end{matrix}\right. {C=32D=21

∴ \therefore Best line: y = 2 3 + 1 2 t y = \frac{2}{3}+\frac{1}{2}t y=32+21t

{ e 1 = − 1 / 6 e 2 = + 2 / 6 e 3 = − 1 / 6 \left\{\begin{matrix} e_1=-1/6 \\ e_2 = +2/6 \\ e_3 = -1/6 \end{matrix}\right. e1=1/6e2=+2/6e3=1/6

b = P+ e

[ 1 2 2 ] = [ 7 / 6 5 / 3 13 / 6 ]   + [ − 1 / 6 2 / 6 − 1 / 6 ] \begin{bmatrix} 1 \\ 2\\ 2\\ \end{bmatrix}=\begin{bmatrix} 7/6 \\ 5/3\\ 13/6\\ \end{bmatrix} \ +\begin{bmatrix} -1/6 \\ 2/6\\ -1/6\\ \end{bmatrix} 122=7/65/313/6 +1/62/61/6

最小二乘:最典型的应用就是拟合最优直线
(the special but most important example of fitting by straight line)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值