最小二乘法

image-20210418193326202

G(z)=y(k)u(k)=b1z1+b2z2++bnzn1+a1z1+a2z2++anznG(z)=\frac{y(k)}{u(k)}=\frac{b_1z^{-1}+b_2z^{-2}+\dots+b_nz^{-n}}{1+a_1z^{-1}+a_2z^{-2}+\dots+a_nz^{-n}}

y(k)=i=1naiy(ki)+i=1nbiu(ki)y(k)=-\sum_{i=1}^{n}a_iy(k-i)+\sum_{i=1}^{n}b_iu(k-i)

加上噪声得

z(k)=i=1naiy(ki)+i=1nbiu(ki)+v(k)z(k)=-\sum_{i=1}^{n}a_i y(k-i)+\sum_{i=1}^{n}b_iu(k-i)+v(k)

θ=[a1 a2  an b1 b2  bn]T\theta=[a_1 \ a_2 \ \dots \ a_n \ b_1 \ b_2 \ \dots \ b_n]^T

h(k)=[y(k1) y(k2)  y(kn) u(k1) u(k2) u(kn)]h(k)=[-y(k-1) \ -y(k-2) \ \dots \ -y(k-n) \ u(k-1) \ u(k-2) \ \dots u(k-n)]

可得

z(k)=h(k)θ+v(k)z(k)=h(k)\theta+v(k)

K=123mK=1,2,3,m

Zm=Hmθ+VmZ_m=H_m\theta+V_m

令实际值和估计值只差平方和最小

J(θ^)=(ZmHmθ^)T(ZmHmθ^)J(\hat{\theta})=(Z_m-H_m\hat{\theta})^T(Z_m-H_m\hat{\theta})

Jθθ=θ^=2HmT(ZmHmθ^)=0\frac{\partial{J}}{\partial{\theta}}|_{\theta=\hat{\theta}}=-2H_m^T(Z_m-H_m\hat{\theta})=0

HmTHmθ^=HmTZmH_m^TH_m\hat{\theta}=H_m^TZ_m

所以

θ^=(HmTHm)1HmTZm\hat{\theta}=(H_m^TH_m)^{-1}H_m^TZ_m