diff --git a/docs/news/index.html b/docs/news/index.html index 4f47f87..090d732 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -34,9 +34,12 @@

Changelog

corbouli 0.1.2

+

Major changes

+
+

Minor changes

-
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a610372..68a1325 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.0 pkgdown_sha: ~ articles: Introduction: Introduction.html -last_built: 2024-09-26T09:44Z +last_built: 2024-09-26T11:36Z urls: reference: https://cadam00.github.io/corbouli/reference article: https://cadam00.github.io/corbouli/articles diff --git a/docs/search.json b/docs/search.json index 219e4ab..52ee3bd 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"corbae-ouliaris-frequency-domain-filtering","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"Corbae-Ouliaris Frequency Domain Filtering","title":"Introduction to corbouli","text":"Corbae Ouliaris (2006) Frequency Domain Filter used extracting cycles either stationary non-stationary time series. one approximation ideal band pass filter series. result close one Baxter-King (1999) filter, end-points directly estimated facing end-point issue faced. main idea filtering algorithm illustrated Fig. 1 2. main idea DFTSE subroutine shown Fig. 1, DFT (Discrete Fourier Transform) times series, frequencies lower higher periods oscillation thresholds assigned zero finally IDFT (Inverse Discrete Fourier Transform) performed. Additional implementation details subroutine can found source code function corbouli::dftse. Fig. 1: DFTSE subroutine. final algorithm described Fig. 2, filtered series residuals regression DFSTE(x)DFSTE(x) DFSTEDFSTE normalized trend. Fig. 2: Corbae-Ouliaris main algorithm. minimum maximum periods oscillation determined using method, irrelevant filtering frequencies removed. example Shaw (1947), business cycle usually lower period 1.5 years higher period 8 years. information can used filtering expressed following Table 1. Table 1: Lower higher periods oscillation. table fragments π\\pi can transformed Table 2 using lowerfrequency=2/higherperiodlower\\ frequency = 2 / higher\\ period higherfrequency=2/lowerperiodhigher\\ frequency = 2 / lower\\ period. instance, quarterly sampled time series, lowerfrequency=2/32=0.0625lower\\ frequency = 2 / 32 = 0.0625 higherfrequency=2/6=0.3333higher\\ frequency = 2 / 6 = 0.3333. Table 2: Low high frequency fragments π\\pi. longer series, long run frequency expressed lower frequency fragment π\\pi equal 0. Moreover, output gap can expressed using higher frequency fragment π\\pi equal 1 (Ouliaris, 2009).","code":""},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"example","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"Example","title":"Introduction to corbouli","text":"example, quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) used. Fig. 3: USgdp dataset. Fig. 4: Corbae-Ouliaris FD Filter cycles. Fig. 5: Original vs Decycled USgdp data. noted Ouliaris (2009), setting high_freq = 1 output gap series business cycle one higher volatility (Fig. 6). Fig. 6: Business cycle vs Output gap.","code":"# 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) # 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) # 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\")) # 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\"))"},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"references","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"References","title":"Introduction to corbouli","text":"Baxter, M., & King, R. (1999), Measuring Business Cycles: Approximate Band-Pass Filters Economic Time Series. Review Economics Statistics 81(4), pp. 575-593. Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data,Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. https://doi.org/10.1017/CBO9781139164863.008. Ouliaris, S. (2009), Ideal Band Pass Filter Stationary/Non-Stationary Series. Pérez Pérez, J. (2011), COULIARI: Stata module implement Corbae-Ouliaris frequency domain filter time series data. Statistical Software Components, S457218, Boston College Department Economics. Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. https://doi.org/10.1086/256533.","code":""},{"path":"https://cadam00.github.io/corbouli/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christos Adam. Author, maintainer.","code":""},{"path":"https://cadam00.github.io/corbouli/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Adam C (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering. R package version 0.1.2, https://cadam00.github.io/corbouli/, https://github.com/cadam00/corbouli.","code":"@Manual{, title = {corbouli: Corbae-Ouliaris Frequency Domain Filtering}, author = {Christos Adam}, year = {2024}, note = {R package version 0.1.2, https://cadam00.github.io/corbouli/}, url = {https://github.com/cadam00/corbouli}, }"},{"path":[]},{"path":"https://cadam00.github.io/corbouli/index.html","id":"install","dir":"","previous_headings":"","what":"Install","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"official (CRAN) version package can installed using Alternatively, development version package can installed via","code":"install.packages(\"corbouli\") if (!require(remotes)) install.packages(\"remotes\") remotes::install_github(\"cadam00/corbouli\")"},{"path":"https://cadam00.github.io/corbouli/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"cite official (CRAN) version package, please use Adam, C. (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering. R package version 0.1.1. Available https://doi.org/10.32614/CRAN.package.corbouli. Alternatively, cite latest development version, please use: Adam, C. (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering (v0.1.2). Zenodo. Available https://doi.org/10.5281/zenodo.13740089","code":""},{"path":"https://cadam00.github.io/corbouli/index.html","id":"corbae-ouliaris-frequency-domain-filtering","dir":"","previous_headings":"","what":"Corbae-Ouliaris Frequency Domain Filtering","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"Corbae Ouliaris (2006) Frequency Domain Filter used extracting cycles either stationary non-stationary time series. one approximation ideal band pass filter series. result close one Baxter-King (1999) filter, end-points directly estimated facing end-point issue faced. main idea filtering algorithm illustrated Fig. 1 2. main idea DFTSE subroutine shown Fig. 1, DFT (Discrete Fourier Transform) times series, frequencies lower higher periods oscillation thresholds assigned zero finally IDFT (Inverse Discrete Fourier Transform) performed. Additional implementation details subroutine can found source code function corbouli::dftse. Fig. 1: DFTSE subroutine. final algorithm described Fig. 2, filtered series residuals regression DFSTE(x)DFSTE(x) DFSTEDFSTE normalized trend. Fig. 2: Corbae-Ouliaris main algorithm. minimum maximum periods oscillation determined using method, irrelevant filtering frequencies removed. example Shaw (1947), business cycle usually lower period 1.5 years higher period 8 years. information can used filtering expressed following Table 1. Table 1: Lower higher periods oscillation. table fragments π\\pi can transformed Table 2 using lowerfrequency=2/higherperiodlower\\ frequency = 2 / higher\\ period higherfrequency=2/lowerperiodhigher\\ frequency = 2 / lower\\ period. instance, quarterly sampled time series, lowerfrequency=2/32=0.0625lower\\ frequency = 2 / 32 = 0.0625 higherfrequency=2/6=0.3333higher\\ frequency = 2 / 6 = 0.3333. Table 2: Low high frequency fragments π\\pi. longer series, long run frequency expressed lower frequency fragment π\\pi equal 0. Moreover, output gap can expressed using higher frequency fragment π\\pi equal 1 (Ouliaris, 2009).","code":""},{"path":"https://cadam00.github.io/corbouli/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"example, quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) used. Fig. 3: USgdp dataset. Fig. 4: Corbae-Ouliaris FD Filter cycles. Fig. 5: Original vs Decycled USgdp data. noted Ouliaris (2009), setting high_freq = 1 output gap series business cycle one higher volatility (Fig. 6). Fig. 6: Business cycle vs Output gap.","code":"# 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) # 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) # 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\")) # 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\"))"},{"path":"https://cadam00.github.io/corbouli/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"Baxter, M., & King, R. (1999), Measuring Business Cycles: Approximate Band-Pass Filters Economic Time Series. Review Economics Statistics 81(4), pp. 575-593. Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data,Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. https://doi.org/10.1017/CBO9781139164863.008. Ouliaris, S. (2009), Ideal Band Pass Filter Stationary/Non-Stationary Series. Pérez Pérez, J. (2011), COULIARI: Stata module implement Corbae-Ouliaris frequency domain filter time series data. Statistical Software Components, S457218, Boston College Department Economics. Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. https://doi.org/10.1086/256533.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":null,"dir":"Reference","previous_headings":"","what":"Corbae-Ouliaris — corbae_ouliaris","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Corbae-Ouliaris (2006) Frequency Domain Filter","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Corbae-Ouliaris — corbae_ouliaris","text":"","code":"corbae_ouliaris(x, low_freq = NULL, high_freq = NULL)"},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Corbae-Ouliaris — corbae_ouliaris","text":"x Vector, data.frame, matrix similar 1D/2D object containing values filtering. low_freq Number indicating lowest period oscillation fractions \\(\\pi\\). low_freq > 1, indicating direct frequency data provided, transformed internally 2 / high_freq. default NULL, meaning ifelse(freq > 1, trunc(freq * 1.5), 2) used. high_freq Number indicating highest period oscillation radians \\(\\pi\\). high_freq > 1, indicating direct frequency data provided, transformed internally 2 / low_freq. default NULL, meaning trunc(freq * 8) used.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Corbae-Ouliaris — corbae_ouliaris","text":"pure R implementation filtering algorithm. low_freq high_freq connected characteristics series, example business circle. low_freq high_freq must either 0 1, meaning frequencies period radians, >1, indicating starting ending periods cycle. low_freq high_freq used keeping relevant frequencies. meant ones inside range \\([ low \\_ freq, high \\_ freq ]\\). Therefore, values outside range removed. 2-dimensional objects x, filtering per column applied.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Filtered object length/dimensions class input x.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data, Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. doi:10.1017/CBO9781139164863.008 . Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. doi:10.1086/256533 .","code":""},{"path":[]},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Corbae-Ouliaris — corbae_ouliaris","text":"","code":"# Apply on ts data(USgdp) res <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] 220.437445 122.214673 33.554008 -3.624313 10.611337 39.376810 # Apply on vector data(USgdp) res <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] 220.437445 122.214673 33.554008 -3.624313 10.611337 39.376810 # Apply on matrix per column mat <- matrix(USgdp, ncol = 4) res <- corbae_ouliaris(mat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] 122.74643 -147.02035 -113.696760 37.14300 #> [2,] 121.75519 -139.93212 1.967257 40.79558 #> [3,] 104.71525 -114.29315 90.769600 -27.41276 #> [4,] 81.59822 -71.11876 117.136438 -129.43620 #> [5,] 61.87092 -26.92243 84.482012 -212.27882 #> [6,] 46.35087 -1.33427 27.081152 -240.99583 # Apply on data.frame per column dfmat <- as.data.frame(mat) res <- corbae_ouliaris(dfmat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> V1 V2 V3 V4 #> 1 122.74643 -147.02035 -113.696760 37.14300 #> 2 121.75519 -139.93212 1.967257 40.79558 #> 3 104.71525 -114.29315 90.769600 -27.41276 #> 4 81.59822 -71.11876 117.136438 -129.43620 #> 5 61.87092 -26.92243 84.482012 -212.27882 #> 6 46.35087 -1.33427 27.081152 -240.99583"},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove irrelevant frequencies — dftse","title":"Remove irrelevant frequencies — dftse","text":"Remove irrelevant frequencies","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove irrelevant frequencies — dftse","text":"","code":"dftse(x, low_freq = NULL, high_freq = NULL)"},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove irrelevant frequencies — dftse","text":"x Vector, data.frame, matrix similar 1D/2D object containing values filtering. low_freq Number indicating lowest period oscillation fractions \\(\\pi\\). low_freq > 1, indicating direct frequency data provided, transformed internally 2 / high_freq. default NULL, meaning ifelse(freq > 1, trunc(freq * 1.5), 2) used. high_freq Number indicating highest period oscillation radians \\(\\pi\\). high_freq > 1, indicating direct frequency data provided, transformed internally 2 / low_freq. default NULL, meaning trunc(freq * 8) used.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Remove irrelevant frequencies — dftse","text":"pure R implementation removing irrelevant frequencies. First, DFT applied data result filtered according low_freq high_freq. Finally, inverse DFT performed relevant frequencies. low_freq high_freq must either 0 1, meaning frequencies period radians, >1, indicating starting ending periods cycle. low_freq high_freq used keeping relevant frequencies. meant ones inside range \\([ low \\_ freq, high \\_ freq ]\\). Therefore, values outside range removed. 2-dimensional objects x, transformation applied per column.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove irrelevant frequencies — dftse","text":"Filtered object length/dimensions input x. Note inputs dimensions (e.g. matrix, data.frame) matrix object returned.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Remove irrelevant frequencies — dftse","text":"Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data, Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. doi:10.1017/CBO9781139164863.008 . Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. doi:10.1086/256533 .","code":""},{"path":[]},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove irrelevant frequencies — dftse","text":"","code":"# Apply on ts object data(USgdp) res <- dftse(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] -2261.247 -6330.034 -7993.036 -7150.108 -4947.435 -2890.135 # Apply on vector res <- dftse(c(USgdp), low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] -2261.247 -6330.034 -7993.036 -7150.108 -4947.435 -2890.135 # Apply on matrix per column mat <- matrix(USgdp, ncol = 4) res <- dftse(mat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] -192.2898 -552.4067 -1069.575 -919.8675 #> [2,] -711.1214 -1211.6718 -2525.133 -2489.2995 #> [3,] -970.8496 -1498.3225 -3172.692 -3294.7414 #> [4,] -943.4586 -1390.1547 -2993.074 -3243.3326 #> [5,] -738.1949 -1056.4415 -2343.065 -2642.7021 #> [6,] -521.5195 -732.0659 -1695.942 -1966.0607 # Apply on data.frame per column dfmat <- as.data.frame(mat) res <- dftse(dfmat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] -192.2898 -552.4067 -1069.575 -919.8675 #> [2,] -711.1214 -1211.6718 -2525.133 -2489.2995 #> [3,] -970.8496 -1498.3225 -3172.692 -3294.7414 #> [4,] -943.4586 -1390.1547 -2993.074 -3243.3326 #> [5,] -738.1949 -1056.4415 -2343.065 -2642.7021 #> [6,] -521.5195 -732.0659 -1695.942 -1966.0607"},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":null,"dir":"Reference","previous_headings":"","what":"USgdp — USgdp","title":"USgdp — USgdp","text":"Quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) series 1947.1 2019.4. number observations : 292 observation : country country : United States","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"USgdp — USgdp","text":"","code":"data(USgdp)"},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"USgdp — USgdp","text":"monthly time series, billions chained 2017 dollars.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"USgdp — USgdp","text":"ts object.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"USgdp — USgdp","text":"Bureau Economic Analysis.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"USgdp — USgdp","text":"U.S. Bureau Economic Analysis. (2024). Current-dollar “real” GDP. Retrieved BEA website. https://www.bea.gov/","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"USgdp — USgdp","text":"","code":"# Apply on vector data(USgdp) USgdp #> Qtr1 Qtr2 Qtr3 Qtr4 #> 1947 2182.7 2176.9 2172.4 2206.5 #> 1948 2239.7 2276.7 2289.8 2292.4 #> 1949 2260.8 2253.1 2276.4 2257.4 #> 1950 2346.1 2417.7 2511.1 2559.2 #> 1951 2594.0 2638.9 2693.3 2699.2 #> 1952 2728.0 2733.8 2753.5 2843.9 #> 1953 2896.8 2919.2 2902.8 2858.8 #> 1954 2845.2 2848.3 2880.5 2936.9 #> 1955 3020.7 3069.9 3111.4 3130.1 #> 1956 3117.9 3143.7 3140.9 3192.6 #> 1957 3213.0 3206.0 3237.4 3203.9 #> 1958 3120.7 3141.2 3213.9 3289.0 #> 1959 3352.1 3427.7 3430.1 3439.8 #> 1960 3517.2 3498.2 3515.4 3470.3 #> 1961 3493.7 3553.0 3621.3 3692.3 #> 1962 3758.1 3792.1 3838.8 3851.4 #> 1963 3893.5 3937.2 4023.8 4050.1 #> 1964 4135.6 4180.6 4245.9 4259.0 #> 1965 4362.1 4417.2 4515.4 4619.5 #> 1966 4731.9 4748.0 4788.3 4827.5 #> 1967 4870.3 4873.3 4919.4 4956.5 #> 1968 5057.6 5142.0 5181.9 5202.2 #> 1969 5283.6 5299.6 5334.6 5308.6 #> 1970 5300.7 5308.2 5357.1 5299.7 #> 1971 5443.6 5473.1 5518.1 5531.0 #> 1972 5632.6 5760.5 5814.9 5912.2 #> 1973 6058.5 6124.5 6092.3 6150.1 #> 1974 6097.3 6111.8 6054.0 6030.5 #> 1975 5957.0 5999.6 6102.3 6184.5 #> 1976 6323.6 6370.0 6404.9 6451.2 #> 1977 6527.7 6654.5 6774.5 6774.6 #> 1978 6796.3 7058.9 7129.9 7225.8 #> 1979 7238.7 7246.5 7300.3 7318.5 #> 1980 7341.6 7190.3 7181.7 7315.7 #> 1981 7459.0 7403.7 7492.4 7410.8 #> 1982 7295.6 7328.9 7300.9 7303.8 #> 1983 7400.1 7568.5 7719.7 7880.8 #> 1984 8034.8 8173.7 8252.5 8320.2 #> 1985 8400.8 8474.8 8604.2 8668.2 #> 1986 8749.1 8788.5 8872.6 8920.2 #> 1987 8986.4 9083.3 9162.0 9319.3 #> 1988 9367.5 9490.6 9546.2 9673.4 #> 1989 9771.7 9846.3 9919.2 9938.8 #> 1990 10047.4 10083.9 10090.6 9998.7 #> 1991 9951.9 10029.5 10080.2 10115.3 #> 1992 10236.4 10347.4 10449.7 10558.6 #> 1993 10576.3 10637.8 10688.6 10834.0 #> 1994 10939.1 11087.4 11152.2 11279.9 #> 1995 11320.0 11353.7 11450.3 11528.1 #> 1996 11614.4 11808.1 11914.1 12037.8 #> 1997 12115.5 12317.2 12471.0 12577.5 #> 1998 12703.7 12821.3 12982.8 13191.7 #> 1999 13315.6 13426.7 13604.8 13828.0 #> 2000 13878.1 14130.9 14145.3 14229.8 #> 2001 14183.1 14271.7 14214.5 14253.6 #> 2002 14372.8 14460.8 14519.6 14537.6 #> 2003 14614.1 14743.6 14988.8 15162.8 #> 2004 15248.7 15366.9 15512.6 15670.9 #> 2005 15844.7 15922.8 16047.6 16136.7 #> 2006 16353.8 16396.2 16420.7 16561.9 #> 2007 16611.7 16713.3 16809.6 16915.2 #> 2008 16843.0 16943.3 16854.3 16485.4 #> 2009 16298.3 16269.1 16326.3 16502.8 #> 2010 16582.7 16743.2 16872.3 16960.9 #> 2011 16920.6 17035.1 17031.3 17222.6 #> 2012 17367.0 17444.5 17469.7 17489.9 #> 2013 17662.4 17709.7 17860.5 18016.1 #> 2014 17954.0 18185.9 18406.9 18500.0 #> 2015 18666.6 18782.2 18857.4 18892.2 #> 2016 19001.7 19062.7 19197.9 19304.4 #> 2017 19398.3 19506.9 19660.8 19882.4 #> 2018 20044.1 20150.5 20276.2 20304.9 #> 2019 20415.2 20584.5 20817.6 20951.1"},{"path":[]},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"minor-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"corbouli 0.1.2","text":"Update README.md Introduction.Rmd. Update corbae_ouliaris use correct regression formula. previous one included constant regression, case .","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"corbouli-011","dir":"Changelog","previous_headings":"","what":"corbouli 0.1.1","title":"corbouli 0.1.1","text":"CRAN release: 2024-09-25","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"minor-changes-0-1-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"corbouli 0.1.1","text":"Update comments corabe_ouliaris.R file. Update README.md Introduction.Rmd. Update DESCRIPTION text. Add pkgdown site. Update examples.","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"corbouli-010","dir":"Changelog","previous_headings":"","what":"corbouli 0.1.0","title":"corbouli 0.1.0","text":"CRAN release: 2024-09-12","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"major-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"corbouli 0.1.0","text":"Initial package version.","code":""}] +[{"path":[]},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"corbae-ouliaris-frequency-domain-filtering","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"Corbae-Ouliaris Frequency Domain Filtering","title":"Introduction to corbouli","text":"Corbae Ouliaris (2006) Frequency Domain Filter used extracting cycles either stationary non-stationary time series. one approximation ideal band pass filter series. result close one Baxter-King (1999) filter, end-points directly estimated facing end-point issue faced. main idea filtering algorithm illustrated Fig. 1 2. main idea DFTSE subroutine shown Fig. 1, DFT (Discrete Fourier Transform) times series, frequencies lower higher periods oscillation thresholds assigned zero finally IDFT (Inverse Discrete Fourier Transform) performed. Additional implementation details subroutine can found source code function corbouli::dftse. Fig. 1: DFTSE subroutine. final algorithm described Fig. 2, filtered series residuals regression DFSTE(x)DFSTE(x) DFSTEDFSTE normalized trend. Fig. 2: Corbae-Ouliaris main algorithm. minimum maximum periods oscillation determined using method, irrelevant filtering frequencies removed. example Shaw (1947), business cycle usually lower period 1.5 years higher period 8 years. information can used filtering expressed following Table 1. Table 1: Lower higher periods oscillation. table fragments π\\pi can transformed Table 2 using lowerfrequency=2/higherperiodlower\\ frequency = 2 / higher\\ period higherfrequency=2/lowerperiodhigher\\ frequency = 2 / lower\\ period. instance, quarterly sampled time series, lowerfrequency=2/32=0.0625lower\\ frequency = 2 / 32 = 0.0625 higherfrequency=2/6=0.3333higher\\ frequency = 2 / 6 = 0.3333. Table 2: Low high frequency fragments π\\pi. longer series, long run frequency expressed lower frequency fragment π\\pi equal 0. Moreover, output gap can expressed using higher frequency fragment π\\pi equal 1 (Ouliaris, 2009).","code":""},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"example","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"Example","title":"Introduction to corbouli","text":"example, quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) used. Fig. 3: USgdp dataset. Fig. 4: Corbae-Ouliaris FD Filter cycles. Fig. 5: Original vs Decycled USgdp data. noted Ouliaris (2009), setting high_freq = 1 output gap series business cycle one higher volatility (Fig. 6). Fig. 6: Business cycle vs Output gap.","code":"# 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) # 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) # 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\")) # 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\"))"},{"path":"https://cadam00.github.io/corbouli/articles/Introduction.html","id":"references","dir":"Articles","previous_headings":"Corbae and Ouliaris (2006) Frequency Domain Filter in R","what":"References","title":"Introduction to corbouli","text":"Baxter, M., & King, R. (1999), Measuring Business Cycles: Approximate Band-Pass Filters Economic Time Series. Review Economics Statistics 81(4), pp. 575-593. Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data,Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. https://doi.org/10.1017/CBO9781139164863.008. Ouliaris, S. (2009), Ideal Band Pass Filter Stationary/Non-Stationary Series. Pérez Pérez, J. (2011), COULIARI: Stata module implement Corbae-Ouliaris frequency domain filter time series data. Statistical Software Components, S457218, Boston College Department Economics. Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. https://doi.org/10.1086/256533.","code":""},{"path":"https://cadam00.github.io/corbouli/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christos Adam. Author, maintainer.","code":""},{"path":"https://cadam00.github.io/corbouli/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Adam C (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering. R package version 0.1.2, https://cadam00.github.io/corbouli/, https://github.com/cadam00/corbouli.","code":"@Manual{, title = {corbouli: Corbae-Ouliaris Frequency Domain Filtering}, author = {Christos Adam}, year = {2024}, note = {R package version 0.1.2, https://cadam00.github.io/corbouli/}, url = {https://github.com/cadam00/corbouli}, }"},{"path":[]},{"path":"https://cadam00.github.io/corbouli/index.html","id":"install","dir":"","previous_headings":"","what":"Install","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"official (CRAN) version package can installed using Alternatively, development version package can installed via","code":"install.packages(\"corbouli\") if (!require(remotes)) install.packages(\"remotes\") remotes::install_github(\"cadam00/corbouli\")"},{"path":"https://cadam00.github.io/corbouli/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"cite official (CRAN) version package, please use Adam, C. (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering. R package version 0.1.1. Available https://doi.org/10.32614/CRAN.package.corbouli. Alternatively, cite latest development version, please use: Adam, C. (2024). corbouli: Corbae-Ouliaris Frequency Domain Filtering (v0.1.2). Zenodo. Available https://doi.org/10.5281/zenodo.13740089","code":""},{"path":"https://cadam00.github.io/corbouli/index.html","id":"corbae-ouliaris-frequency-domain-filtering","dir":"","previous_headings":"","what":"Corbae-Ouliaris Frequency Domain Filtering","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"Corbae Ouliaris (2006) Frequency Domain Filter used extracting cycles either stationary non-stationary time series. one approximation ideal band pass filter series. result close one Baxter-King (1999) filter, end-points directly estimated facing end-point issue faced. main idea filtering algorithm illustrated Fig. 1 2. main idea DFTSE subroutine shown Fig. 1, DFT (Discrete Fourier Transform) times series, frequencies lower higher periods oscillation thresholds assigned zero finally IDFT (Inverse Discrete Fourier Transform) performed. Additional implementation details subroutine can found source code function corbouli::dftse. Fig. 1: DFTSE subroutine. final algorithm described Fig. 2, filtered series residuals regression DFSTE(x)DFSTE(x) DFSTEDFSTE normalized trend. Fig. 2: Corbae-Ouliaris main algorithm. minimum maximum periods oscillation determined using method, irrelevant filtering frequencies removed. example Shaw (1947), business cycle usually lower period 1.5 years higher period 8 years. information can used filtering expressed following Table 1. Table 1: Lower higher periods oscillation. table fragments π\\pi can transformed Table 2 using lowerfrequency=2/higherperiodlower\\ frequency = 2 / higher\\ period higherfrequency=2/lowerperiodhigher\\ frequency = 2 / lower\\ period. instance, quarterly sampled time series, lowerfrequency=2/32=0.0625lower\\ frequency = 2 / 32 = 0.0625 higherfrequency=2/6=0.3333higher\\ frequency = 2 / 6 = 0.3333. Table 2: Low high frequency fragments π\\pi. longer series, long run frequency expressed lower frequency fragment π\\pi equal 0. Moreover, output gap can expressed using higher frequency fragment π\\pi equal 1 (Ouliaris, 2009).","code":""},{"path":"https://cadam00.github.io/corbouli/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"example, quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) used. Fig. 3: USgdp dataset. Fig. 4: Corbae-Ouliaris FD Filter cycles. Fig. 5: Original vs Decycled USgdp data. noted Ouliaris (2009), setting high_freq = 1 output gap series business cycle one higher volatility (Fig. 6). Fig. 6: Business cycle vs Output gap.","code":"# 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) # 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) # 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\")) # 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\"))"},{"path":"https://cadam00.github.io/corbouli/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Corbae-Ouliaris Frequency Domain Filtering","text":"Baxter, M., & King, R. (1999), Measuring Business Cycles: Approximate Band-Pass Filters Economic Time Series. Review Economics Statistics 81(4), pp. 575-593. Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data,Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. https://doi.org/10.1017/CBO9781139164863.008. Ouliaris, S. (2009), Ideal Band Pass Filter Stationary/Non-Stationary Series. Pérez Pérez, J. (2011), COULIARI: Stata module implement Corbae-Ouliaris frequency domain filter time series data. Statistical Software Components, S457218, Boston College Department Economics. Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. https://doi.org/10.1086/256533.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":null,"dir":"Reference","previous_headings":"","what":"Corbae-Ouliaris — corbae_ouliaris","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Corbae-Ouliaris (2006) Frequency Domain Filter","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Corbae-Ouliaris — corbae_ouliaris","text":"","code":"corbae_ouliaris(x, low_freq = NULL, high_freq = NULL)"},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Corbae-Ouliaris — corbae_ouliaris","text":"x Vector, data.frame, matrix similar 1D/2D object containing values filtering. low_freq Number indicating lowest period oscillation fractions \\(\\pi\\). low_freq > 1, indicating direct frequency data provided, transformed internally 2 / high_freq. default NULL, meaning ifelse(freq > 1, trunc(freq * 1.5), 2) used. high_freq Number indicating highest period oscillation radians \\(\\pi\\). high_freq > 1, indicating direct frequency data provided, transformed internally 2 / low_freq. default NULL, meaning trunc(freq * 8) used.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Corbae-Ouliaris — corbae_ouliaris","text":"pure R implementation filtering algorithm. low_freq high_freq connected characteristics series, example business circle. low_freq high_freq must either 0 1, meaning frequencies period radians, >1, indicating starting ending periods cycle. low_freq high_freq used keeping relevant frequencies. meant ones inside range \\([ low \\_ freq, high \\_ freq ]\\). Therefore, values outside range removed. 2-dimensional objects x, filtering per column applied.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Filtered object length/dimensions class input x.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Corbae-Ouliaris — corbae_ouliaris","text":"Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data, Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. doi:10.1017/CBO9781139164863.008 . Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. doi:10.1086/256533 .","code":""},{"path":[]},{"path":"https://cadam00.github.io/corbouli/reference/corbae_ouliaris.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Corbae-Ouliaris — corbae_ouliaris","text":"","code":"# Apply on ts data(USgdp) res <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] 220.437445 122.214673 33.554008 -3.624313 10.611337 39.376810 # Apply on vector data(USgdp) res <- corbae_ouliaris(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] 220.437445 122.214673 33.554008 -3.624313 10.611337 39.376810 # Apply on matrix per column mat <- matrix(USgdp, ncol = 4) res <- corbae_ouliaris(mat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] 122.74643 -147.02035 -113.696760 37.14300 #> [2,] 121.75519 -139.93212 1.967257 40.79558 #> [3,] 104.71525 -114.29315 90.769600 -27.41276 #> [4,] 81.59822 -71.11876 117.136438 -129.43620 #> [5,] 61.87092 -26.92243 84.482012 -212.27882 #> [6,] 46.35087 -1.33427 27.081152 -240.99583 # Apply on data.frame per column dfmat <- as.data.frame(mat) res <- corbae_ouliaris(dfmat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> V1 V2 V3 V4 #> 1 122.74643 -147.02035 -113.696760 37.14300 #> 2 121.75519 -139.93212 1.967257 40.79558 #> 3 104.71525 -114.29315 90.769600 -27.41276 #> 4 81.59822 -71.11876 117.136438 -129.43620 #> 5 61.87092 -26.92243 84.482012 -212.27882 #> 6 46.35087 -1.33427 27.081152 -240.99583"},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove irrelevant frequencies — dftse","title":"Remove irrelevant frequencies — dftse","text":"Remove irrelevant frequencies","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove irrelevant frequencies — dftse","text":"","code":"dftse(x, low_freq = NULL, high_freq = NULL)"},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove irrelevant frequencies — dftse","text":"x Vector, data.frame, matrix similar 1D/2D object containing values filtering. low_freq Number indicating lowest period oscillation fractions \\(\\pi\\). low_freq > 1, indicating direct frequency data provided, transformed internally 2 / high_freq. default NULL, meaning ifelse(freq > 1, trunc(freq * 1.5), 2) used. high_freq Number indicating highest period oscillation radians \\(\\pi\\). high_freq > 1, indicating direct frequency data provided, transformed internally 2 / low_freq. default NULL, meaning trunc(freq * 8) used.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Remove irrelevant frequencies — dftse","text":"pure R implementation removing irrelevant frequencies. First, DFT applied data result filtered according low_freq high_freq. Finally, inverse DFT performed relevant frequencies. low_freq high_freq must either 0 1, meaning frequencies period radians, >1, indicating starting ending periods cycle. low_freq high_freq used keeping relevant frequencies. meant ones inside range \\([ low \\_ freq, high \\_ freq ]\\). Therefore, values outside range removed. 2-dimensional objects x, transformation applied per column.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove irrelevant frequencies — dftse","text":"Filtered object length/dimensions input x. Note inputs dimensions (e.g. matrix, data.frame) matrix object returned.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Remove irrelevant frequencies — dftse","text":"Corbae, D., Ouliaris, S., & Phillips, P. (2002), Band Spectral Regression Trending-Data. Econometrica 70(3), pp. 1067-1109. Corbae, D. & Ouliaris, S. (2006), Extracting Cycles Nonstationary Data, Corbae D., Durlauf S.N., & Hansen B.E. (eds.). Econometric Theory Practice: Frontiers Analysis Applied Research. Cambridge: Cambridge University Press, pp. 167–177. doi:10.1017/CBO9781139164863.008 . Shaw, E.S. (1947), Burns Mitchell Business Cycles. Journal Political Economy, 55(4): pp. 281-298. doi:10.1086/256533 .","code":""},{"path":[]},{"path":"https://cadam00.github.io/corbouli/reference/dftse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove irrelevant frequencies — dftse","text":"","code":"# Apply on ts object data(USgdp) res <- dftse(USgdp, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] -2261.247 -6330.034 -7993.036 -7150.108 -4947.435 -2890.135 # Apply on vector res <- dftse(c(USgdp), low_freq = 0.0625, high_freq = 0.3333) head(res) #> [1] -2261.247 -6330.034 -7993.036 -7150.108 -4947.435 -2890.135 # Apply on matrix per column mat <- matrix(USgdp, ncol = 4) res <- dftse(mat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] -192.2898 -552.4067 -1069.575 -919.8675 #> [2,] -711.1214 -1211.6718 -2525.133 -2489.2995 #> [3,] -970.8496 -1498.3225 -3172.692 -3294.7414 #> [4,] -943.4586 -1390.1547 -2993.074 -3243.3326 #> [5,] -738.1949 -1056.4415 -2343.065 -2642.7021 #> [6,] -521.5195 -732.0659 -1695.942 -1966.0607 # Apply on data.frame per column dfmat <- as.data.frame(mat) res <- dftse(dfmat, low_freq = 0.0625, high_freq = 0.3333) head(res) #> [,1] [,2] [,3] [,4] #> [1,] -192.2898 -552.4067 -1069.575 -919.8675 #> [2,] -711.1214 -1211.6718 -2525.133 -2489.2995 #> [3,] -970.8496 -1498.3225 -3172.692 -3294.7414 #> [4,] -943.4586 -1390.1547 -2993.074 -3243.3326 #> [5,] -738.1949 -1056.4415 -2343.065 -2642.7021 #> [6,] -521.5195 -732.0659 -1695.942 -1966.0607"},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":null,"dir":"Reference","previous_headings":"","what":"USgdp — USgdp","title":"USgdp — USgdp","text":"Quarterly US GDP billions chained 2017 dollars (Seasonally adjusted) series 1947.1 2019.4. number observations : 292 observation : country country : United States","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"USgdp — USgdp","text":"","code":"data(USgdp)"},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"USgdp — USgdp","text":"monthly time series, billions chained 2017 dollars.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"USgdp — USgdp","text":"ts object.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"USgdp — USgdp","text":"Bureau Economic Analysis.","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"USgdp — USgdp","text":"U.S. Bureau Economic Analysis. (2024). Current-dollar “real” GDP. Retrieved BEA website. https://www.bea.gov/","code":""},{"path":"https://cadam00.github.io/corbouli/reference/USgdp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"USgdp — USgdp","text":"","code":"# Apply on vector data(USgdp) USgdp #> Qtr1 Qtr2 Qtr3 Qtr4 #> 1947 2182.7 2176.9 2172.4 2206.5 #> 1948 2239.7 2276.7 2289.8 2292.4 #> 1949 2260.8 2253.1 2276.4 2257.4 #> 1950 2346.1 2417.7 2511.1 2559.2 #> 1951 2594.0 2638.9 2693.3 2699.2 #> 1952 2728.0 2733.8 2753.5 2843.9 #> 1953 2896.8 2919.2 2902.8 2858.8 #> 1954 2845.2 2848.3 2880.5 2936.9 #> 1955 3020.7 3069.9 3111.4 3130.1 #> 1956 3117.9 3143.7 3140.9 3192.6 #> 1957 3213.0 3206.0 3237.4 3203.9 #> 1958 3120.7 3141.2 3213.9 3289.0 #> 1959 3352.1 3427.7 3430.1 3439.8 #> 1960 3517.2 3498.2 3515.4 3470.3 #> 1961 3493.7 3553.0 3621.3 3692.3 #> 1962 3758.1 3792.1 3838.8 3851.4 #> 1963 3893.5 3937.2 4023.8 4050.1 #> 1964 4135.6 4180.6 4245.9 4259.0 #> 1965 4362.1 4417.2 4515.4 4619.5 #> 1966 4731.9 4748.0 4788.3 4827.5 #> 1967 4870.3 4873.3 4919.4 4956.5 #> 1968 5057.6 5142.0 5181.9 5202.2 #> 1969 5283.6 5299.6 5334.6 5308.6 #> 1970 5300.7 5308.2 5357.1 5299.7 #> 1971 5443.6 5473.1 5518.1 5531.0 #> 1972 5632.6 5760.5 5814.9 5912.2 #> 1973 6058.5 6124.5 6092.3 6150.1 #> 1974 6097.3 6111.8 6054.0 6030.5 #> 1975 5957.0 5999.6 6102.3 6184.5 #> 1976 6323.6 6370.0 6404.9 6451.2 #> 1977 6527.7 6654.5 6774.5 6774.6 #> 1978 6796.3 7058.9 7129.9 7225.8 #> 1979 7238.7 7246.5 7300.3 7318.5 #> 1980 7341.6 7190.3 7181.7 7315.7 #> 1981 7459.0 7403.7 7492.4 7410.8 #> 1982 7295.6 7328.9 7300.9 7303.8 #> 1983 7400.1 7568.5 7719.7 7880.8 #> 1984 8034.8 8173.7 8252.5 8320.2 #> 1985 8400.8 8474.8 8604.2 8668.2 #> 1986 8749.1 8788.5 8872.6 8920.2 #> 1987 8986.4 9083.3 9162.0 9319.3 #> 1988 9367.5 9490.6 9546.2 9673.4 #> 1989 9771.7 9846.3 9919.2 9938.8 #> 1990 10047.4 10083.9 10090.6 9998.7 #> 1991 9951.9 10029.5 10080.2 10115.3 #> 1992 10236.4 10347.4 10449.7 10558.6 #> 1993 10576.3 10637.8 10688.6 10834.0 #> 1994 10939.1 11087.4 11152.2 11279.9 #> 1995 11320.0 11353.7 11450.3 11528.1 #> 1996 11614.4 11808.1 11914.1 12037.8 #> 1997 12115.5 12317.2 12471.0 12577.5 #> 1998 12703.7 12821.3 12982.8 13191.7 #> 1999 13315.6 13426.7 13604.8 13828.0 #> 2000 13878.1 14130.9 14145.3 14229.8 #> 2001 14183.1 14271.7 14214.5 14253.6 #> 2002 14372.8 14460.8 14519.6 14537.6 #> 2003 14614.1 14743.6 14988.8 15162.8 #> 2004 15248.7 15366.9 15512.6 15670.9 #> 2005 15844.7 15922.8 16047.6 16136.7 #> 2006 16353.8 16396.2 16420.7 16561.9 #> 2007 16611.7 16713.3 16809.6 16915.2 #> 2008 16843.0 16943.3 16854.3 16485.4 #> 2009 16298.3 16269.1 16326.3 16502.8 #> 2010 16582.7 16743.2 16872.3 16960.9 #> 2011 16920.6 17035.1 17031.3 17222.6 #> 2012 17367.0 17444.5 17469.7 17489.9 #> 2013 17662.4 17709.7 17860.5 18016.1 #> 2014 17954.0 18185.9 18406.9 18500.0 #> 2015 18666.6 18782.2 18857.4 18892.2 #> 2016 19001.7 19062.7 19197.9 19304.4 #> 2017 19398.3 19506.9 19660.8 19882.4 #> 2018 20044.1 20150.5 20276.2 20304.9 #> 2019 20415.2 20584.5 20817.6 20951.1"},{"path":[]},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"major-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Major changes","title":"corbouli 0.1.2","text":"Update corbae_ouliaris use correct regression formula. previous one included constant regression, case . done computations versions 0.1.1 0.1.0, advised repeat .","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"minor-changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"corbouli 0.1.2","text":"Update README.md Introduction.Rmd.","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"corbouli-011","dir":"Changelog","previous_headings":"","what":"corbouli 0.1.1","title":"corbouli 0.1.1","text":"CRAN release: 2024-09-25","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"minor-changes-0-1-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"corbouli 0.1.1","text":"Update comments corabe_ouliaris.R file. Update README.md Introduction.Rmd. Update DESCRIPTION text. Add pkgdown site. Update examples.","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"corbouli-010","dir":"Changelog","previous_headings":"","what":"corbouli 0.1.0","title":"corbouli 0.1.0","text":"CRAN release: 2024-09-12","code":""},{"path":"https://cadam00.github.io/corbouli/news/index.html","id":"major-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"corbouli 0.1.0","text":"Initial package version.","code":""}]