Skip to main content

泰勒展开式与 Hessian 矩阵

· 3 min read
PuQing
AI, CVer, Pythoner, Half-stack Developer

一元函数情况

设一元函数 f(x)f(x) 在包含点 x0x_{0} 的开区间 (a,b)(a,b) 内具有 n+1n+1 阶导数,则当 x(a,b)x\in (a,b) 时,有

f(x)=f(x0)+f(x0)(xx0)+f(x0)2!(xx0)2++f(n)(x0)n!(xx0)n+Rn(x)f(x)=f\left(x_{0}\right)+f^{\prime}\left(x_{0}\right)\left(x-x_{0}\right)+\frac{f^{\prime \prime}\left(x_{0}\right)}{2 !}\left(x-x_{0}\right)^{2}+\cdots+\frac{f^{(n)}\left(x_{0}\right)}{n !}\left(x-x_{0}\right)^{n}+R_{n}(x)

其中的余项 (即误差)

Rn(x)=f(n+1)(ξ)(n+1)!(xx0)n+1R_{n}(x)=\frac{f^{(n+1)}(\xi)}{(n+1) !}\left(x-x_{0}\right)^{n+1}

ξ\xix0x_{0}xx 之间,并把该余项称为 nn 阶泰勒展开式的拉格朗日余项,即是 nn 阶泰勒公式又展开了一阶,nn 变为了 n+1n+1

另外在不需要余项精准表达式时,Rn(x)R_{n}(x) 可以记作 o[(xx0)n]o\left[\left(x-x_{0}\right)^{n}\right],这被称为皮亚诺余项。

推广到二元

设二元函数 z=f(x,y)z=f(x,y) 在点 (x0,y0)(x_{0},y_{0}) 的某一领域内连续并具有 n+1n+1 阶的连续偏导数,则有:

f(x,y)=f(x0,y0)+D+12![(xx0)x+(yy0)y]2f(x0,y0)+++1n![(xx0)x+(yy0)y]nf(x0,y0)+1(n+1)![(xx0)x+(yy0)y](n+1)f[x0+θ(xx0),y0+θ(yy0)]\begin{aligned} f(x, y) & =f\left(x_{0}, y_{0}\right)+D \\ & +\frac{1}{2 !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{2} f\left(x_{0}, y_{0}\right)+\cdots+ \\ & +\frac{1}{n !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{n} f\left(x_{0}, y_{0}\right) \\ & +\frac{1}{(n+1) !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{(n+1)} f\left[x_{0}+\theta\left(x-x_{0}\right), y_{0}+\theta\left(y-y_{0}\right)\right] \end{aligned}

其中的 θ(0,1)\theta\in(0,1)

其中的表达式

[(xx0)x+(yy0)y]f(x0,y0)\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right] f\left(x_{0}, y_{0}\right)

表示

(xx0)fx(x0,y0)+(yy0)fy(x0,y0)\left(x-x_{0}\right) f_{x}\left(x_{0}, y_{0}\right)+\left(y-y_{0}\right) f_{y}\left(x_{0}, y_{0}\right)

同样的,

[(xx0)x+(yy0)y]2f(x0,y0)\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{2} f\left(x_{0}, y_{0}\right)

表示

(xx0)2fxx(x0,y0)+2(xx0)(yy0)fxy(x0,y0)+(yy0)2fyy(x0,y0)\left(x-x_{0}\right)^{2} f_{x x}\left(x_{0}, y_{0}\right)+2\left(x-x_{0}\right)\left(y-y_{0}\right) f_{x y}\left(x_{0}, y_{0}\right)+\left(y-y_{0}\right)^{2} f_{y y}\left(x_{0}, y_{0}\right)

普遍的,

[(xx0)x+(yy0)y]mf(x0,y0)\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{m} f\left(x_{0}, y_{0}\right)

我们有

p=0mCmp(xx0)p(yy0)(mp)mfxpy(mp)(x0,y0)\left.\sum_{p=0}^{m} C_{m}^{p}\left(x-x_{0}\right)^{p}\left(y-y_{0}\right)^{(m-p)} \frac{\partial^{m} f}{\partial x^{p} \partial y^{(m-p)}}\right|_{\left(x_{0}, y_{0}\right)}

所以上面的式子可以用更加简单的式子重写:

tip
f(x,y)=k=0n1k![(xx0)x+(yy0)y]kf(x0,y0)+1(n+1)![(xx0)x+(yy0)y](n+1)f[x0+θ(xx0),y0+θ(yy0)],(0<θ<1)\begin{aligned} f(x, y) & =\sum_{k=0}^{n} \frac{1}{k !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{k} f\left(x_{0}, y_{0}\right) \\ & +\frac{1}{(n+1) !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{(n+1)} f\left[x_{0}+\theta\left(x-x_{0}\right), y_{0}+\theta\left(y-y_{0}\right)\right],(0<\theta<1) \end{aligned}

同样的,余项 Rn(x,y)R_{n}(x,y) 是上面形式时是拉格朗日余项,如果是皮亚诺余项,则可以写成:

f(x,y)=k=0n1k![(xx0)x+(yy0)y]kf(x0,y0)+o(ρn)f(x, y)=\sum_{k=0}^{n} \frac{1}{k !}\left[\left(x-x_{0}\right) \frac{\partial}{\partial x}+\left(y-y_{0}\right) \frac{\partial}{\partial y}\right]^{k} f\left(x_{0}, y_{0}\right)+o\left(\rho^{n}\right)

推广到多元

当变量是一个多维向量 XX,以及在点 X0X_{0} 的邻域内有连续二阶偏导数,可以写出其在点 X0X_{0} 处的二阶泰勒展开式

f(X)=f(X0)+(XX0)Tf(X0)+12!(XX0)T2f(X0)(XX0)+o(XX02)f(\mathbf{X})=f\left(\mathbf{X}_{0}\right)+\left(\mathbf{X}-\mathbf{X}_{0}\right)^{T} \nabla f\left(\mathbf{X}_{0}\right)+\frac{1}{2 !}\left(\mathbf{X}-\mathbf{X}_{0}\right)^{T} \nabla^{2} f\left(\mathbf{X}_{0}\right)\left(\mathbf{X}-\mathbf{X}_{0}\right)+o\left(\left\|\mathbf{X}-\mathbf{X}_{0}\right\|^{2}\right)

其中,o(XX02)o\left(\left\|\mathbf{X}-\mathbf{X}_{0}\right\|^{2}\right) 是高阶无穷小的皮亚诺余项。而 2f(X0)\nabla^{2} f\left(\mathbf{X}_{0}\right) 则是函数 f(X)f(X)X0X_{0} 处的 Hessian\mathrm{Hessian} 矩阵。见 雅可比(Jacobi)矩阵、海塞(Hessan)矩阵