R Codes:
Use the latest version of R found at https://cran.r-project.org/bin/windows/base/ . All R codes listed here are freely shareable but acknowledge me in yor write up by refering to this R code page at https://sites.google.com/view/olaoluwasyaya/home/r-program-codes
Fractional Integration by GPH
The Geweke and Porter-Hudak (1983) and Robinson (1995) based on log-periodogram regression estimators. The updated version of the estimator is implemented in most software. Download R code by clicking here.
Fractional Integration by Robinson 1994
This is the fractional alternative to Augmented Dickey-Fuller test which relies on no intercept, intercept only, and linear trend. The Robinson (1994) approach is often used in my fractional interation stuff. Download R code by clicking here.
Seasonal Fractional Integration
Seasonal Fractional Integration process is an alternative to test for seasonality or fractional integration when seasonality is expected in the case of monthly or quarterly datasets. Download R code by clicking here.
FCVAR model
Fractional Cointegrating Vector Autoregressive (FCVAR) model allows for testing cointegration among three on more variables. It is an extension to the FC test. I have few papers in which this FCVAR R code has been implemented. Download R code by clicking here.
Granger Causality
Granger Causality approach is recently used in the paper: Yaya, O.S., Abu, N. & Ogundunmade, T.P. Economic policy uncertainty in G7 countries: evidence of long-range dependence and cointegration. Econ Change Restruct 54, 541–556 (2021). https://doi.org/10.1007/s10644-020-09288-3 Download R code by clicking here.
Narrow Band FDLS
Narrow Band Frequency Domain Least Squares estimator is still relatively new. The estimates are better than residuals from OLS in judging cointegration. This has been applied in some of our papers recently, such as Long memory cointegration in the analysis of maximum, minimum and range temperatures in Africa: Implications for climate change found at https://www.mdpi.com/2073-4433/14/8/1299 Download R code by clicking here.
Dynamic Connectedness models
R codes for various dynamic connectedness models are developed here based on David Gabauer's works. So far, we have the following published papers. Download R for Dynamic Connectedness code by clicking here
Gil-Alana, L. A., Yaya, O. S., Adesina, O. A., and Vo, X. V. (2024). Model-free and Model-based connectedness in highly, medium and lowly correlated financial returns: analyses of OECD inflations. Quality and Quantity International Journal of Methodology.https://doi.org/10.1007/s11135-024-02038-x
Yaya, O. S., Zhang, M., Xi, H. and Furuoka, F. (2024). How do leading stock markets in America and Europe connect with Asian stock markets? an analysis of Quantile Dynamic Connectedness. Quantitative Finance and Economics, 8(3): 502-531.
Yaya, O. S., Olayinka, H. A., Ogbonna, E. A., Al-Faryan, M. A. S. and Vo, X. V. (2024). Dynamic connectedness of Economic Policy Uncertainty in G7 countries, and the influence of the US and UK: Quantile VAR analysis. Economic Change and Restructuring, 57(2), 76.
Yaya, O. S., Adenikinju, O. O. and Olayinka, H. A. (2024). African Stock Markets’ connectedness: Quantile VAR Approach. Modern Finance, 2(1): 51-68.
Furuoka, F., Yaya, O. S., Ling, P. K., Al-Faryan, M. A. S. and Islam, M. N. (2023). Transmission of risks between energy and agricultural commodities: Frequency time-varying VAR, asymmetry and portfolio management. Resources Policy, 81, 103339.
Ajao, I. O., Olayinka, H. A., Olugbode, M. A., Yaya, O. S. and Shittu, O. I. (2023). Long memory cointegration and Dynamic Connectedness of Volatility in US dollar Exchange rates, with FOREX portfolio investment strategy. Quantitative Finance and Economics, 7(4), 646-664.
Download R code by clicking here.
Portfolio Hedging Strategy based on Dynamic Connectedness
The portfolio management of assets based on dynamic connectedness analysis is applied here: Furuoka, F., Yaya, O. S., Ling, P. K., Al-Faryan, M. A. S. and Islam, M. N. (2023). Transmission of risks between energy and agricultural commodities: Frequency time-varying VAR, asymmetry and portfolio management. Resources Policy, 81, 103339. Download R code by clicking here.
Wavelet Coherence analysis
Wavelet coherence analysis determines the correlation between two signals in the time-frequency plane. This is achieved by the cross-wavelet transform, which is the product of the wavelet transform of one signal and the complex-conjugate of the wavelet transform of the other signal. Download R code by clicking here and data here.
A paper, on the role of uncertainty on oil shocks. We considered TVP Granger-Causality test and Wavelet coherence. Download the R code for Wavelet coherence analysis here. Please, cite as: Yaya, O. S. (2025). R code for Wavelet Coherence analysis. [accessed on 31 March, 2025] https://sites.google.com/view/olaoluwasyaya/home/r-program-codes
Other R codes for your analysis
1. Residual-based Fractional Cointegration
Download R code by clicking here.
2. Vector FI process
Download R code by clicking here.
3. Spurious Long memory
Download R code by clicking here.
4. Time Varying Cointegration
Download R code by clicking here.
5. Hurst persistence and seasonal unit root-HEGY
Download R code by clicking here.
6. Engle-Ng Asymmetry test and Engle-Sheppard CCC vs DCC test
Download R code by clicking here.
7. Q and ARCH test
Download R code by clicking here.
8. VARMA_GARCH variants
Download R code by clicking here.
9. African map
Download R code by clicking here.
10. Correlation plots
Download R code by clicking here.
11. Text mining, web scrapping and topic modelling