最小二乘

人工智能教程 - 数学基础课程1.3 - 高等代数(一)-13-16
y = C+ Dt

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

make it

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

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

Ax = b

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

Minimize: Axb2=e2||Ax-b||^2=||e||^2

=e12+e22+e32=e_1^2+e_2^2+e_3^2
=(C+D1)2+(C+2D2)2+e32=(C+D-1)^2+(C+2D-2)^2+e_3^2

实际上做的是线性回归分析
(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

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

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

[111123][11 112 213 2] =[36 5614   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}

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

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

\therefore Best line: y=23+12ty = \frac{2}{3}+\frac{1}{2}t

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

b = P+ e

[122]=[7/65/313/6] +[1/62/61/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}

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

相关文章:

  • 2021-07-28
  • 2021-06-12
  • 2021-12-22
  • 2021-12-26
  • 2021-08-12
  • 2021-09-25
  • 2021-11-22
猜你喜欢
  • 2021-11-13
  • 2021-11-07
  • 2021-10-04
  • 2021-11-19
  • 2021-11-05
  • 2021-12-20
  • 2021-08-14
相关资源
相似解决方案