<p>First of all, just because there is an economic cycle in a data that does not imply that data is non-stationary. For example, consider the completely stationary process simulated in R below, which is based on <span class="math-container">$x_t = \phi x_{t-1} +e_t$</span> with <span class="math-container">$\phi=0.9$</span> which is stationary by construction yet it exhibits something like economic cycle.</p>
<p><a href="https://i.sstatic.net/Rq9VE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Rq9VE.png" alt="enter image description here" /></a></p>
<p>So the first thing you should do is to make sure there actually is non-stationarity in your data and not just assume that because data exhibit some sort of cycle. Either look in the literature on the given aggregate whether in general it is considered to be integrated of some order or perform your own unit root tests (assuming there is enough observations to carry them out - you dont mention if your data is on monthly, quarterly or yearly frequency. Depending on frequency there might be plenty of data points to carry out these tests even within the given years).</p>
<p>Second, taking logs  is not a solution for non-stationarity even if you have long time series (and I am not even sure what you mean by change percentages). The way how you solve non-stationarity is by taking differences of your data.</p>
<p>For example, a simple non-stationary process is given by</p>
<p><span class="math-container">$$x_t= x_{t-1} + e_t$$</span></p>
<p>The process is non stationary because <span class="math-container">$\phi=1$</span>  which implies that present variables are fully determined by initial conditions of the system and sum of shocks. If that is the case just taking logs of variables <span class="math-container">$\ln x_t = \ln x_{t-1} +e_t$</span> does not solve the unit root problem as you will have the same dependence and it does not matter how long your time series is. Taking logs of your variables can be desirable for many different reasons but not related to non-stationarity per se.</p>
<p>What actually solves the non-stationarity/unit-root problem is to take first differences. For example, in the example above we could transform data as:</p>
<p><span class="math-container">$x_t -x_{t-1}= e_t$</span></p>
<p>Which would become stationary series. You can apply the same procedure to <span class="math-container">$\ln x_t$</span> but what ultimately gets rid of the non-stationarity is the differencing. In a worse case scenario you could have series that is integrated of order 2 in which case you would have to make one more second difference. However, eventually taking difference of the series will always produce stationary series. According to Verbeek (2008) guide to modern macroeconomics most economic series that are non-stationary are I(1) and in some rare cases I(2), so even with extremely short time series you should be able to make it stationary.</p>

