Time Series Seasonality and Trend
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:
Xt=mt+st+Yt,
where mt is the trend component, st is the seasonal component with period d and Yt is the rest which is weakly stationary and has mean of 0. Since we have singled out a seasonal component we know that st=st+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
The lag operator B, also called the backshift operator, is defined as:
BXt=Xt−1.
So when taking the lag operator to the power of k we get:
BkXt=Xt−k.
The Difference Operator
The difference operator ∇ is defined as:
∇Xt=(1−B)Xt=Xt−Xt−1.
So when taking the difference operator to the power of k and using the binomial theorem we get:
∇kXt=(1−B)kXt=i=0∑k(ik)(−1)iBiXt
=i=0∑k(ik)(−1)iXt−i.
The Lag-d Differencing Operator
The lag-d differencing operator ∇d is defined as:
∇dXt=(1−Bd)Xt=Xt−Xt−d.
Removing Seasonality in a Time Series
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:
∇dX=mt−mt−d+st−st−d+Yt−Yt−d
=∇dmt+∇dYt,
because st=st−d.
Removing Trend in a Time Series
Eliminating trend in a time series is a bit more tricky than removing seasonality. We have to assume that
mt=i=0∑qaiti,
where ai 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 mt:
∇qmt=i=0∑q(iq)(−1)ij=0∑qaj(t−i)j.
Since the sums are finite we can change the order of them, so we get the following
j=0∑qaji=0∑q(iq)(−1)i(t−i)j.
Now, we focus on the inner sum:
i=0∑q(iq)(−1)i(t−i)j.
By applying the binomial theorem and properties of polynomial expansions on (t−i)j we get:
(t−i)j=k=0∑j(kj)tj−k(−i)k.
By substituting this into our sum and changing order of the sums we get:
i=0∑q(iq)(−1)i(t−i)j
=k=0∑j(kj)tj−k(−1)ki=0∑q(iq)(−1)iik.
Using the fact that
i=0∑q(iq)(−1)iik=0 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:
aqq!
and this means that
∇qmt=aqq!.
So when we apply ∇q to Xt we get
∇qXt=aqq!+∇qYt.
Given that Y is regarded as a stationary process with a mean of zero, it can be demonstrated that this property extends to ∇qY. Consequently, if s=0, ∇qX behaves as a stationary process with a mean of aqq!.
Was the post useful? Feel free to donate!
DONATE