Last edited: 2024-10-29 12:30:03

**To apply models like the ARMA model to time series sample data, the seasonality and trend have to be removed. Let's look at how to do that.**

Let us say we have time series $X$ which has both a trend and a seasonality then we can do a decomposition of the time series and write it as:

$X_t = m_t + s_t + Y_t,$where $m_t$ is the trend component, $s_t$ is the seasonal component with period $d$ and $Y_t$ is the rest which is weakly stationary and has mean of 0. Since we have singled out a seasonal component we know that $s_t = s_{t+d}$ because $d$ is the period of the seasonality.

Before we discuss how to eliminate the trend and seasonal component, we have to examine a couple of time series operators.

The lag operator $B$, also called the backshift operator, is defined as:

$B X_t = X_{t-1}.$So when taking the lag operator to the power of $k$ we get:

$B^k X_t = X_{t-k}.$The difference operator $\nabla$ is defined as:

$\nabla X_t = (1-B) X_t = X_t - X_{t-1}.$So when taking the difference operator to the power of $k$ and using the binomial theorem we get:

$\nabla^k X_t = (1-B)^k X_t = \sum_{i=0}^k {k \choose i} (-1)^i B^i X_t = \sum_{i=0}^k {k \choose i} (-1)^i X_{t-i}.$The lag-d differencing operator $\nabla_d$ is defined as:

$\nabla_d X_t = (1-B^d) X_t = X_t - X_{t-d}.$To eliminate seasonality in a time series we will have to use the lag-d differencing operator. Since the seasonality has a period of $d$ then:

$\nabla_d X = m_t - m_{t-d} + s_t - s_{t-d} + Y_t - Y_{t-d} = \nabla_d m_t + \nabla_d Y_t,$because $s_t = s_{t-d}$.

Eliminating trend in a time series is a bit more tricky than removing seasonality. We have to assume that

$m_t = \sum_{i=0}^q a_i t^i,$where $a_i$ is some real constant and $q < n$ where $n$ is the sample size of the data. Lets apply the difference operator to the power of $q$ on $m_t$:

$\nabla^q m_t = \sum_{i=0}^q {q \choose i} (-1)^i \sum_{j=0}^q a_j (t-i)^j.$Since the sums are finite we can change the order of them, so we get the following

$\sum_{j=0}^q a_j \sum_{i=0}^q {q \choose i} (-1)^i (t-i)^j.$Now, we focus on the inner sum:

$\sum_{i=0}^q {q \choose i} (-1)^i (t-i)^j.$By applying the binomial theorem and properties of polynomial expansions on $(t-i)^j$ we get:

$(t-i)^j = \sum_{k=0}^j {j \choose k} t^{j-k} (-i)^k.$By substituting this into our sum and changing order of the sums we get:

$\sum_{i=0}^q {q \choose i} (-1)^i (t-i)^j = \sum_{k=0}^j {j \choose k} t^{j-k} (-1)^k \sum_{i=0}^q {q \choose i} (-1)^i i^k.$Using the fact that

$\sum_{i=0}^q {q \choose i} (-1)^i i^k = 0 \text{ for } k < q$we find that the entire expression evaluates to 0 when $j < q$. When $j = q$ this inner sum evaluates to $q!$. Therefore, the final expression simplifies to:

$a_q q!$and this means that

$\nabla^q m_t = a_q q!.$So when we apply $\nabla^q$ to $X_t$ we get

$\nabla^q X_t = a_q q! + \nabla^q Y_t.$Given that $Y$ is regarded as a stationary process with a mean of zero, it can be demonstrated that this property extends to $\nabla^q Y$. Consequently, if $s = 0$, $\nabla^q X$ behaves as a stationary process with a mean of $a_q q!$.

Was the post useful? Feel free to donate!

DONATE