写在前面 介绍函数型奇异谱分析(Functional Singular Spectrum Analysis)
理论基础 对于函数型时间序列y N = ( y 1 , y 2 , … , y N ) ⊤ \boldsymbol y_N = (y_1,y_2,\ldots,y_N)^\top y N = ( y 1 , y 2 , … , y N ) ⊤ ,其中每个函数分量y i : [ 0 , 1 ] → R y_i : [0,1] \to \mathbb R y i : [ 0 , 1 ] → R 属于实的平方可积函数空间,该Hilbert空间H \mathbb H H 具备标准内积形式⟨ x , y ⟩ = ∫ 0 1 x ( s ) y ( s ) d s \left\langle x,y\right\rangle=\int_0^1 x(s)y(s)ds ⟨ x , y ⟩ = ∫ 0 1 x ( s ) y ( s ) d s 。张量外积x ⊗ y : H 1 → H 2 x\otimes y: \mathbb{H}_1\rightarrow \mathbb{H}_2 x ⊗ y : H 1 → H 2 定义为( x ⊗ y ) h : = ⟨ x , h ⟩ y (x\otimes y)h:=\langle x, h \rangle y ( x ⊗ y ) h : = ⟨ x , h ⟩ y ,其中h ∈ H 1 h\in \mathbb{H}_1 h ∈ H 1 。对a = ( a 1 , … , a K ) ∈ R K \boldsymbol{a}=(a_1,\ldots, a_K)\in\mathbb{R}^K a = ( a 1 , … , a K ) ∈ R K ,由算子Z : R K → H L \mathcal{Z}: \mathbb{R}^K \rightarrow \mathbb{H}^L Z : R K → H L 张成的线性空间记为H L × K \mathbb{H}^{L\times K} H L × K
Z a = ( ∑ j = 1 K a j z 1 , j ⋮ ∑ j = 1 K a j z L , j ) , z i , j ∈ H \mathcal{Z}\boldsymbol{a}=
\begin{pmatrix} \sum_{j=1}^K a_j{z}_{1,j}\\ \vdots\\ \sum_{j=1}^K a_j{z}_{L,j} \end{pmatrix},
\ {z}_{i,j}\in\mathbb{H}
Z a = ⎝ ⎜ ⎜ ⎜ ⎛ ∑ j = 1 K a j z 1 , j ⋮ ∑ j = 1 K a j z L , j ⎠ ⎟ ⎟ ⎟ ⎞ , z i , j ∈ H
算子Z ^ = [ z ^ i , j ] ∈ H L × K \hat{\mathcal Z}=[\hat{z}_{i,j}]\in\mathbb{H}^{L\times K} Z ^ = [ z ^ i , j ] ∈ H L × K 满足
∥ z ^ i , j − g s ∥ = 0 , ∃ g s ∈ H , s = i + j \Vert\hat z_{i,j}-g_s\Vert=0,\exists g_s\in\mathbb{H},s=i+j
∥ z ^ i , j − g s ∥ = 0 , ∃ g s ∈ H , s = i + j
则称为Hankel算子,记为H H L × K \mathbb{H}_H^{L\times K} H H L × K 。两个算子的Frobenius内积定义如下
⟨ Z 1 , Z 2 ⟩ F : = ∑ i = 1 L ∑ j = 1 K ⟨ z i , j ( 1 ) , z i , j ( 2 ) ⟩ . \langle\mathcal{Z}_1,\mathcal{Z}_2\rangle_\mathcal{F}:=\sum_{i=1}^L\sum_{j=1}^K \langle{z}_{i,j}^{(1)},{z}_{i,j}^{(2)}\rangle.
⟨ Z 1 , Z 2 ⟩ F : = i = 1 ∑ L j = 1 ∑ K ⟨ z i , j ( 1 ) , z i , j ( 2 ) ⟩ .
给定Hilbert空间中的元素x i , i = 1 , … , N x_i,\ i=1,\ldots, N x i , i = 1 , … , N ,均值点x ˉ = 1 N ∑ i = 1 N x i \bar{x}=\frac{1}{N}\sum_{i=1}^N x_i x ˉ = N 1 ∑ i = 1 N x i 满足
∑ i = 1 N ∥ x i − x ˉ ∥ 2 ≤ ∑ i = 1 N ∥ x i − y ∥ 2 , ∀ y ∈ H \sum_{i=1}^N\Vert x_i-\bar{x}\Vert^2 \leq \sum_{i=1}^N\Vert x_i-y \Vert^2, \quad\forall y\in \mathbb{H}
i = 1 ∑ N ∥ x i − x ˉ ∥ 2 ≤ i = 1 ∑ N ∥ x i − y ∥ 2 , ∀ y ∈ H
函数型SSA算法 多元函数型向量基合记为
x j ( s ) : = ( y j ( s ) , y j + 1 ( s ) , … , y j + L − 1 ( s ) ) ⊤ ∀ j {\boldsymbol x}_j(s):= \begin{pmatrix} y_j(s), y_{j+1}(s), \ldots, y_{j+L-1}(s)\end{pmatrix}^\top \forall j
x j ( s ) : = ( y j ( s ) , y j + 1 ( s ) , … , y j + L − 1 ( s ) ) ⊤ ∀ j
显然,嵌入维度为L L L 。与传统的SSA算法一样,FSSA算法分为如下四步:
嵌入Embedding 对于a = ( a 1 , … , a K ) ⊤ ∈ R K {\boldsymbol a}=\left(a_1,\ldots, a_K\right)^\top \in\mathbb{R}^K a = ( a 1 , … , a K ) ⊤ ∈ R K ,定义算子X : R K → H L \mathcal{X}:\mathbb{R}^K \rightarrow \mathbb{H}^L X : R K → H L
X a : = ∑ j = 1 K a j x j = ( ∑ j = 1 K a j y j ∑ j = 1 K a j y j + 1 ⋮ ∑ j = 1 K a j y j + L − 1 ) \mathcal{X}{\boldsymbol a}:=\sum_{j=1}^K a_j{\boldsymbol x}_j=
\begin{pmatrix} \sum_{j=1}^K a_jy_j\\ \sum_{j=1}^K a_j y_{j+1}\\ \vdots\\ \sum_{j=1}^K a_j y_{j+L-1} \end{pmatrix}
X a : = j = 1 ∑ K a j x j = ⎝ ⎜ ⎜ ⎜ ⎜ ⎜ ⎛ ∑ j = 1 K a j y j ∑ j = 1 K a j y j + 1 ⋮ ∑ j = 1 K a j y j + L − 1 ⎠ ⎟ ⎟ ⎟ ⎟ ⎟ ⎞
称邻接算子X = T y N \mathcal{X}=\mathcal{T}\textbf{y}_N X = T y N ,即等价于序列的Hankel化。此外X a \mathcal{X} \boldsymbol{a} X a 等于X ( s ) a {\bf X}(s)\boldsymbol{a} X ( s ) a ,其中Hankel 矩阵X ( s ) = [ x 1 ( s ) , … , x K ( s ) ] {\bf X}(s)=\begin{bmatrix} {\boldsymbol x}_1(s), \ldots, {\boldsymbol x}_K(s) \end{bmatrix} X ( s ) = [ x 1 ( s ) , … , x K ( s ) ]
对z = ( z 1 , … , z L ) ⊤ ∈ H L {\boldsymbol z}=\left(z_1,\ldots, z_L\right)^\top\in\mathbb{H}^L z = ( z 1 , … , z L ) ⊤ ∈ H L ,若线性算子 X \mathcal{X} X 有界,则算子X ∗ \mathcal{X}^* X ∗
X ∗ z = ( ∑ i = 1 L ⟨ y i , z i ⟩ ∑ i = 1 L ⟨ y i + 1 , z i ⟩ ⋮ ∑ i = 1 L ⟨ y i + K − 1 , z i ⟩ ) \mathcal{X}^*{\boldsymbol z}=
\begin{pmatrix} \sum_{i=1}^L \langle y_i, z_i\rangle\\ \sum_{i=1}^L \langle y_{i+1}, z_i\rangle\\ \vdots\\ \sum_{i=1}^L \langle y_{i+K-1}, z_i\rangle \end{pmatrix}
X ∗ z = ⎝ ⎜ ⎜ ⎜ ⎜ ⎛ ∑ i = 1 L ⟨ y i , z i ⟩ ∑ i = 1 L ⟨ y i + 1 , z i ⟩ ⋮ ∑ i = 1 L ⟨ y i + K − 1 , z i ⟩ ⎠ ⎟ ⎟ ⎟ ⎟ ⎞
是算子 X \mathcal{X} X 的伴随算子。
分解Decomposition 定义算子S : = X X ∗ : H L → H L \mathcal S:=\mathcal{X}\mathcal{X}^*: \mathbb{H}^L\rightarrow \mathbb{H}^L S : = X X ∗ : H L → H L ,则对给定的z ∈ H L {\boldsymbol z}\in \mathbb{H}^{L} z ∈ H L
S z = ∑ j = 1 K ∑ i = 1 L ⟨ y i + j − 1 , z i ⟩ x j = ∑ j = 1 K ⟨ x j , z ⟩ H L x j = ∑ j = 1 K ( x j ⊗ x j ) z \begin{aligned}
\mathcal{S}{\boldsymbol z}
&=\sum_{j=1}^K\sum_{i=1}^L \langle y_{i+j-1} , z_i \rangle {\boldsymbol x}_j\\
&=\sum_{j=1}^K \langle {\boldsymbol x}_j , {\boldsymbol z} \rangle_{\mathbb{H}^L} {\boldsymbol x}_j\\
&=\sum_{j=1}^K ({\boldsymbol x}_j \otimes {\boldsymbol x}_j) {\boldsymbol z}
\end{aligned}
S z = j = 1 ∑ K i = 1 ∑ L ⟨ y i + j − 1 , z i ⟩ x j = j = 1 ∑ K ⟨ x j , z ⟩ H L x j = j = 1 ∑ K ( x j ⊗ x j ) z
从矩阵角度考虑,S \boldsymbol{\mathcal{S}} S 可分解为作用在元素的运算
S i , j = ∑ l = 1 K y i + l − 1 ⊗ y j + l − 1 : H → H \mathcal{S}_{i,j}=\sum_{l=1}^K y_{i+l-1}\otimes y_{j+l-1}:\mathbb{H}\rightarrow \mathbb{H}
S i , j = l = 1 ∑ K y i + l − 1 ⊗ y j + l − 1 : H → H
外积可用积分表示。∀ s , u ∈ [ 0 , 1 ] \forall s,u\in[0,1] ∀ s , u ∈ [ 0 , 1 ] ,对应的核分量为
c i , j ( s , u ) : = ∑ k = 1 K y i + k − 1 ( s ) y j + k − 1 ( u ) {c}_{i,j}(s,u):=\sum_{k=1}^K y_{i+k-1}(s)y_{j+k-1}(u)
c i , j ( s , u ) : = k = 1 ∑ K y i + k − 1 ( s ) y j + k − 1 ( u )
由分量组成的核矩阵C ( s , u ) = X ( s ) X ( u ) ⊤ {\bf C}(s,u)={\bf X}(s){\bf X}(u)^\top C ( s , u ) = X ( s ) X ( u ) ⊤ 可整体刻画算子S \mathcal{S} S
S z ( u ) = ∫ 0 1 C ( s , u ) z ( s ) d s = ( ∑ i = 1 L ∫ 0 1 c i , 1 ( s , u ) z i ( s ) d s ⋮ ∑ i = 1 L ∫ 0 1 c i , L ( s , u ) z i ( s ) d s ) \begin{aligned}
\mathcal S \boldsymbol {z}(u)&= \int_0^1 {\bf C}(s,u) \boldsymbol {z}(s)ds \\
&=\left(\begin{matrix} \sum_{i=1}^L\int_0^1 c_{i,1}(s,u) z_i(s) ds\\ \vdots \\ \sum_{i=1}^L\int_0^1 c_{i,L}(s,u) z_i(s) ds \end{matrix}\right)
\end{aligned}
S z ( u ) = ∫ 0 1 C ( s , u ) z ( s ) d s = ⎝ ⎜ ⎜ ⎛ ∑ i = 1 L ∫ 0 1 c i , 1 ( s , u ) z i ( s ) d s ⋮ ∑ i = 1 L ∫ 0 1 c i , L ( s , u ) z i ( s ) d s ⎠ ⎟ ⎟ ⎞
这个算子具有非常好的性质:
因此可做类似特征值分解的正交基表示,即存在{ ψ i , i ∈ N } \left\lbrace \boldsymbol{\psi}_i, \ i\in \mathbb{N}\right\rbrace { ψ i , i ∈ N } 满足
S ψ i = λ i ψ i \mathcal{S} \boldsymbol{\psi}_i=\lambda_i \boldsymbol{\psi}_i
S ψ i = λ i ψ i
当i ⟶ ∞ i \longrightarrow \infty i ⟶ ∞ 时,λ i ⟶ 0 \lambda_i \longrightarrow 0 λ i ⟶ 0 。根据谱定理,有
S = ∑ i = 1 ∞ λ i ψ i ⊗ ψ i \mathcal{S} =\sum_{i=1}^\infty \lambda_i \boldsymbol{\psi}_i\otimes \boldsymbol{\psi}_i
S = i = 1 ∑ ∞ λ i ψ i ⊗ ψ i
由于核的连续性,C ( s , u ) \textbf{C}(s,u) C ( s , u ) 具有类似奇异值分解的展开表达式
C ( s , u ) = ∑ i = 1 ∞ λ i ψ i ( s ) ψ i ⊤ ( u ) . \textbf{C}(s,u)=\sum_{i=1}^{\infty} \lambda_i \boldsymbol{\psi}_i (s)\boldsymbol{\psi}_i^\top (u).
C ( s , u ) = i = 1 ∑ ∞ λ i ψ i ( s ) ψ i ⊤ ( u ) .
对任意正数i i i ,定义元算子
X i a : = ∑ j = 1 K a j ( ψ i ⊗ ψ i ) x j = ( ψ i ⊗ ψ i ) ∑ j = 1 K a j x j \mathcal{X}_i \boldsymbol{a}:=\sum_{j=1}^K a_j (\boldsymbol{\psi}_i\otimes \boldsymbol{\psi}_i){\boldsymbol x}_j= (\boldsymbol{\psi}_i\otimes \boldsymbol{\psi}_i)\sum_{j=1}^K a_j{\boldsymbol x}_j
X i a : = j = 1 ∑ K a j ( ψ i ⊗ ψ i ) x j = ( ψ i ⊗ ψ i ) j = 1 ∑ K a j x j
上式的矩阵形式为X i ( s ) a {\bf X}_i(s)\boldsymbol{a} X i ( s ) a ,其中X i ( s ) {\bf X}_i(s) X i ( s ) 可视为矩阵X ( s ) {\bf X}(s) X ( s ) 在ψ i ( s ) \boldsymbol{\psi_i}(s) ψ i ( s ) 张成空间的表示。
X i ( s ) : = [ ⟨ ψ i , x 1 ⟩ H L ψ i ( s ) , … , ⟨ ψ i , x K ⟩ H L ψ i ( s ) ] = [ ( ψ i ⊗ ψ i ) x 1 ( s ) , … , ( ψ i ⊗ ψ i ) x K ( s ) ] \begin{aligned}
{\bf X}_i(s)&:=
\begin{bmatrix} \langle\boldsymbol{\psi}_i, {\boldsymbol x}_1\rangle_{\mathbb{H}^L} \boldsymbol{\psi}_i(s), \ldots, \langle\boldsymbol{\psi}_i, {\boldsymbol x}_K\rangle_{\mathbb{H}^L} \boldsymbol{\psi}_i(s) \end{bmatrix}\\
&=\begin{bmatrix} (\boldsymbol{\psi}_i\otimes \boldsymbol{\psi}_i){\boldsymbol x}_1(s), \ldots, (\boldsymbol{\psi}_i\otimes \boldsymbol{\psi}_i){\boldsymbol x}_K(s) \end{bmatrix}
\end{aligned}
X i ( s ) : = [ ⟨ ψ i , x 1 ⟩ H L ψ i ( s ) , … , ⟨ ψ i , x K ⟩ H L ψ i ( s ) ] = [ ( ψ i ⊗ ψ i ) x 1 ( s ) , … , ( ψ i ⊗ ψ i ) x K ( s ) ]
回到元运算X i \mathcal{X}_i X i ,具备以下性质:
计算
S † : = X ∗ X = [ ∑ i ⟨ y i , y i ⟩ ⋯ ∑ i ⟨ y i , y i + K − 1 ⟩ ⋮ ⋱ ⋮ ∑ i ⟨ y i + K − 1 , y i ⟩ ⋯ ∑ i ⟨ y i + K − 1 , y i + K − 1 ⟩ ] \begin{aligned}
&\boldsymbol{\mathcal{S}}^{\dagger}:=\mathcal{X}^*\mathcal{X}\\
&=\left[\begin{matrix}
\sum_{i}\langle y_i, y_{i}\rangle & \cdots & \sum_{i}\langle y_i, y_{i+K-1}\rangle \\
\vdots & \ddots &\vdots \\
\sum_{i}\langle y_{i+K-1}, y_{i}\rangle & \cdots & \sum_{i}\langle y_{i+K-1}, y_{i+K-1}\rangle\\
\end{matrix}\right]
\end{aligned}
S † : = X ∗ X = ⎣ ⎢ ⎢ ⎡ ∑ i ⟨ y i , y i ⟩ ⋮ ∑ i ⟨ y i + K − 1 , y i ⟩ ⋯ ⋱ ⋯ ∑ i ⟨ y i , y i + K − 1 ⟩ ⋮ ∑ i ⟨ y i + K − 1 , y i + K − 1 ⟩ ⎦ ⎥ ⎥ ⎤
则邻接算子X \mathcal{X} X 的SVD分解
X = ∑ i = 1 ∞ λ i v i ⊗ ψ i , \mathcal{X} = \sum_{i=1}^\infty \sqrt{\lambda_i}\textbf{v}_i\otimes \boldsymbol{\psi}_i ,
X = i = 1 ∑ ∞ λ i v i ⊗ ψ i ,
其中右奇异向量为v i = ( ⟨ ψ i , x 1 ⟩ H L λ i , … , ⟨ ψ i , x K ⟩ H L λ i ) ⊤ \textbf{v}_i=\begin{pmatrix} \frac{\langle\boldsymbol{\psi}_i, {\boldsymbol x}_1\rangle_{\mathbb{H}^L}}{\sqrt{\lambda_i}} , \ldots,\frac{ \langle\boldsymbol{\psi}_i, {\boldsymbol x}_K\rangle_{\mathbb{H}^L}}{\sqrt{\lambda_i}} \end{pmatrix}^\top v i = ( λ i ⟨ ψ i , x 1 ⟩ H L , … , λ i ⟨ ψ i , x K ⟩ H L ) ⊤ 。对任意的a ∈ R K \boldsymbol{a}\in\mathbb{R}^K a ∈ R K ,有
X a = ∑ i = 1 ∞ λ i ⟨ v i , a ⟩ R K ψ i \mathcal{X}\boldsymbol{a} = \sum_{i=1}^\infty \sqrt{\lambda_i} \langle \textbf{v}_i, \boldsymbol{a}\rangle_{\mathbb{R}^K} \boldsymbol{\psi}_i
X a = i = 1 ∑ ∞ λ i ⟨ v i , a ⟩ R K ψ i
S † \boldsymbol{\mathcal{S}}^\dagger S † 的特征值{ λ i } i = 1 ∞ \{\lambda_i\}_{i=1}^\infty { λ i } i = 1 ∞ 降序排列
X v i = λ i ψ i \mathcal{X}\boldsymbol{v}_i = \sqrt{\lambda_i} \boldsymbol{\psi}_i X v i = λ i ψ i
奇异值、左右奇异函数( λ i , ψ i , v i ) (\sqrt{\lambda_i},\boldsymbol{\psi}_i,\boldsymbol{v}_i) ( λ i , ψ i , v i ) 构成奇异三元组
分组Grouping 与传统奇异谱分析一致,将元运算X i \mathcal{X}_i X i 划分若干个集合,得到
X = X I 1 + X I 2 + ⋯ + X I m . \mathcal{X}=\mathcal{X}_{I_1}+\mathcal{X}_{I_2}+\cdots+\mathcal{X}_{I_m}.
X = X I 1 + X I 2 + ⋯ + X I m .
重构Reconstruction 通过去Hankel算子T − 1 : H H L × K → H N \mathcal{T}^{-1}:\mathbb{H}_H^{L\times K} \rightarrow \mathbb{H}^N T − 1 : H H L × K → H N 将元运算X I q \mathcal{X}_{I_q} X I q 化为y ^ N q \hat{\bf y}_N^q y ^ N q ,从而构造函数型分解。通过投影定理,存在唯一的X ^ I q ∈ H H L × K \mathcal{\hat{X}}_{I_q}\in\mathbb{H}_H^{L\times K} X ^ I q ∈ H H L × K 使得
∥ X I q − X ^ I q ∥ F 2 ≤ ∥ X I q − Z ^ ∥ F 2 , ∀ Z ^ ∈ H H L × K \Vert \mathcal{X}_{I_q}-\mathcal{\hat{X}}_{I_q} \Vert_\mathcal{F}^2 \leq \Vert \mathcal{X}_{I_q}-\hat{\mathcal{Z}} \Vert_\mathcal{F}^2,\forall\hat{\mathcal{Z}}\in\mathbb{H}_H^{L\times K}
∥ X I q − X ^ I q ∥ F 2 ≤ ∥ X I q − Z ^ ∥ F 2 , ∀ Z ^ ∈ H H L × K
因此,利用反对角平均很容易得到各个分量的估计值
x ^ i , j q = 1 n s ∑ ( l , k ) : l + k = s x l , k q , \hat{x}_{i,j}^{q}=\dfrac{1}{n_{s}}\sum_{(l,k): l+k =s}{x}_{l,k}^q,
x ^ i , j q = n s 1 ( l , k ) : l + k = s ∑ x l , k q ,
用投影算子Π H : H L × K → H H L × K \Pi_\mathbb{H}:\mathbb{H}^{L\times K}\rightarrow \mathbb{H}^{L\times K}_H Π H : H L × K → H H L × K 定义这一操作,则下述步骤即可获得函数型时间序列
y ^ N q = T − 1 X ^ I q = T − 1 Π H X I q \hat{\bf y}_N^q=\mathcal{T}^{-1}\hat{\mathcal{X}}_{I_q}=\mathcal{T}^{-1}\Pi_\mathbb{H} \mathcal{X}_{I_q}
y ^ N q = T − 1 X ^ I q = T − 1 Π H X I q
小结 本文是经典的奇异谱分析到函数型数据分析的推广,大体步骤与传统一致,只是研究对象从数延伸到函数,所以定义了一系列算子来代替传统的矩阵运算,但是万变不离其宗,方法都是对协方差类型的表示进行奇异值分解。
这篇文章理论证明和算法细节都很详细,还给了一个演示网址https://fssa.shinyapps.io/fssa/ (opens new window) ,相信后续还会有一系列进展。
文章公式直接从arxiv的tex文档导出来的,略有修改,不过会出现符号重复两遍的bug,应该是\boldsymbol
有些许问题,不过不影响阅读。
参考文献