1.数据集定义
定义数据样本
D
=
{
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
.
.
.
,
(
x
N
,
y
N
)
}
,
其
中
x
i
∈
R
p
,
y
i
∈
R
,
其
中
x
i
=
1
,
2
,
.
.
.
,
N
D=\{(x_1,y_1),(x_2,y_2),...,(x_N,y_N)\},其中x_i\in \mathbb{R}^p,y_i\in \mathbb{R},其中x_i = 1,2,...,N
D={(x1,y1),(x2,y2),...,(xN,yN)},其中xi∈Rp,yi∈R,其中xi=1,2,...,N
X
=
(
x
1
,
x
2
,
.
.
.
,
x
N
)
T
=
(
x
1
T
x
2
T
⋮
x
N
T
)
=
(
x
11
x
12
.
.
.
x
1
p
x
21
x
22
.
.
.
x
2
p
⋮
⋮
⋮
⋮
x
N
1
x
N
2
.
.
.
x
N
p
)
N
×
P
(1)
X=(x_1,x_2,...,x_N)^T= \begin{pmatrix} x_1^T\\x_2^T\\\vdots\\x_N^T \end{pmatrix}=\begin{pmatrix} x_{11}&x_{12}&...&x_{1p}\\x_{21}&x_{22}&...&x_{2p}\\\vdots&\vdots&\vdots&\vdots\\x_{N1}&x_{N2}&...&x_{Np}\end{pmatrix}_{N \times P} \tag 1
X=(x1,x2,...,xN)T=⎝⎜⎜⎜⎛x1Tx2T⋮xNT⎠⎟⎟⎟⎞=⎝⎜⎜⎜⎛x11x21⋮xN1x12x22⋮xN2......⋮...x1px2p⋮xNp⎠⎟⎟⎟⎞N×P(1)
2.样本均值 X ˉ \bar{X} Xˉ矩阵表示
样
本
均
值
:
X
ˉ
=
1
N
∑
i
=
1
N
x
i
(2)
样本均值:\bar{X}=\frac{1}{N}\sum_{i=1}^{N}x_i \tag{2}
样本均值:Xˉ=N1i=1∑Nxi(2)
样
本
方
差
:
S
=
1
N
∑
i
=
1
N
(
x
i
−
X
ˉ
)
(
x
i
−
X
ˉ
)
T
(3)
样本方差:S=\frac{1}{N}\sum_{i=1}^{N}(x_i-\bar{X})(x_i-\bar{X})^T \tag{3}
样本方差:S=N1i=1∑N(xi−Xˉ)(xi−Xˉ)T(3)
X
ˉ
=
1
N
(
x
1
,
x
2
,
.
.
.
,
x
N
)
(
1
1
⋮
1
)
N
×
1
(4)
\bar{X}=\frac{1}{N}(x_1,x_2,...,x_N) \begin{pmatrix} 1\\1\\\vdots\\1 \end{pmatrix}_{N \times 1} \tag{4}
Xˉ=N1(x1,x2,...,xN)⎝⎜⎜⎜⎛11⋮1⎠⎟⎟⎟⎞N×1(4)
我
们
定
义
:
(
1
1
⋮
1
)
N
×
1
=
1
N
;
列
向
量
(5)
我们定义: \begin{pmatrix} 1\\1\\\vdots\\1 \end{pmatrix}_{N \times 1}=1_N;列向量\tag{5}
我们定义:⎝⎜⎜⎜⎛11⋮1⎠⎟⎟⎟⎞N×1=1N;列向量(5)
X
ˉ
=
1
N
X
T
1
N
(6)
\bar{X}=\frac{1}{N}X^T1_N \tag{6}
Xˉ=N1XT1N(6)
3.样本方差S矩阵表示
样
本
方
差
:
S
=
1
N
∑
i
=
1
N
(
x
i
−
X
ˉ
)
(
x
i
−
X
ˉ
)
T
(7)
样本方差:S=\frac{1}{N}\sum_{i=1}^{N}(x_i-\bar{X})(x_i-\bar{X})^T \tag{7}
样本方差:S=N1i=1∑N(xi−Xˉ)(xi−Xˉ)T(7)
S
=
1
N
(
x
1
−
X
ˉ
)
(
x
2
−
X
ˉ
)
⋯
(
x
i
−
X
ˉ
)
(
x
1
−
X
ˉ
x
2
−
X
ˉ
⋮
x
i
−
X
ˉ
)
(8)
S=\frac{1}{N}(x_1-\bar{X})(x_2-\bar{X})\cdots(x_i-\bar{X}) \begin{pmatrix} x_1-\bar{X}\\x_2-\bar{X}\\\vdots\\x_i-\bar{X} \end{pmatrix} \tag{8}
S=N1(x1−Xˉ)(x2−Xˉ)⋯(xi−Xˉ)⎝⎜⎜⎜⎛x1−Xˉx2−Xˉ⋮xi−Xˉ⎠⎟⎟⎟⎞(8)
S
=
1
N
(
(
x
1
x
2
⋯
x
i
)
−
X
ˉ
⋅
1
N
T
)
(
x
1
−
X
ˉ
x
2
−
X
ˉ
⋮
x
i
−
X
ˉ
)
(9)
S=\frac{1}{N}((x_1x_2\cdots x_i )-\bar{X}\cdot 1_N^T)\begin{pmatrix} x_1-\bar{X}\\x_2-\bar{X}\\\vdots\\x_i-\bar{X} \end{pmatrix} \tag{9}
S=N1((x1x2⋯xi)−Xˉ⋅1NT)⎝⎜⎜⎜⎛x1−Xˉx2−Xˉ⋮xi−Xˉ⎠⎟⎟⎟⎞(9)
S
=
1
N
(
X
T
−
X
ˉ
⋅
1
N
T
)
(
x
1
−
X
ˉ
x
2
−
X
ˉ
⋮
x
i
−
X
ˉ
)
(10)
S=\frac{1}{N}(X^T-\bar{X}\cdot 1_N^T)\begin{pmatrix} x_1-\bar{X}\\x_2-\bar{X}\\\vdots\\x_i-\bar{X} \end{pmatrix} \tag{10}
S=N1(XT−Xˉ⋅1NT)⎝⎜⎜⎜⎛x1−Xˉx2−Xˉ⋮xi−Xˉ⎠⎟⎟⎟⎞(10)
S
=
1
N
(
X
T
−
1
N
X
T
1
N
⋅
1
N
T
)
(
x
1
−
X
ˉ
x
2
−
X
ˉ
⋮
x
i
−
X
ˉ
)
(11)
S=\frac{1}{N}(X^T-\frac{1}{N}X^T1_N\cdot 1_N^T)\begin{pmatrix} x_1-\bar{X}\\x_2-\bar{X}\\\vdots\\x_i-\bar{X} \end{pmatrix} \tag{11}
S=N1(XT−N1XT1N⋅1NT)⎝⎜⎜⎜⎛x1−Xˉx2−Xˉ⋮xi−Xˉ⎠⎟⎟⎟⎞(11)
S
=
1
N
(
X
T
(
I
N
−
1
N
1
N
⋅
1
N
T
)
)
(
x
1
−
X
ˉ
x
2
−
X
ˉ
⋮
x
i
−
X
ˉ
)
(12)
S=\frac{1}{N}(X^T(I_N-\frac{1}{N}1_N\cdot 1_N^T))\begin{pmatrix} x_1-\bar{X}\\x_2-\bar{X}\\\vdots\\x_i-\bar{X} \end{pmatrix} \tag{12}
S=N1(XT(IN−N11N⋅1NT))⎝⎜⎜⎜⎛x1−Xˉx2−Xˉ⋮xi−Xˉ⎠⎟⎟⎟⎞(12)
注
:
I
N
为
单
位
矩
阵
,
中
心
矩
阵
:
H
N
=
I
N
−
1
N
1
N
⋅
1
N
T
;
意
义
:
将
数
据
向
中
心
移
动
注:I_N为单位矩阵,中心矩阵:H_N=I_N-\frac{1}{N}1_N\cdot 1_N^T;意义:将数据向中心移动
注:IN为单位矩阵,中心矩阵:HN=IN−N11N⋅1NT;意义:将数据向中心移动
S
=
1
N
X
T
(
I
N
−
1
N
1
N
⋅
1
N
T
)
(
I
N
−
1
N
1
N
⋅
1
N
T
)
T
X
(13)
S=\frac{1}{N}X^T(I_N-\frac{1}{N}1_N\cdot 1_N^T)(I_N-\frac{1}{N}1_N\cdot 1_N^T)^TX \tag{13}
S=N1XT(IN−N11N⋅1NT)(IN−N11N⋅1NT)TX(13)
S
=
1
N
X
T
H
N
H
N
T
X
(14)
S=\frac{1}{N}X^TH_NH_N^TX \tag{14}
S=N1XTHNHNTX(14)
H
N
中
心
矩
阵
的
性
质
:
H_N中心矩阵的性质:
HN中心矩阵的性质:
H
N
=
I
N
−
1
N
1
N
⋅
1
N
T
;
H
N
T
=
I
N
−
1
N
1
N
⋅
1
N
T
=
H
N
(15)
H_N=I_N-\frac{1}{N}1_N\cdot 1_N^T; H_N^T=I_N-\frac{1}{N}1_N\cdot 1_N^T=H_N\tag{15}
HN=IN−N11N⋅1NT;HNT=IN−N11N⋅1NT=HN(15)
H
N
⋅
H
N
T
=
(
I
N
−
1
N
1
N
⋅
1
N
T
)
(
I
N
−
1
N
1
N
⋅
1
N
T
)
;
(16)
H_N \cdot H_N^T=(I_N-\frac{1}{N}1_N\cdot 1_N^T)(I_N-\frac{1}{N}1_N\cdot 1_N^T); \tag{16}
HN⋅HNT=(IN−N11N⋅1NT)(IN−N11N⋅1NT);(16)
H
N
⋅
H
N
T
=
I
N
−
2
N
1
N
⋅
1
N
T
+
1
N
1
N
⋅
1
N
T
⋅
1
N
⋅
1
N
T
)
;
(17)
H_N \cdot H_N^T=I_N-\frac{2}{N}1_N\cdot 1_N^T+\frac{1}{N}1_N\cdot 1_N^T\cdot1_N\cdot 1_N^T); \tag{17}
HN⋅HNT=IN−N21N⋅1NT+N11N⋅1NT⋅1N⋅1NT);(17)
H
N
⋅
H
N
T
=
I
N
−
2
N
1
N
⋅
1
N
T
+
1
N
2
1
N
⋅
N
⋅
1
N
T
)
=
I
N
−
1
N
1
N
⋅
1
N
T
=
H
N
(18)
H_N \cdot H_N^T=I_N-\frac{2}{N}1_N\cdot 1_N^T+\frac{1}{N^2}1_N\cdot N\cdot 1_N^T)=I_N-\frac{1}{N}1_N\cdot 1_N^T=H_N\tag{18}
HN⋅HNT=IN−N21N⋅1NT+N211N⋅N⋅1NT)=IN−N11N⋅1NT=HN(18)
结
论
:
H
N
=
H
N
T
;
H
N
n
=
H
N
(19)
结论:H_N=H_N^T;H_N^n=H_N \tag{19}
结论:HN=HNT;HNn=HN(19)
4.结论汇总
X
ˉ
=
1
N
X
T
1
N
;
(
1
1
⋮
1
)
N
×
1
=
1
N
(20)
\bar{X}=\frac{1}{N}X^T1_N ; \begin{pmatrix} 1\\1\\\vdots\\1 \end{pmatrix}_{N \times 1}=1_N\tag{20}
Xˉ=N1XT1N;⎝⎜⎜⎜⎛11⋮1⎠⎟⎟⎟⎞N×1=1N(20)
S
=
1
N
X
T
H
N
X
;
H
N
=
I
N
−
1
N
1
N
⋅
1
N
T
;
I
N
表
示
单
位
向
量
(21)
S=\frac{1}{N}X^TH_NX;H_N=I_N-\frac{1}{N}1_N\cdot 1_N^T;I_N表示单位向量 \tag{21}
S=N1XTHNX;HN=IN−N11N⋅1NT;IN表示单位向量(21)