# Intelligent Identification of Trend Components in Singular Spectrum Analysis
## 2 SSA Algorithm and Linear Recurrence Relations  
A comprehensive description of the SSA algorithm and its theory can be found in [4]. In Algorithm 1, we present a specific case for extracting the trend.  
Consider a time series \(\mathsf{X}_{N}=(x_{1},\ldots,x_{N})\) of length \(N\), where \(x_{n}\in\mathbb{R}\).  
Figure 1: Flowchart of intelligent trend extraction.  
By definition, the \(L\)-rank of a time series is equal to the rank of its \(L\)-trajectory matrix \(r\). It turns out that for \(L\) such that \(\min(L,K)>r\) (assuming that the time series is long enough and such window lengths exist), the \(L\)-rank of the time series does not depend on \(L\) and is called simply the rank of the time series. Further reasoning will require knowledge of the ranks of particular time series. From [4] we know that the rank of a sinusoid with frequency \(\omega\), \(0<\omega<0.5\), is 2, and the rank of an exponential series and a sinusoid with period two equals 1. The same is valid for exponentially-modulated sinusoids. The rank of a polynomial series of degree \(\ell\) equals \(\ell+1\).  
An infinite series \(\mathbb{S}\) is a time series of rank \(r\) if and only if it is governed by a linear recurrence relation (LRR) of order \(r\), i.e., \(s_{n+r}=\sum_{i=1}^{r}a_{i}s_{n+r-i}\), \(a_{i}\
eq 0\), and this LRR is minimal. The minimal LRR is the only one, but obviously, there are many LRRs of higher order. If \(r\) exists, we call such signals _time series of finite rank_; overwise, we refer to them as _time series of infinite rank_.  
A characteristic polynomial of the form \(P(\mu)=\mu^{r}-\sum_{i=1}^{r}a_{i}\mu^{r-i}\) is associated with the LRR. Let it have \(k\) complex roots \(\mu_{1},\ldots,\mu_{k}\), which are called _signal roots_, and \(\mu_{i}\) have multiplicity \(m_{i}\), \(\sum_{i=1}^{k}m_{i}=r\).  
Through these roots, we can express the general parametric form of the time series [10] (Theorem 3.1.1)  
\[s_{n}=\sum_{i=1}^{k}P_{m_{i}}(n)\mu_{i}^{n}, \tag{1}\]  
where \(P_{m}(n)\) denotes a polynomial of degree \(m\) in \(n\).  
The decomposition of a time series into components of a certain structure using SSA, as well as their prediction, does not require knowledge of the explicit form of the time series (1), which greatly expands the applicability of SSA. However, if the signal fits this model, there is a method that allows one to estimate the non-linear parameters entering the time series, namely, \(\mu_{i}\); this is the ESPRIT method [11] (another name of ESPRIT for time series is HSVD [12]). For instance, let the trend correspond to the leading \(r\) components in the SVD decomposition of the trajectory matrix of the time series. Let \(\mathbf{P}=[U_{1}:\ldots:U_{r}]\), and \(\mathbf{\underline{P}}\) and \(\mathbf{\overline{P}}\) be the matrices obtained by removing the last and first rows of a matrix \(\mathbf{P}\), respectively. Then the estimates of single roots \(\mu_{i}\), \(i=1,\ldots,r\), will be the eigenvalues of the matrix \(\mathbf{\underline{P}}^{\mathsf{t}}\mathbf{\overline{P}}\) (LS-ESPRIT). In the case of a root of multiplicity larger than 1, when numerical methods are employed, the result of estimation will be a group of close roots, with a size equal to the multiplicity of the root.  
In the real case, denoting \(\mu_{i}=\rho_{i}e^{2\pi\omega_{i}i}\), we obtain an explicit form of the time series as a sum of polynomials multiplied by exponentially-modulated harmonics:  
\[s_{n}=\sum_{i=1}^{k}P_{m_{i}}(n)\rho_{i}^{n}\cos(2\pi\omega_{i}n+\phi_{i});\]  
ESPRIT estimates the parameters \(\rho_{i}\) and \(\omega_{i}\). In what follows we will consider the real case.