CC BY-SA 4.0
2020-06-29T11:34:10.507Z
Thank you! I'm using monthly data so there should be enough data points to make the unit root tests. With percentage changes I had understood calculating the differencing in the wrong way, i.e. as relative changes and not absolute ones so thank you for correcting me
Ossi Taavitsainen
CC BY-SA 4.0
2020-06-29T11:43:33.430Z
@OssiTaavitsainen you are welcome, also differences in logs of variables give you approximate % change, you can use that and it might be preferred option for various reasons but again it’s not the % that deals with unit root per se but the differencing
1muflon1
CC BY-SA 4.0
2020-06-29T09:53:00.717Z
2020-06-29T10:00:35.857Z
2020-06-29T10:00:35.857Z
1muflon1
<p>The two most common ways to make a non-stationary time series curve stationary are:</p>
<p>Differencing</p>
<p>Transforming</p>
<p>Differencing:
In order to make your series stationary, you take a difference between the data points. So let us say, your original time series was:</p>
<p>X1, X2, X3,...........Xn
You series with difference of degree 1 becomes:</p>
<p>(X2 - X1, X3 - X2, X4 - X3,.......Xn - X(n-1)
Once, you take the difference, plot the series and see if there is any improvement in the the curve. If not, you can try a second or even a third order differencing. Remember, the more you difference, the more complicated your analysis is becoming.</p>
<p>Transformation
If you can not make a time series stationary, you can try out transforming the variables. Log transform (difference in logs) is probably the most commonly used transformation, if you are seeing a diverging time series.</p>
<p>Compound annual growth rate, or CAGR, is the mean annual growth rate of data over a specified period of time longer than one year. It represents one of the most accurate ways to calculate any data that can rise or fall in value over time.</p>
<p>Unlike average growth rates that are prone to volatility levels, compound growth rates are not affected by volatility. Therefore, they are more relevant in the comparison of different data series.</p>
<p>To calculate the CAGR of an investment:</p>
<p>Divide the value of an investment at the end of the period by its value at the beginning of that period.</p>
<p>Raise the result to an exponent of one divided by the number of years.</p>
<p>Subtract one from the subsequent result.</p>
<p>This website offers more information  <a href="https://otexts.com/fpp2/stationarity.html" rel="nofollow noreferrer">https://otexts.com/fpp2/stationarity.html</a>.</p>

CC BY-SA 4.0
2020-06-29T11:35:39.117Z
Thank you! The link you posted was very useful, with second order differencing I got stationary data
Ossi Taavitsainen
CC BY-SA 4.0
2020-06-29T11:37:12.587Z
You're welcome friend.  I am glad I was able to help you.  Good luck on the rest of your project.
Mike J
CC BY-SA 4.0
2020-06-29T09:47:10.160Z
2020-06-29T09:47:10.160Z
Mike J
<p>I'm having trouble understanding how macroeconomic or industry data could be made stationary if there's only a limited length of time series available (e.g. 2012-2019) and I have a time series that first goes up during e.g. 2012-2015 and then goes down 2016-2019 i.e. we have just one longer economic cycle in the data. This data would not be stationary even though we take log or change percentage since first the growth is positive and then negative. How do people typically tackle these situations, do you split the time series into the different periods to get a consistent slope? Many thanks for help!</p>

<macroeconomics><statistics><time-series>
Stationarity of cyclical economic data
Ossi Taavitsainen
# Stationarity of cyclical economic data

(Asked by: username_0 on 2020-06-29)

I'm having trouble understanding how macroeconomic or industry data could be made stationary if there's only a limited length of time series available (e.g. 2012-2019) and I have a time series that first goes up during e.g. 2012-2015 and then goes down 2016-2019 i.e. we have just one longer economic cycle in the data. This data would not be stationary even though we take log or change percentage since first the growth is positive and then negative. How do people typically tackle these situations, do you split the time series into the different periods to get a consistent slope? Many thanks for help!

**Tags:** macroeconomics, statistics, time-series


---

## 2 answers

### Answer by username_1 on 2020-06-29. Score: 1 | Accepted answer

First of all, just because there is an economic cycle in a data that does not imply that data is non-stationary. For example, consider the completely stationary process simulated in R below, which is based on $x\_t = \phi x\_{t-1} +e\_t$ with $\phi=0.9$ which is stationary by construction yet it exhibits something like economic cycle.

[![enter image description here](https://i.sstatic.net/Rq9VE.png)](https://i.sstatic.net/Rq9VE.png)

So the first thing you should do is to make sure there actually is non-stationarity in your data and not just assume that because data exhibit some sort of cycle. Either look in the literature on the given aggregate whether in general it is considered to be integrated of some order or perform your own unit root tests (assuming there is enough observations to carry them out - you dont mention if your data is on monthly, quarterly or yearly frequency. Depending on frequency there might be plenty of data points to carry out these tests even within the given years).

Second, taking logs is not a solution for non-stationarity even if you have long time series (and I am not even sure what you mean by change percentages). The way how you solve non-stationarity is by taking differences of your data.

For example, a simple non-stationary process is given by

$$x\_t= x\_{t-1} + e\_t$$

The process is non stationary because $\phi=1$ which implies that present variables are fully determined by initial conditions of the system and sum of shocks. If that is the case just taking logs of variables $\ln x\_t = \ln x\_{t-1} +e\_t$ does not solve the unit root problem as you will have the same dependence and it does not matter how long your time series is. Taking logs of your variables can be desirable for many different reasons but not related to non-stationarity per se.

What actually solves the non-stationarity/unit-root problem is to take first differences. For example, in the example above we could transform data as:

$x\_t -x\_{t-1}= e\_t$

Which would become stationary series. You can apply the same procedure to $\ln x\_t$ but what ultimately gets rid of the non-stationarity is the differencing. In a worse case scenario you could have series that is integrated of order 2 in which case you would have to make one more second difference. However, eventually taking difference of the series will always produce stationary series. According to Verbeek (2008) guide to modern macroeconomics most economic series that are non-stationary are I(1) and in some rare cases I(2), so even with extremely short time series you should be able to make it stationary.

> **Comments:**
> **username_0**: Thank you! I'm using monthly data so there should be enough data points to make the unit root tests. With percentage changes I had understood calculating the differencing in the wrong way, i.e. as relative changes and not absolute ones so thank you for correcting me  
> **username_1**: @username_0 you are welcome, also differences in logs of variables give you approximate % change, you can use that and it might be preferred option for various reasons but again it’s not the % that deals with unit root per se but the differencing  

---

### Answer by username_2 on 2020-06-29. Score: 0

The two most common ways to make a non-stationary time series curve stationary are:

Differencing

Transforming

Differencing:
In order to make your series stationary, you take a difference between the data points. So let us say, your original time series was:

X1, X2, X3,...........Xn
You series with difference of degree 1 becomes:

(X2 - X1, X3 - X2, X4 - X3,.......Xn - X(n-1)
Once, you take the difference, plot the series and see if there is any improvement in the the curve. If not, you can try a second or even a third order differencing. Remember, the more you difference, the more complicated your analysis is becoming.

Transformation
If you can not make a time series stationary, you can try out transforming the variables. Log transform (difference in logs) is probably the most commonly used transformation, if you are seeing a diverging time series.

Compound annual growth rate, or CAGR, is the mean annual growth rate of data over a specified period of time longer than one year. It represents one of the most accurate ways to calculate any data that can rise or fall in value over time.

Unlike average growth rates that are prone to volatility levels, compound growth rates are not affected by volatility. Therefore, they are more relevant in the comparison of different data series.

To calculate the CAGR of an investment:

Divide the value of an investment at the end of the period by its value at the beginning of that period.

Raise the result to an exponent of one divided by the number of years.

Subtract one from the subsequent result.

This website offers more information <https://otexts.com/fpp2/stationarity.html>.

> **Comments:**
> **username_0**: Thank you! The link you posted was very useful, with second order differencing I got stationary data  
> **username_2**: You're welcome friend.  I am glad I was able to help you.  Good luck on the rest of your project.  

---

