The final algorithm is described in Fig. [2](#ref-Figure2), where filtered series is the residuals of the regression of $DFSTE(x)$ over the $DFSTE$ of the normalized trend.

The minimum and the maximum periods of oscillation should be determined when using this method, so as to irrelevant to filtering frequencies are removed. As an example from Shaw ([1947](#ref-shaw1947)), a business cycle usually has a lower period of 1.5 years and a higher period of 8 years. This information can be used while for filtering as expressed from the following Table [1](#ref-table1).

Sample Frequency |
Lower |
Higher |

Month |
18 | 96 |

Quarter |
6 | 32 |

Year |
2 | 8 |

Table 1: Lower and higher periods of oscillation.

The same table in fragments of $\pi$ can be transformed into the Table [2](#ref-table2) using the $lower\ frequency = 2 / higher\ period$ and $higher\ frequency = 2 / lower\ period$. For instance, for quarterly sampled time series, we have $lower\ frequency = 2 / 32 = 0.0625$ and $higher\ frequency = 2 / 6 = 0.3333$.
Sample Frequency |
Lower |
Higher |

Month |
0.0208 | 0.1111 |

Quarter |
0.0625 | 0.3333 |

Year |
0.25 | 1 |

Table 2: Low and high frequency in fragments of $\pi$.

The longer the series, the more the long run frequency is expressed by a lower frequency as fragment of $\pi$ equal to 0. Moreover, the output gap can be expressed using higher frequency as fragment of $\pi$ equal to 1 ([Ouliaris, 2009](#ref-ouliaris2009)). ## **Example** For this example, the quarterly US GDP in billions of chained 2017 dollars (Seasonally adjusted) will be used. ``` r # Import package to workspace library(corbouli) # Import "USgdp" dataset data(USgdp) plot(USgdp, main = "Quarterly US GDP in billions of chained 2017 dollars (Seasonally adjusted)", ylab = "", lwd = 2) ``````r # Extract cycles co <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 0.3333) # Plot cycles of filtered series plot(co, main = "Corbae-Ouliaris FD Filter cycles for USgdp", ylab = "", lwd = 2) ```

```r # Plot real data with the ones after removing cycles # Removing cycles from original data USgdp_rmco <- USgdp - co # Plot Original vs Decycled data plot(USgdp, main = "Quarterly US GDP in billions of chained 2017 dollars (Seasonally adjusted)", col = "black", lwd = 2, ylab = "") lines(USgdp_rmco, col = adjustcolor("red", alpha.f = 0.7), lwd = 2) legend(x = "topleft", lwd = 2, text.font = 2, col= adjustcolor(c("black","red"), alpha.f = 0.7), legend=c("Original data", "Decycled data")) ```

As noted by Ouliaris ([2009](#ref-ouliaris2009)), for setting `high_freq = 1` the output gap series than business cycle one will have higher volatility (Fig. [6](#ref-Figure6)). ```r # Extract output gap og <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 1) # Plot Business cycle vs Output gap plot(co, main = "Business cycle vs Output gap for USgdp", col = adjustcolor("blue", alpha.f = 0.7), lwd = 2, ylab = "") lines(og, col = adjustcolor("orange", alpha.f = 0.7), lwd = 2) legend(x = "bottomleft", lwd = 2, text.font = 2, col= adjustcolor(c("blue","orange"), alpha.f = 0.7), legend=c("Business cycle", "Output gap")) ```

## **References** Baxter, M., & King, R. (1999), Measuring Business Cycles: Approximate Band-Pass Filters for Economic Time Series.