式子(16.3)和(16.4)的推导
由式子(16.2)和
Σ
=
cov
(
x
,
x
)
=
E
[
(
x
−
μ
)
(
x
−
μ
)
T
]
\Sigma=\operatorname{cov}(\boldsymbol{x}, \boldsymbol{x})=E\left[(\boldsymbol{x}-\boldsymbol{\mu})(\boldsymbol{x}-\boldsymbol{\mu})^{\mathrm{T}}\right]
Σ=cov(x,x)=E[(x−μ)(x−μ)T]得
var
(
y
i
)
=
E
[
(
y
i
−
E
(
y
i
)
)
(
y
i
−
E
(
y
i
)
)
T
]
=
E
[
(
α
i
T
x
−
α
i
T
μ
)
(
α
i
T
x
−
α
i
T
μ
)
T
]
=
E
[
(
α
i
T
(
x
−
μ
)
)
(
α
i
T
(
x
−
μ
)
)
T
]
=
E
[
α
i
T
(
x
−
μ
)
(
x
−
μ
)
T
α
i
]
=
α
i
T
E
[
(
x
−
μ
)
(
x
−
μ
)
T
]
α
i
=
α
i
T
Σ
α
i
\begin{aligned} \operatorname{var}\left(y_{i}\right) &=E\left[\left(y_{i}-E\left(y_{i}\right)\right)\left(y_{i}-E\left(y_{i}\right)\right)^{T}\right] \\ &=E\left[\left(\alpha_{i}^{T} x-\alpha_{i}^{T} \mu\right)\left(\alpha_{i}^{T} x-\alpha_{i}^{T} \mu\right)^{T}\right] \\ &=E\left[\left(\alpha_{i}^{T}(x-\mu)\right)\left(\alpha_{i}^{T}(x-\mu)\right)^{T}\right] \\ &=E\left[\alpha_{i}^{T}(x-\mu)(x-\mu)^{T} \alpha_{i}\right] \\ &=\alpha_{i}^{T} E\left[(x-\mu)(x-\mu)^{T}\right] \alpha_{i} \\ &=\alpha_{i}^{T} \Sigma \alpha_{i} \end{aligned}
var(yi)=E[(yi−E(yi))(yi−E(yi))T]=E[(αiTx−αiTμ)(αiTx−αiTμ)T]=E[(αiT(x−μ))(αiT(x−μ))T]=E[αiT(x−μ)(x−μ)Tαi]=αiTE[(x−μ)(x−μ)T]αi=αiTΣαi
式子(16.3)得证,同理可以证明式子(16.4)
cov
(
y
i
,
y
j
)
=
E
[
(
y
i
−
E
(
y
i
)
)
(
y
j
−
E
(
y
j
)
)
T
]
=
E
[
(
α
i
T
x
−
α
i
T
μ
)
(
α
j
T
x
−
α
j
T
μ
)
T
]
=
E
[
(
α
i
T
(
x
−
μ
)
)
(
α
j
T
(
x
−
μ
)
)
T
]
=
E
[
α
i
T
(
x
−
μ
)
(
x
−
μ
)
T
α
j
]
=
α
i
T
E
[
(
x
−
μ
)
(
x
−
μ
)
T
]
α
j
=
α
i
T
Σ
α
j
\begin{aligned} \operatorname{cov}(y_{i},y_{j}) &=E\left[\left(y_{i}-E\left(y_{i}\right)\right)\left(y_{j}-E\left(y_{j}\right)\right)^{T}\right] \\ &=E\left[\left(\alpha_{i}^{T} x-\alpha_{i}^{T} \mu\right)\left(\alpha_{j}^{T} x-\alpha_{j}^{T} \mu\right)^{T}\right] \\ &=E\left[\left(\alpha_{i}^{T}(x-\mu)\right)\left(\alpha_{j}^{T}(x-\mu)\right)^{T}\right] \\ &=E\left[\alpha_{i}^{T}(x-\mu)(x-\mu)^{T} \alpha_{j}\right] \\ &=\alpha_{i}^{T} E\left[(x-\mu)(x-\mu)^{T}\right] \alpha_{j} \\ &=\alpha_{i}^{T} \Sigma \alpha_{j} \end{aligned}
cov(yi,yj)=E[(yi−E(yi))(yj−E(yj))T]=E[(αiTx−αiTμ)(αjTx−αjTμ)T]=E[(αiT(x−μ))(αjT(x−μ))T]=E[αiT(x−μ)(x−μ)Tαj]=αiTE[(x−μ)(x−μ)T]αj=αiTΣαj
式子(16.7)最优化问题推导补充
首先要知道矩阵求导的几个简单法则:
∂
(
x
T
a
)
∂
x
=
∂
(
a
T
x
)
∂
x
=
a
∂
(
x
T
x
)
∂
x
=
2
x
∂
(
x
T
A
x
)
∂
x
=
A
x
+
A
T
x
\frac{\partial\left(\boldsymbol{x}^{T} \boldsymbol{a}\right)}{\partial \boldsymbol{x}}=\frac{\partial\left(\boldsymbol{a}^{T} \boldsymbol{x}\right)}{\partial \boldsymbol{x}}=\boldsymbol{a}\\ \frac{\partial\left(\boldsymbol{x^{T}} \boldsymbol{x}\right)}{\partial \boldsymbol{x}}=2 \boldsymbol{x}\\ \frac{\partial\left(\boldsymbol{x}^{T} \boldsymbol{A} \boldsymbol{x}\right)}{\partial \boldsymbol{x}}=\boldsymbol{A} \boldsymbol{x}+\mathbf{A}^{T} \boldsymbol{x}
∂x∂(xTa)=∂x∂(aTx)=a∂x∂(xTx)=2x∂x∂(xTAx)=Ax+ATx
所以拉格朗日函数求导并令其得0为:
原
式
=
∂
α
1
T
Σ
α
1
∂
α
1
−
λ
∂
α
1
α
∂
α
1
=
Σ
α
1
+
Σ
T
α
1
−
2
λ
α
1
=
2
Σ
α
1
−
2
λ
α
1
=
0
\begin{aligned} 原式&=\frac{\partial{\alpha_1^T\Sigma\alpha_1}}{\partial{\alpha_1}}-\frac{\lambda\partial{\alpha_1\alpha}}{\partial{\alpha_1}}\\ &=\Sigma\alpha_1+\Sigma^T\alpha_1-2\lambda\alpha_1\\ &=2\Sigma\alpha_1-2\lambda\alpha_1\\ &=0 \end{aligned}
原式=∂α1∂α1TΣα1−∂α1λ∂α1α=Σα1+ΣTα1−2λα1=2Σα1−2λα1=0
【例16.1】一些计算的补充
首先求相关矩阵R的特征值和特征向量,这边就直接使用python来求解,毕竟所给的数据不太好手动求
import numpy as np
mat = np.array([[1, 0.44, 0.29, 0.33],
[0.44, 1, 0.35, 0.32],
[0.29, 0.35, 1, 0.60],
[0.33, 0.32, 0.60, 1]])
eigenvalue, featurevector = np.linalg.eig(mat)
print("特征值:", np.around(eigenvalue, decimals=2))
print("特征向量:", np.around(featurevector, decimals=3))
可以看到,特征值和书上一样的,但是特征向量不一样,不过这没影响,毕竟特征向量本来就不唯一。
y 1 的 方 差 贡 献 率 为 λ 1 ∑ i = 1 λ i = 2.17 4 = 0.543 y_1的方差贡献率为\frac{\lambda_1}{\sum_{i=1}\lambda_i}=\frac{2.17}{4}=0.543 y1的方差贡献率为∑i=1λiλ1=42.17=0.543,同理 y 2 的 方 差 贡 献 率 为 λ 2 ∑ i = 2 λ i = 0.87 4 = 0.218 y_2的方差贡献率为\frac{\lambda_2}{\sum_{i=2}\lambda_i}=\frac{0.87}{4}=0.218 y2的方差贡献率为∑i=2λiλ2=40.87=0.218
因子负荷量的计算公式为: ρ ( y k , x i ) = λ k e i k \rho(y_k,x_i)=\sqrt{\lambda_k}e_{ik} ρ(yk,xi)=λkeik
![IMG_0429](https://tva1.sinaimg.cn/large/e6c9d24egy1h1v3uutexvj21eh0u0go6.jpg)
![image-20220503123159268](https://tva1.sinaimg.cn/large/e6c9d24egy1h1v3vz06zmj214g0fcta8.jpg)
![IMG_0430](https://tva1.sinaimg.cn/large/e6c9d24egy1h1v3zgakauj21ad0u076r.jpg)