Title: | Connectedness Approach |
---|---|
Description: | The estimation of static and dynamic connectedness measures is created in a modular and user-friendly way. Besides, the time domain connectedness approaches, this package further allows to estimate the frequency connectedness approach, the joint spillover index and the extended joint connectedness approach. In addition, all connectedness frameworks can be based upon orthogonalized and generalized VAR, QVAR, LASSO VAR, Ridge VAR, Elastic Net VAR and TVP-VAR models. Furthermore, the package includes the conditional, decomposed and partial connectedness measures as well as the pairwise connectedness index, influence index and corrected total connectedness index. Finally, a battery of datasets are available allowing to replicate a variety of connectedness papers. |
Authors: | David Gabauer [aut, cre] |
Maintainer: | David Gabauer <[email protected]> |
License: | GPL-3 |
Version: | 1.0.4 |
Built: | 2025-03-01 03:36:49 UTC |
Source: | CRAN |
For detailed information see: Adekoya, O. B., Akinseye, A., Antonakakis, N., Chatziantoniou, I., Gabauer, D., and Oliyide, J. A. (2021). Crude oil and Islamic sectoral stocks: Asymmetric connectedness and investment strategies. Available at SSRN.
data(aaacgo2022)
data(aaacgo2022)
zoo data.frame
For detailed information see: Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2020). Refined measures of dynamic connectedness based on time-varying parameter vector autoregressions. Journal of Risk and Financial Management, 13(4), 84.
data(acg2020)
data(acg2020)
zoo data.frame
This function results in aggregated connectedness measures.
AggregatedConnectedness(dca, groups, start = NULL, end = NULL)
AggregatedConnectedness(dca, groups, start = NULL, end = NULL)
dca |
Dynamic connectedness object |
groups |
List of at least two group vectors |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Stenfors, A., Chatziantoniou, I., & Gabauer, D. (2022). Independent Policy, Dependent Outcomes: A Game of Cross-Country Dominoes across European Yield Curves. Journal of International Financial Markets, Institutions and Money.
#Replication of Gabauer and Gupta (2018) data("gg2018") dca = ConnectednessApproach(gg2018, nlag=1, nfore=10, model="VAR", connectedness="Time") ac = AggregatedConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
#Replication of Gabauer and Gupta (2018) data("gg2018") dca = ConnectednessApproach(gg2018, nlag=1, nfore=10, model="VAR", connectedness="Time") ac = AggregatedConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
Get Bayes prior
BayesPrior(x, size = NULL, nlag)
BayesPrior(x, size = NULL, nlag)
x |
zoo data matrix |
size |
Sample size used to calculate prior parameters |
nlag |
Lag length |
Get Bayes Prior
David Gabauer
Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. The Review of Economic Studies, 72(3), 821-852.
data("dy2012") prior = BayesPrior(dy2012, nlag=1)
data("dy2012") prior = BayesPrior(dy2012, nlag=1)
For detailed information see: Broadstock, D., Broadstock, D. C., Chatziantoniou, I., & Gabauer, D. (2022). Minimum connectedness portfolios and the market for green bonds: Advocating socially responsible investment (SRI) activity. In Applications in Energy Finance (pp. 217-253). Palgrave Macmillan, Cham.
data(bcg2022)
data(bcg2022)
zoo data.frame
For detailed information see: Balcilar, M., Gabauer, D., & Umar, Z. (2021). Crude Oil futures contracts and commodity markets: New evidence from a TVP-VAR extended joint connectedness approach. Resources Policy, 73, 102219.
data(bgu2021)
data(bgu2021)
zoo data.frame
This function multiple Bivariate DCC-GARCH models that captures more accurately conditional covariances and correlations
BivariateDCCGARCH( x, spec, copula = "mvt", method = "Kendall", transformation = "parametric", time.varying = TRUE, asymmetric = FALSE, eval.se = FALSE )
BivariateDCCGARCH( x, spec, copula = "mvt", method = "Kendall", transformation = "parametric", time.varying = TRUE, asymmetric = FALSE, eval.se = FALSE )
x |
zoo dataset |
spec |
A cGARCHspec A cGARCHspec object created by calling cgarchspec. |
copula |
"mvnorm" or "mvt" (see, rmgarch package) |
method |
"Kendall" or "ML" (see, rmgarch package) |
transformation |
"parametric", "empirical" or "spd" (see, rmgarch package) |
time.varying |
Boolean value to either choose DCC-GARCH or CCC-GARCH |
asymmetric |
Whether to include an asymmetry term to the DCC model (thus estimating the aDCC). |
eval.se |
Boolean value to compute standard errors |
Estimate Bivariate DCC-GARCH
David Gabauer
Cocca, T., Gabauer, D., & Pomberger, S. (2024). Clean energy market connectedness and investment strategies: New evidence from DCC-GARCH R2 decomposed connectedness measures. Energy Economics.
Engle, R. (2002). Dynamic conditional correlation: A simple class of multivariate generalized autoregressive conditional heteroskedasticity models. Journal of Business & Economic Statistics, 20(3), 339-350.
This function calculates the optimal portfolio weights according to Kroner and Ng (1998)
BivariatePortfolio( x, H, method = c("cumsum", "cumprod"), long = TRUE, statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
BivariatePortfolio( x, H, method = c("cumsum", "cumprod"), long = TRUE, statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
H |
Residual variance-covariance, correlation or pairwise connectedness matrix |
method |
Cumulative sum or cumulative product |
long |
Allow only long portfolio position |
statistics |
Hedging effectiveness statistic |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get bivariate portfolio weights
David Gabauer
Kroner, K. F., & Ng, V. K. (1998). Modeling asymmetric comovements of asset returns. The Review of Financial Studies, 11(4), 817-844.
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) bpw = BivariatePortfolio(g2020/100, fit$Q, method="cumsum", statistics="Fisher") bpw$TABLE
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) bpw = BivariatePortfolio(g2020/100, fit$Q, method="cumsum", statistics="Fisher") bpw$TABLE
For detailed information see: Chatziantoniou, I., Elsayed, AH., Gabauer, D. and Gozgor, G. (2021). Oil price shocks and exchange rate dynamics: New evidence from internal, external and partial connectedness measures for oil importing and exporting countries
data(cegg2022)
data(cegg2022)
zoo data.frame
For detailed information see: Chatziantoniou, I., & Gabauer, D. (2021). EMU risk-synchronisation and financial fragility through the prism of dynamic connectedness. The Quarterly Review of Economics and Finance, 79, 1-14.
data(cg2021)
data(cg2021)
zoo data.frame
For detailed information see: Chatziantoniou, I., Gabauer, D., & Gupta, R. (2021). Integration and Risk Transmission in the Market for Crude Oil: A Time-Varying Parameter Frequency Connectedness Approach.
data(cgg2022)
data(cgg2022)
zoo data.frame
For detailed information see: Cocca, T., Gabauer, D., & Pomberger, S. (2024). Clean energy market connectedness and investment strategies: New evidence from DCC-GARCH R2 decomposed connectedness measures. Energy Economics.
data(cgp2024)
data(cgp2024)
zoo data.frame
For detailed information see: Chatziantoniou, I., Gabauer, D., & Stenfors, A. (2021). Interest rate swaps and the transmission mechanism of monetary policy: A quantile connectedness approach. Economics Letters, 204, 109891.
data(cgs2021)
data(cgs2021)
zoo data.frame
For detailed information see: Chatziantoniou, I., Gabauer, D., & Stenfors, A. Independent Policy, Dependent Out-comes: A Game of Cross-Country Dom-inoes across European Yield Curves.
data(cgs2022)
data(cgs2022)
zoo data.frame
This function computes the conditional connectedness measures.
ConditionalConnectedness(dca, group = c(1, 2, 3), start = NULL, end = NULL)
ConditionalConnectedness(dca, group = c(1, 2, 3), start = NULL, end = NULL)
dca |
Dynamic connectedness object |
group |
Group vector |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Stenfors, A., Chatziantoniou, I., & Gabauer, D. (2022). Independent Policy, Dependent Outcomes: A Game of Cross-Country Dominoes across European Yield Curves. Journal of International Financial Markets, Institutions and Money.
#Replication of Chatzianzoniou, Gabauer and Stenfors (2022) data("cgs2022") dca = ConnectednessApproach(cgs2022, nlag=1, nfore=10, window.size=250, model="VAR", connectedness="Time") cc = ConditionalConnectedness(dca, group=c(1,4,7,10,13,16))
#Replication of Chatzianzoniou, Gabauer and Stenfors (2022) data("cgs2022") dca = ConnectednessApproach(cgs2022, nlag=1, nfore=10, window.size=250, model="VAR", connectedness="Time") cc = ConditionalConnectedness(dca, group=c(1,4,7,10,13,16))
Compute partial conditional correlations
ConditionalCorrelation(Q)
ConditionalCorrelation(Q)
Q |
Variance-covariance matrix of dimension |
Get partial conditional correlations
David Gabauer
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) pcc = ConditionalCorrelation(fit$Q)
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) pcc = ConditionalCorrelation(fit$Q)
This function provides a modular framework combining various models and connectedness frameworks.
ConnectednessApproach( x, nlag = 1, nfore = 10, window.size = NULL, corrected = FALSE, model = c("VAR", "QVAR", "LAD", "LASSO", "Ridge", "Elastic", "TVP-VAR", "DCC-GARCH"), connectedness = c("Time", "Frequency", "Joint", "Extended Joint", "R2"), VAR_config = list(QVAR = list(tau = 0.5, method = "fn"), ElasticNet = list(nfolds = 10, alpha = NULL, loss = "mae", n_alpha = 10), TVPVAR = list(kappa1 = 0.99, kappa2 = 0.99, prior = "BayesPrior", gamma = 0.01)), DCC_config = list(standardize = FALSE), Connectedness_config = list(TimeConnectedness = list(generalized = TRUE), FrequencyConnectedness = list(partition = c(pi, pi/2, 0), generalized = TRUE, scenario = "ABS"), R2Connectedness = list(method = "pearson", decomposition = TRUE, relative = FALSE)) )
ConnectednessApproach( x, nlag = 1, nfore = 10, window.size = NULL, corrected = FALSE, model = c("VAR", "QVAR", "LAD", "LASSO", "Ridge", "Elastic", "TVP-VAR", "DCC-GARCH"), connectedness = c("Time", "Frequency", "Joint", "Extended Joint", "R2"), VAR_config = list(QVAR = list(tau = 0.5, method = "fn"), ElasticNet = list(nfolds = 10, alpha = NULL, loss = "mae", n_alpha = 10), TVPVAR = list(kappa1 = 0.99, kappa2 = 0.99, prior = "BayesPrior", gamma = 0.01)), DCC_config = list(standardize = FALSE), Connectedness_config = list(TimeConnectedness = list(generalized = TRUE), FrequencyConnectedness = list(partition = c(pi, pi/2, 0), generalized = TRUE, scenario = "ABS"), R2Connectedness = list(method = "pearson", decomposition = TRUE, relative = FALSE)) )
x |
zoo data matrix |
nlag |
Lag length |
nfore |
H-step ahead forecast horizon |
window.size |
Rolling-window size or Bayes Prior sample size |
corrected |
Boolean value whether corrected or standard TCI should be computed |
model |
Estimation model |
connectedness |
Type of connectedness approach |
VAR_config |
Config for VAR model |
DCC_config |
Config for DCC-GARCH model |
Connectedness_config |
Config for connectedness approach |
Get connectedness measures
David Gabauer
Adekoya, O. B., Akinseye, A. B., Antonakakis, N., Chatziantoniou, I., Gabauer, D., & Oliyide, J. (2022). Crude oil and Islamic sectoral stocks: Asymmetric TVP-VAR connectedness and investment strategies. Resources Policy.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2020). Refined measures of dynamic connectedness based on time-varying parameter vector autoregressions. Journal of Risk and Financial Management.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2021). The impact of Euro through time: Exchange rate dynamics under different regimes. International Journal of Finance & Economics.
Balcilar, M., Gabauer, D., & Umar, Z. (2021). Crude Oil futures contracts and commodity markets: New evidence from a TVP-VAR extended joint connectedness approach. Resources Policy.
Balli, F., Balli, H. O., Dang, T. H. N., & Gabauer, D. (2023). Contemporaneous and lagged R2 decomposed connectedness approach: New evidence from the energy futures market. Finance Research Letters.
Barunik, J., & Krehlik, T. (2018). Measuring the frequency dynamics of financial connectedness and systemic risk. Journal of Financial Econometrics.
Broadstock, D. C., Chatziantoniou, I., & Gabauer, D. (2022). Minimum connectedness portfolios and the market for green bonds: Advocating socially responsible investment (SRI) activity. In Applications in energy finance: The energy sector, economic activity, financial markets and the environment. Cham: Springer International Publishing.
Chatziantoniou, I., & Gabauer, D. (2021). EMU risk-synchronisation and financial fragility through the prism of dynamic connectedness. The Quarterly Review of Economics and Finance.
Chatziantoniou, I., Gabauer, D., & Stenfors, A. (2021). Interest rate swaps and the transmission mechanism of monetary policy: A quantile connectedness approach. Economics Letters.
Chatziantoniou, I., Gabauer, D., & Gupta, R. (2023). Integration and risk transmission in the market for crude oil: New evidence from a time-varying parameter frequency connectedness approach. Resources Policy.
Chatziantoniou, I., Aikins Abakah, E. J., Gabauer, D., & Tiwari, A. K. (2022). Quantile time-frequency price connectedness between green bond, green equity, sustainable investments and clean energy markets. Journal of Cleaner Production.
Chatziantoniou, I., Elsayed, A. H., Gabauer, D., & Gozgor, G. (2023). Oil price shocks and exchange rate dynamics: Evidence from decomposed and partial connectedness measures for oil importing and exporting economies. Energy Economics.
Cocca, T., Gabauer, D., & Pomberger, S. (2024). Clean energy market connectedness and investment strategies: New evidence from DCC-GARCH R2 decomposed connectedness measures. Energy Economics.
Cunado, J., Chatziantoniou, I., Gabauer, D., de Gracia, F. P., & Hardik, M. (2023). Dynamic spillovers across precious metals and oil realized volatilities: Evidence from quantile extended joint connectedness measures. Journal of Commodity Markets.
Diebold, F. X., & Yilmaz, K. (2009). Measuring financial asset return and volatility spillovers, with application to global equity markets. The Economic Journal.
Diebold, F. X., & Yilmaz, K. (2012). Better to give than to receive: Predictive directional measurement of volatility spillovers. International Journal of Forecasting.
Gabauer, D. (2020). Volatility impulse response analysis for DCC-GARCH models: The role of volatility transmission mechanisms. Journal of Forecasting.
Gabauer, D. (2021). Dynamic measures of asymmetric & pairwise connectedness within an optimal currency area: Evidence from the ERM I system. Journal of Multinational Financial Management.
Gabauer, D., Chatziantoniou, I., & Stenfors, A. (2023). Model-free connectedness measures. Finance Research Letters.
Gabauer, D., Gupta, R., Marfatia, H. A., & Miller, S. M. (2024). Estimating US housing price network connectedness: Evidence from dynamic Elastic Net, Lasso, and ridge vector autoregressive models. International Review of Economics & Finance.
Gabauer, D., & Stenfors, A. (2024). Quantile-on-quantile connectedness measures: Evidence from the US treasury yield curve. Finance Research Letters, 60, 104852.
Lastrapes, W. D., & Wiesen, T. F. (2021). The joint spillover index. Economic Modelling, 94, 681-691.
Naeem, M. A., Chatziantoniou, I., Gabauer, D., & Karim, S. (2024). Measuring the G20 stock market return transmission mechanism: Evidence from the R2 connectedness approach. International Review of Financial Analysis.
Stenfors, A., Chatziantoniou, I., & Gabauer, D. (2022). Independent policy, dependent outcomes: A game of cross-country dominoes across European yield curves. Journal of International Financial Markets, Institutions and Money.
Zhang, Y., Gabauer, D., Gupta, R., & Ji, Q. (2024). How connected is the oil-bank network? Firm-level and high-frequency evidence. Energy Economics.
data("acg2020") dca = ConnectednessApproach(acg2020, nlag=1, nfore=12, model="VAR", connectedness="Time", VAR_config=list(TVPVAR=list(kappa1=0.99, kappa2=0.96, prior="MinnesotaPrior", gamma=0.1))) dca$TABLE
data("acg2020") dca = ConnectednessApproach(acg2020, nlag=1, nfore=12, model="VAR", connectedness="Time", VAR_config=list(TVPVAR=list(kappa1=0.99, kappa2=0.96, prior="MinnesotaPrior", gamma=0.1))) dca$TABLE
This function provides standard connectedness table.
ConnectednessTable(FEVD, digit = 2)
ConnectednessTable(FEVD, digit = 2)
FEVD |
Forecast error variance decomposition |
digit |
Number of decimal places |
Get connectedness table
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) fevd = FEVD(Phi=fit$B, Sigma=fit$Q, nfore=10, type="time", generalized=TRUE)$FEVD dca = ConnectednessTable(fevd)
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) fevd = FEVD(Phi=fit$B, Sigma=fit$Q, nfore=10, type="time", generalized=TRUE)$FEVD dca = ConnectednessTable(fevd)
This function calculates the optimal DCC-GARCH specification
DCCGARCHselection( x, distributions = c("norm", "snorm", "std", "sstd", "ged", "sged"), models = c("sGARCH", "eGARCH", "gjrGARCH", "iGARCH", "TGARCH", "AVGARCH", "NGARCH", "NAGARCH", "APARCH", "ALLGARCH"), prob = 0.05, conf.level = 0.9, lag = 20, ar = 0, ma = 0 )
DCCGARCHselection( x, distributions = c("norm", "snorm", "std", "sstd", "ged", "sged"), models = c("sGARCH", "eGARCH", "gjrGARCH", "iGARCH", "TGARCH", "AVGARCH", "NGARCH", "NAGARCH", "APARCH", "ALLGARCH"), prob = 0.05, conf.level = 0.9, lag = 20, ar = 0, ma = 0 )
x |
zoo data matrix |
distributions |
Vector of distributions |
models |
Vector of GARCH models |
prob |
The quantile (coverage) used for the VaR. |
conf.level |
Confidence level of VaR test statistics |
lag |
Lag length of weighted Portmanteau statistics |
ar |
AR(p) |
ma |
MA(q) |
Get best DCC-GARCH
David Gabauer
Ghalanos, A. (2014). rugarch: Univariate GARCH models, R package version 1.3-3.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2021). The impact of Euro through time: Exchange rate dynamics under different regimes. International Journal of Finance & Economics, 26(1), 1375-1408.
For detailed information see: Diebold, F. X., & Yilmaz, K. (2009). Measuring financial asset return and volatility spillovers, with application to global equity markets. The Economic Journal, 119(534), 158-171.
data(dy2009)
data(dy2009)
A zoo data.frame containing 30x1141 observations.
Yahoo Finance
For detailed information see: Diebold, F. X., & Yilmaz, K. (2012). Better to give than to receive: Predictive directional measurement of volatility spillovers. International Journal of forecasting, 28(1), 57-66.
data(dy2012)
data(dy2012)
A zoo data.frame containing 30x1141 observations.
Yahoo Finance
Estimation of a VAR using equation-by-equation LASSO, Ridge or Elastic Net regressions.
ElasticNetVAR( x, configuration = list(nlag = 1, nfolds = 10, loss = "mae", alpha = NULL, n_alpha = 10) )
ElasticNetVAR( x, configuration = list(nlag = 1, nfolds = 10, loss = "mae", alpha = NULL, n_alpha = 10) )
x |
zoo data matrix |
configuration |
Model configuration |
nlag |
Lag length |
nfolds |
N-fold cross validation |
loss |
Loss function |
alpha |
LASSO is alpha equal 1 and Ridge if alpha equal 0 |
n_alpha |
Creates n-equidistant alpha values |
Estimate VAR model
David Gabauer
Tibshirani, R., Bien, J., Friedman, J., Hastie, T., Simon, N., Taylor, J., & Tibshirani, R. J. (2012). Strong rules for discarding predictors in lasso‐type problems. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(2), 245-266.
Hoerl, A. E., & Kennard, R. W. (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1), 55-67.
Zou, H., & Hastie, T. (2005). Regularization and variable selection via the elastic net. Journal of the royal statistical society: series B (statistical methodology), 67(2), 301-320.
Gabauer, D., Gupta, R., Marfatia, H. A., & Miller, S. M. (2024). Estimating US housing price network connectedness: Evidence from dynamic Elastic Net, Lasso, and ridge vector autoregressive models. International Review of Economics & Finance, 89, 349-362.
data("dy2012") fit = ElasticNetVAR(dy2012, configuration=list(nlag=1, alpha=1, nfolds=10, loss="mae"))
data("dy2012") fit = ElasticNetVAR(dy2012, configuration=list(nlag=1, alpha=1, nfolds=10, loss="mae"))
This function calculates the equality weighted portfolio
EquallyWeightedPortfolio( x, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
EquallyWeightedPortfolio( x, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
method |
Cumulative sum or cumulative product |
statistics |
Hedging effectiveness statistic |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get portfolio weights
David Gabauer
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") mcp = EquallyWeightedPortfolio(g2020/100, statistics="Fisher") mcp$TABLE
data("g2020") mcp = EquallyWeightedPortfolio(g2020/100, statistics="Fisher") mcp$TABLE
This function results in exclusive connectedness measures
ExclusiveConnectedness(dca, group = c(1, 2), start = NULL, end = NULL)
ExclusiveConnectedness(dca, group = c(1, 2), start = NULL, end = NULL)
dca |
Dynamic connectedness object |
group |
Vector of group indices |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Chatziantoniou, I., Elsayed, A. H., Gabauer, D., & Gozgor, G. (2023). Oil price shocks and exchange rate dynamics: Evidence from decomposed and partial connectedness measures for oil importing and exporting economies. Energy Economics, 120, 106627.
#Replication of Chatziantoniou, et al. (2022) data("cegg2022") dca = ConnectednessApproach(cegg2022, nlag=1, nfore=20, model="VAR", connectedness="Time", corrected=TRUE) exc = ExclusiveConnectedness(dca, group=c(1,2,3))
#Replication of Chatziantoniou, et al. (2022) data("cegg2022") dca = ConnectednessApproach(cegg2022, nlag=1, nfore=20, model="VAR", connectedness="Time", corrected=TRUE) exc = ExclusiveConnectedness(dca, group=c(1,2,3))
This function provides extended joint connectedness measures.
ExtendedJointConnectedness(Phi, Sigma, nfore = 10)
ExtendedJointConnectedness(Phi, Sigma, nfore = 10)
Phi |
VAR coefficient matrix |
Sigma |
Residual variance-covariance matrix |
nfore |
H-step ahead forecast horizon |
Get connectedness measures
David Gabauer
Balcilar, M., Gabauer, D., & Umar, Z. (2021). Crude Oil futures contracts and commodity markets: New evidence from a TVP-VAR extended joint connectedness approach. Resources Policy, 73, 102219.
#Replication of Balcilar et al. (2021) data("bgu2021") fit = VAR(bgu2021, configuration=list(nlag=1)) dca = ExtendedJointConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=20) dca$TABLE
#Replication of Balcilar et al. (2021) data("bgu2021") fit = VAR(bgu2021, configuration=list(nlag=1)) dca = ExtendedJointConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=20) dca$TABLE
This function provides external connectedness measures
ExternalConnectedness( dca, groups = list(c(1), c(2:ncol(dca$NET))), start = NULL, end = NULL )
ExternalConnectedness( dca, groups = list(c(1), c(2:ncol(dca$NET))), start = NULL, end = NULL )
dca |
Dynamic connectedness object |
groups |
List of at least two group vectors |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Gabauer, D., & Gupta, R. (2018). On the transmission mechanism of country-specific and international economic uncertainty spillovers: Evidence from a TVP-VAR connectedness decomposition approach. Economics Letters, 171, 63-71.
data("gg2018") dca = ConnectednessApproach(gg2018, model="VAR", connectedness="Time", nlag=1, nfore=10, window.size=200) ext = ExternalConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
data("gg2018") dca = ConnectednessApproach(gg2018, model="VAR", connectedness="Time", nlag=1, nfore=10, window.size=200) ext = ExternalConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
This function computes the orthogonalized/generalized forecast error variance decomposition
FEVD( Phi, Sigma, nfore = 100, type = c("time", "frequency"), generalized = TRUE, range = NULL )
FEVD( Phi, Sigma, nfore = 100, type = c("time", "frequency"), generalized = TRUE, range = NULL )
Phi |
VAR coefficient matrix |
Sigma |
Residual variance-covariance matrix |
nfore |
H-step ahead forecast horizon |
type |
Time or Frequency connectedness approach |
generalized |
Generalized or orthogonalized FEVD |
range |
Partition range for frequency approach only. |
Orthogonalized/generalized time/frequency forecast error variance decomposition
Stiassny, A. (1996). A spectral decomposition for structural VAR models. Empirical Economics, 21(4), 535-555.
Koop, G., Pesaran, M. H., & Potter, S. M. (1996). Impulse response analysis in nonlinear multivariate models. Journal of Econometrics, 74(1), 119-147.
Pesaran, H. H., & Shin, Y. (1998). Generalized impulse response analysis in linear multivariate models. Economics Letters, 58(1), 17-29.
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) fevd = FEVD(Phi=fit$B, Sigma=fit$Q, nfore=10, type="time", generalized=TRUE)$FEVD
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) fevd = FEVD(Phi=fit$B, Sigma=fit$Q, nfore=10, type="time", generalized=TRUE)$FEVD
This function calculates the Baruník and Křehlík (2018) frequency connectedness measures.
FrequencyConnectedness( Phi, Sigma, nfore = 100, partition = c(pi, pi/2, 0), generalized = TRUE, orth = FALSE, scenario = "ABS", corrected = FALSE )
FrequencyConnectedness( Phi, Sigma, nfore = 100, partition = c(pi, pi/2, 0), generalized = TRUE, orth = FALSE, scenario = "ABS", corrected = FALSE )
Phi |
VAR coefficient matrix |
Sigma |
Residual variance-covariance matrix |
nfore |
H-step ahead forecast horizon |
partition |
Frequency spectrum |
generalized |
Orthorgonalized/generalized FEVD |
orth |
Orthorgonalized shocks |
scenario |
ABS or WTH |
corrected |
Boolean value whether corrected or standard TCI should be computed |
Get connectedness measures
David Gabauer
Baruník, J., & Křehlík, T. (2018). Measuring the frequency dynamics of financial connectedness and systemic risk. Journal of Financial Econometrics, 16(2), 271-296.
data("dy2012") partition = c(pi+0.00001, pi/4, 0) fit = VAR(dy2012, configuration=list(nlag=4)) dca = FrequencyConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=100, partition=partition)
data("dy2012") partition = c(pi+0.00001, pi/4, 0) fit = VAR(dy2012, configuration=list(nlag=4)) dca = FrequencyConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=100, partition=partition)
For detailed information see: Gabauer, D. (2020). Volatility impulse response analysis for DCC-GARCH models: The role of volatility transmission mechanisms. Journal of Forecasting, 39(5), 788-796.
data(g2020)
data(g2020)
zoo data.frame
This function estimates and evaluates a combination of GARCH models with different distributions and suggests the best GARCH models among all alternatives given some test statistics
GARCHselection( x, distributions = c("norm", "snorm", "std", "sstd", "ged", "sged"), models = c("sGARCH", "eGARCH", "gjrGARCH", "iGARCH", "TGARCH", "AVGARCH", "NGARCH", "NAGARCH", "APARCH", "ALLGARCH"), prob = 0.05, conf.level = 0.9, lag = 20, ar = 0, ma = 0 )
GARCHselection( x, distributions = c("norm", "snorm", "std", "sstd", "ged", "sged"), models = c("sGARCH", "eGARCH", "gjrGARCH", "iGARCH", "TGARCH", "AVGARCH", "NGARCH", "NAGARCH", "APARCH", "ALLGARCH"), prob = 0.05, conf.level = 0.9, lag = 20, ar = 0, ma = 0 )
x |
zoo data matrix |
distributions |
Vector of distributions |
models |
Vector of GARCH models |
prob |
The quantile (coverage) used for the VaR. |
conf.level |
Confidence level of VaR test statistics |
lag |
Lag length of weighted Portmanteau statistics |
ar |
AR(p) |
ma |
MA(q) |
Get optimal univariate GARCH model specification
David Gabauer
Ghalanos, A. (2014). rugarch: Univariate GARCH models, R package version 1.3-3.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2021). The impact of Euro through time: Exchange rate dynamics under different regimes. International Journal of Finance & Economics, 26(1), 1375-1408.
This function provides the results of multiple univariate GARCH test statistics
GARCHtests(fit, lag = 20, prob = 0.05, conf.level = 0.9)
GARCHtests(fit, lag = 20, prob = 0.05, conf.level = 0.9)
fit |
Fitted univariate GARCH |
lag |
Lag length of weighted Portmanteau statistics |
prob |
The quantile (coverage) used for the VaR. |
conf.level |
Confidence level of VaR test statistics |
Get best univariate GARCH
David Gabauer
Ghalanos, A. (2014). rugarch: Univariate GARCH models, R package version 1.3-3.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2021). The impact of Euro through time: Exchange rate dynamics under different regimes. International Journal of Finance & Economics, 26(1), 1375-1408.
For detailed information see: Chatziantoniou, I., Abakah, E. J., Gabauer, D., & Tiwari, A. K. (2022). Quantile time-frequency price connectedness between green bond, green equity, sustainable investments and clean energy markets: Implications for eco-friendly investors. Available at SSRN 3970746.
data(gcat2022)
data(gcat2022)
zoo data.frame
For detailed information see, Gabauer, D., & Gupta, R. (2018). On the transmission mechanism of country-specific and international economic uncertainty spillovers: Evidence from a TVP-VAR connectedness decomposition approach. Economics Letters, 171, 63-71.
data(gg2018)
data(gg2018)
zoo data.frame
For detailed information see: Gabauer, D., Gupta, R., Marfatia, H., and Miller, S. M. (2020). Estimating us housing price network connectedness: Evidence from dynamic elastic net, lasso, and ridge vector autoregressive models.
data(gghm2022)
data(gghm2022)
zoo data.frame
This function calculates the hedge ratios of Kroner and Sultan (1993)
HedgeRatio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
HedgeRatio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
H |
Residual variance-covariance, correlation or pairwise connectedness matrix |
method |
Cumulative sum or cumulative product |
statistics |
Hedging effectiveness statistic |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get hedge ratios
David Gabauer
Kroner, K. F., & Sultan, J. (1993). Time-varying distributions and dynamic hedging with foreign currency futures. Journal of Financial and Quantitative Analysis, 28(4), 535-551.
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) hr = HedgeRatio(g2020/100, fit$Q) hr$TABLE
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) hr = HedgeRatio(g2020/100, fit$Q) hr$TABLE
This function results in inclusive connectedness measures
InclusiveConnectedness(dca, group = c(1, 2), start = NULL, end = NULL)
InclusiveConnectedness(dca, group = c(1, 2), start = NULL, end = NULL)
dca |
Dynamic connectedness object |
group |
Vector of group indices |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Chatziantoniou, I., Elsayed, A. H., Gabauer, D., & Gozgor, G. (2023). Oil price shocks and exchange rate dynamics: Evidence from decomposed and partial connectedness measures for oil importing and exporting economies. Energy Economics, 120, 106627.
data("cegg2022") dca = ConnectednessApproach(cegg2022, model="VAR", connectedness="Time", nlag=1, nfore=20, corrected=TRUE) inc = InclusiveConnectedness(dca, group=c(1,2,3))
data("cegg2022") dca = ConnectednessApproach(cegg2022, model="VAR", connectedness="Time", nlag=1, nfore=20, corrected=TRUE) inc = InclusiveConnectedness(dca, group=c(1,2,3))
This function provides internal connectedness measures
InternalConnectedness( dca, groups = list(c(1), c(2:ncol(dca$NET))), start = NULL, end = NULL )
InternalConnectedness( dca, groups = list(c(1), c(2:ncol(dca$NET))), start = NULL, end = NULL )
dca |
Dynamic connectedness object |
groups |
List of at least two group vectors |
start |
Start index |
end |
End index |
Get connectedness measures
David Gabauer
Gabauer, D., & Gupta, R. (2018). On the transmission mechanism of country-specific and international economic uncertainty spillovers: Evidence from a TVP-VAR connectedness decomposition approach. Economics Letters, 171, 63-71.
data("gg2018") dca = ConnectednessApproach(gg2018, nlag=1, nfore=10, window.size=200, model="VAR", connectedness="Time") int = InternalConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
data("gg2018") dca = ConnectednessApproach(gg2018, nlag=1, nfore=10, window.size=200, model="VAR", connectedness="Time") int = InternalConnectedness(dca, groups=list("US"=c(1,2,3,4), "JP"=c(5,6,7,8)))
This function calculates orthorgonalized/generalized impulse response functions of time or frequency domain.
IRF(Phi, Sigma, nfore = 10, orth = TRUE)
IRF(Phi, Sigma, nfore = 10, orth = TRUE)
Phi |
VAR coefficient matrix |
Sigma |
Residual Variance-Covariance Matrix |
nfore |
H-step ahead forecast horizon |
orth |
Boolean |
Orthorgonal/generalized time/frequency impulse response functions
David Gabauer
Stiassny, A. (1996). A spectral decomposition for structural VAR models. Empirical Economics, 21(4), 535-555.
Koop, G., Pesaran, M. H., & Potter, S. M. (1996). Impulse response analysis in nonlinear multivariate models. Journal of Econometrics, 74(1), 119-147.
Pesaran, H. H., & Shin, Y. (1998). Generalized impulse response analysis in linear multivariate models. Economics Letters, 58(1), 17-29.
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) irf = IRF(Phi=fit$B, Sigma=fit$Q, nfore=10, orth=TRUE)
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) irf = IRF(Phi=fit$B, Sigma=fit$Q, nfore=10, orth=TRUE)
For detailed information see: Juncal, C., Chatziantoniou, I., Gabauer, D., De Gracia, F. P., & Hardik, M. (2022). Dynamic spillovers across precious metals and energy realized volatilities: Evidence from quantile extended joint connectedness measures.
data(jcggh2022)
data(jcggh2022)
zoo data.frame
This function calculates the Lastrapes and Wiesen (2021) joint connectedness measures.
JointConnectedness(Phi, Sigma, nfore)
JointConnectedness(Phi, Sigma, nfore)
Phi |
VAR coefficient matrix |
Sigma |
Residual variance-covariance matrix |
nfore |
H-step ahead forecast horizon |
Get connectedness measures
David Gabauer
Lastrapes, W. D., & Wiesen, T. F. (2021). The joint spillover index. Economic Modelling, 94, 681-691.
data("lw2021") fit = VAR(lw2021, configuration=list(nlag=2)) dca = JointConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=30) dca$TABLE
data("lw2021") fit = VAR(lw2021, configuration=list(nlag=2)) dca = JointConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=30) dca$TABLE
Estimation of a LAD VAR using equation-by-equation LAD regressions.
LADVAR(x, configuration = list(nlag = 1))
LADVAR(x, configuration = list(nlag = 1))
x |
zoo data matrix |
configuration |
model configuration |
nlag |
Lag length |
Estimate LAD VAR model
David Gabauer
data("dy2012") fit = LADVAR(dy2012, configuration=list(nlag=1))
data("dy2012") fit = LADVAR(dy2012, configuration=list(nlag=1))
For detailed information see: Lastrapes, W. D., & Wiesen, T. F. (2021). The joint spillover index. Economic Modelling, 94, 681-691.
data(lw2021)
data(lw2021)
zoo data.frame
This function calculates the minimum connectedness portfolio
MinimumConnectednessPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), long = TRUE, metric = "StdDev", digit = 2 )
MinimumConnectednessPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), long = TRUE, metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
H |
Pairwise connectedness matrix or alternatively variance-covariance or correlation matrix |
method |
Cumulative sum or cumulative product |
statistics |
Hedging effectiveness statistic |
long |
Allow only long portfolio position |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get portfolio weights
David Gabauer
Broadstock, D. C., Chatziantoniou, I., & Gabauer, D. (2022). Minimum connectedness portfolios and the market for green bonds: Advocating socially responsible investment (SRI) activity. In Applications in Energy Finance (pp. 217-253). Palgrave Macmillan, Cham.
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) dca = TimeConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=10, generalized=TRUE) mcp = MinimumConnectednessPortfolio(g2020/100, dca$PCI, statistics="Fisher") mcp$TABLE
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) dca = TimeConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=10, generalized=TRUE) mcp = MinimumConnectednessPortfolio(g2020/100, dca$PCI, statistics="Fisher") mcp$TABLE
Get Minnesota Prior
MinnesotaPrior(gamma = 0.1, k, nlag)
MinnesotaPrior(gamma = 0.1, k, nlag)
gamma |
Diagonal value of variance-covariance matrix |
k |
Number of series |
nlag |
Lag length |
Get Minnesota Prior
David Gabauer
Koop, G., & Korobilis, D. (2010). Bayesian multivariate time series methods for empirical macroeconomics. Now Publishers Inc.
prior = MinnesotaPrior(0.1, k=4, nlag=1)
prior = MinnesotaPrior(0.1, k=4, nlag=1)
This function calculates the multivariate hedging portfolio of Cocca et al. (2024)
MultivariateHedgingPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
MultivariateHedgingPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
H |
Residual variance-covariance, correlation or pairwise connectedness matrix |
method |
Cumulative sum or cumulative product |
statistics |
Hedging effectiveness statistic |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get hedge ratios
David Gabauer
Cocca, T., Gabauer, D., & Pomberger, S. (2024). Clean energy market connectedness and investment strategies: New evidence from DCC-GARCH R2 decomposed connectedness measures. Energy Economics.
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) mhp = MultivariateHedgingPortfolio(g2020/100, fit$Q) mhp$TABLE
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) mhp = MultivariateHedgingPortfolio(g2020/100, fit$Q) mhp$TABLE
Get partial contemporaneous correlations
PartialCorrelations(Q)
PartialCorrelations(Q)
Q |
variance-covariance matrix |
Get partial contemporaneous correlations
David Gabauer
Dahlhaus, R., & Eichler, M. (2003). Causality and graphical models in time series analysis. Oxford Statistical Science Series, 115-137.
data(dy2012) fit = VAR(dy2012, configuration=list(nlag=1)) pcc = PartialCorrelations(fit$Q)
data(dy2012) fit = VAR(dy2012, configuration=list(nlag=1)) pcc = PartialCorrelations(fit$Q)
Visualize dynamic from total directional connectedness
PlotFROM( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
PlotFROM( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Visualize dynamic influence connectedness
PlotINF( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
PlotINF( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
selection |
Indidcator of the illustrated series |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphidcal parameters (see par). |
Return connectedness plot
Visualize dynamic net total directional connectedness
PlotNET( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
PlotNET( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Visualize net pairwise or pairwise connectedness measures
PlotNetwork( dca, method = "NPDC", path = NULL, name_length = NULL, threshold = 0, width = 10, height = 10, ... )
PlotNetwork( dca, method = "NPDC", path = NULL, name_length = NULL, threshold = 0, width = 10, height = 10, ... )
dca |
Connectedness object |
method |
Either visualizing NPDC or PCI |
path |
Path where plots should be saved |
name_length |
Length of variable names in the network plot |
threshold |
Threshold for bivariate connections between 0 and 1 |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Visualize dynamic net pairwise connectedness
PlotNPDC( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
PlotNPDC( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
selection |
Indicator of the illustrated series |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Visualize dynamic net total directional connectedness
PlotNPT(dca, ca = NULL, path = NULL, width = 10, height = 7, ...)
PlotNPT(dca, ca = NULL, path = NULL, width = 10, height = 7, ...)
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphidcal parameters (see par). |
Return connectedness plot
Visualize dynamic pairwise connectedness
PlotPCI( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
PlotPCI( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), selection = NULL, width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
selection |
Indidcator of the illustrated series |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphidcal parameters (see par). |
Return connectedness plot
Visualize dynamic total connectedness
PlotTCI( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 5, ... )
PlotTCI( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 5, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Visualize dynamic to total directional connectedness
PlotTO( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
PlotTO( dca, ca = NULL, path = NULL, ylim = c(NULL, NULL), width = 10, height = 7, ... )
dca |
Connectedness object |
ca |
Compare dca object with a single connectedness object or a list of of connectedness objects |
path |
Path where plots should be saved |
ylim |
A vector including the lower and upper limit of the y-axis |
width |
The width of the graphics region in inches |
height |
The height of the graphics region in inches |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
Return connectedness plot
Estimation of a QVAR using equation-by-equation quantile regressions.
QVAR(x, configuration = list(nlag = 1, tau = 0.5, method = "fn"))
QVAR(x, configuration = list(nlag = 1, tau = 0.5, method = "fn"))
x |
zoo data matrix |
configuration |
model configuration |
nlag |
Lag length |
tau |
quantile between 0 and 1 |
method |
See methods for rq in quantreg package. Default is "fn". |
Estimate QVAR model
David Gabauer
White, H., Kim, T. H., & Manganelli, S. (2015). VAR for VaR: Measuring tail dependence using multivariate regression quantiles. Journal of Econometrics, 187(1), 169-188.
Chatziantoniou, I., Gabauer, D., & Stenfors, A. (2021). Interest rate swaps and the transmission mechanism of monetary policy: A quantile connectedness approach. Economics Letters, 204, 109891.
data("dy2012") fit = QVAR(dy2012, configuration=list(nlag=1, tau=0.5))
data("dy2012") fit = QVAR(dy2012, configuration=list(nlag=1, tau=0.5))
This function computes the R2 connectedness measures
R2Connectedness( x, window.size = NULL, nlag = 0, method = "pearson", relative = FALSE, corrected = FALSE )
R2Connectedness( x, window.size = NULL, nlag = 0, method = "pearson", relative = FALSE, corrected = FALSE )
x |
zoo data matrix |
window.size |
Rolling-window size or Bayes Prior sample size |
nlag |
Lag length |
method |
"pearson", "spearman", or "kendall". "pearson" is default. |
relative |
Boolean whether relative or absolute R2 should be used |
corrected |
Boolean value whether corrected or standard TCI should be computed |
Get R2 connectedness measures
David Gabauer
Naeem, M. A., Chatziantoniou, I., Gabauer, D., & Karim, S. (2023). Measuring the G20 Stock Market Return Transmission Mechanism: Evidence From the R2 Connectedness Approach. International Review of Financial Analysis.
Balli, F., Balli, H. O., Dang, T. H. N., & Gabauer, D. (2023). Contemporaneous and lagged R2 decomposed connectedness approach: New evidence from the energy futures market. Finance Research Letters, 57, 104168.
data("dy2012") dca = R2Connectedness(dy2012, window.size=NULL, nlag=0, method="pearson") dca$TABLE
data("dy2012") dca = R2Connectedness(dy2012, window.size=NULL, nlag=0, method="pearson") dca$TABLE
This function computes the R2 decomposed connectedness measures from correlations
R2Correlations(R)
R2Correlations(R)
R |
zoo correlation data matrix |
Get R2 connectedness measures from correlation matrix
David Gabauer
Naeem, M. A., Chatziantoniou, I., Gabauer, D., & Karim, S. (2023). Measuring the G20 Stock Market Return Transmission Mechanism: Evidence From the R2 Connectedness Approach. International Review of Financial Analysis.
Balli, F., Balli, H. O., Dang, T. H. N., & Gabauer, D. (2023). Contemporaneous and lagged R2 decomposed connectedness approach: New evidence from the energy futures market. Finance Research Letters, 57, 104168.
This function calculates the minimum connectedness portfolio
RiskParityPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), long = TRUE, metric = "StdDev", digit = 2 )
RiskParityPortfolio( x, H, method = c("cumsum", "cumprod"), statistics = c("Fisher", "Bartlett", "Fligner-Killeen", "Levene", "Brown-Forsythe"), long = TRUE, metric = "StdDev", digit = 2 )
x |
zoo return matrix (in percentage) |
H |
Pairwise connectedness matrix or alternatively variance-covariance or correlation matrix |
method |
Cumulative sum or cumulative product |
statistics |
Hedging effectiveness statistic |
long |
Allow only long portfolio position |
metric |
Risk measure of Sharpe Ratio (StdDev, VaR, or CVaR) |
digit |
Number of decimal places |
Get portfolio weights
David Gabauer
Ederington, L. H. (1979). The hedging performance of the new futures markets. The Journal of Finance, 34(1), 157-170.
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) mcp = RiskParityPortfolio(g2020/100, fit$Q, statistics="Fisher") mcp$TABLE
data("g2020") fit = VAR(g2020, configuration=list(nlag=1)) mcp = RiskParityPortfolio(g2020/100, fit$Q, statistics="Fisher") mcp$TABLE
Get comprehensive summary statistics
SummaryStatistics( x, portmanteau = c("Ljung-Box", "Box-Pierce", "Monti"), correlation = c("kendall", "spearman", "pearson"), nlag = 20, digit = 3 )
SummaryStatistics( x, portmanteau = c("Ljung-Box", "Box-Pierce", "Monti"), correlation = c("kendall", "spearman", "pearson"), nlag = 20, digit = 3 )
x |
zoo data matrix |
portmanteau |
portmanteau statistics: "Box-Pierce", "Ljung-Box", "Monti" |
correlation |
correlation coefficient: "pearson", "kendall", "spearman". |
nlag |
number of lags for Weighted Portmanteau statistics |
digit |
digit Number of decimal places |
Get summary statistics
David Gabauer
data(dy2012) SummaryStatistics(dy2012)
data(dy2012) SummaryStatistics(dy2012)
This function allows to calculate the Diebold and Yilmaz (2009, 2012) connectedness measures.
TimeConnectedness( Phi = NULL, Sigma = NULL, nfore = 10, generalized = TRUE, corrected = FALSE, FEVD = NULL )
TimeConnectedness( Phi = NULL, Sigma = NULL, nfore = 10, generalized = TRUE, corrected = FALSE, FEVD = NULL )
Phi |
VAR coefficient matrix |
Sigma |
Residual variance-covariance matrix |
nfore |
H-step ahead forecast horizon |
generalized |
Orthorgonalized/generalized FEVD |
corrected |
Boolean value whether corrected or standard TCI should be computed |
FEVD |
Alternatively, to provide Phi and Sigma it is also possible to use FEVD directly. |
Get connectedness measures
David Gabauer
Diebold, F. X., & Yilmaz, K. (2009). Measuring financial asset return and volatility spillovers, with application to global equity markets. The Economic Journal, 119(534), 158-171.
Diebold, F. X., & Yilmaz, K. (2012). Better to give than to receive: Predictive directional measurement of volatility spillovers. International Journal of Forecasting, 28(1), 57-66.
#Replication of DY2012 data("dy2012") fit = VAR(dy2012, configuration=list(nlag=4)) dca = TimeConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=10, generalized=TRUE) dca$TABLE
#Replication of DY2012 data("dy2012") fit = VAR(dy2012, configuration=list(nlag=4)) dca = TimeConnectedness(Phi=fit$B, Sigma=fit$Q, nfore=10, generalized=TRUE) dca$TABLE
Estimate TVP-VAR model
TVPVAR(x, configuration = list(l = c(0.99, 0.99), nlag = 1, prior = NULL))
TVPVAR(x, configuration = list(l = c(0.99, 0.99), nlag = 1, prior = NULL))
x |
zoo data matrix |
configuration |
model configuration |
nlag |
Lag length |
prior |
List of prior VAR coefficients and variance-covariance matrix |
l |
forgetting factors (kappa1, kappa2) |
Estimate TVP-VAR model
David Gabauer
Koop, G., & Korobilis, D. (2014). A new index of financial conditions. European Economic Review, 71, 101-116.
Antonakakis, N., Chatziantoniou, I., & Gabauer, D. (2020). Refined measures of dynamic connectedness based on time-varying parameter vector autoregressions. Journal of Risk and Financial Management, 13(4), 84.
data("dy2012") prior = BayesPrior(dy2012, nlag=1) fit = TVPVAR(dy2012, configuration=list(nlag=1, prior=prior, l=c(0.99,0.99)))
data("dy2012") prior = BayesPrior(dy2012, nlag=1) fit = TVPVAR(dy2012, configuration=list(nlag=1, prior=prior, l=c(0.99,0.99)))
Get Uninformative Prior
UninformativePrior(k, nlag)
UninformativePrior(k, nlag)
k |
Number of series |
nlag |
Lag length |
Get Uninformative Prior
David Gabauer
Koop, G., & Korobilis, D. (2010). Bayesian multivariate time series methods for empirical macroeconomics. Now Publishers Inc.
prior = UninformativePrior(k=4, nlag=1)
prior = UninformativePrior(k=4, nlag=1)
Estimation of a VAR using equation-by-equation OLS regressions.
VAR(x, configuration = list(nlag = 1))
VAR(x, configuration = list(nlag = 1))
x |
zoo data matrix |
configuration |
model configuration |
nlag |
Lag length |
Estimate VAR model
David Gabauer
Sims, C. A. (1980). Macroeconomics and reality. Econometrica, 1-48.
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1))
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1))
VarianceTest performs variance homogeneity tests including Ftest, Bartlett, Brown-Forsythe and Fligner-Killeen tests.
VarianceTest( formula, data, alpha = 0.05, method = c("Bartlett", "Brown-Forsythe", "Fligner-Killeen", "Fisher", "Levene"), na.rm = TRUE )
VarianceTest( formula, data, alpha = 0.05, method = c("Bartlett", "Brown-Forsythe", "Fligner-Killeen", "Fisher", "Levene"), na.rm = TRUE )
formula |
a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups. |
data |
a tibble or data frame containing the variables in the formula formula |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
method |
a character string to select one of the variance homogeneity tests: "Bartlett", "Brown-Forsythe", "Fisher" and "Fligner-Killeen". |
na.rm |
Ha logical value indicating whether NA values should be stripped before the computation proceeds. |
Get bivariate portfolio weights
David Gabauer
Antonakakis, N., Cunado, J., Filis, G., Gabauer, D., & de Gracia, F. P. (2020). Oil and asset classes implied volatilities: Investment strategies and hedging effectiveness. Energy Economics, 91, 104762.
This function provides the volatility impulse responses and the forecast error variance decomposition of DCC-GARCH models.
VFEVD(fit, nfore = 100, standardize = FALSE)
VFEVD(fit, nfore = 100, standardize = FALSE)
fit |
Fitted DCC-GARCH model |
nfore |
H-step ahead forecast horizon |
standardize |
Boolean value whether GIRF should be standardized |
Get volatility impulse response functions and forecast error variance decomposition
David Gabauer
Gabauer, D. (2020). Volatility impulse response analysis for DCC‐GARCH models: The role of volatility transmission mechanisms. Journal of Forecasting, 39(5), 788-796.
Weighted portmanteau tests for testing the null hypothesis of adequate ARMA fit and/or for detecting nonlinear processes. Written in the style of Box.test() and is capable of performing the traditional Box Pierce (1970), Ljung Box (1978) or Monti (1994) tests.
WeightedBoxTest( x, lag = 1, type = c("Box-Pierce", "Ljung-Box", "Monti"), fitdf = 0, sqrd.res = FALSE, log.sqrd.res = FALSE, abs.res = FALSE, weighted = TRUE )
WeightedBoxTest( x, lag = 1, type = c("Box-Pierce", "Ljung-Box", "Monti"), fitdf = 0, sqrd.res = FALSE, log.sqrd.res = FALSE, abs.res = FALSE, weighted = TRUE )
x |
a numeric vector or univariate time series, or residuals of a fitted time series |
lag |
the statistic will be based on lag autocorrelation coefficients. lag=1 by default |
type |
test to be performed, partial matching is used. "Box-Pierce" by default |
fitdf |
number of degrees of freedom to be subtracted if x is a series of residuals, set at 0 by default |
sqrd.res |
A flag, should the series/residuals be squared to detect for nonlinear effects?, FALSE by default |
log.sqrd.res |
A flag, should a log of the squared series/residuals be used to detect for nonlinear effects? FALSE by default |
abs.res |
A flag, should the absolute series or residuals be used to detect for nonlinear effects? FALSE by default |
weighted |
A flag determining if the weighting scheme should be utilized. TRUE by default. If set to FALSE, the traditional test is performed with no weights |
Get Uninformative Prior
David Gabauer
Box, G. E. P. and Pierce, D. A. (1970), Distribution of residual correlations in autoregressive-integrated moving average time series models. Journal of the American Statistical Association, 65, 1509-1526.
Fisher, T. J. and Gallagher, C. M. (2012), New Weighted Portmanteau Statistics for Time Series Goodness-of-Fit Testing. Journal of the American Statistical Association, accepted.
Ljung, G. M. and Box, G. E. P. (1978), On a measure of lack of fit in time series models. Biometrika 65, 297-303.
Mahdi, E. and McLeod, A. I. (2012), Improved multivariate portmanteau test. Journal of Time Series Analysis 65(2), 297-303.
Monti, A. C. (1994), A proposal for a residual autocorrelation test in linear models. Biometrika 81(4), 776-780.
Pena, D. and Rodriguez, J. (2002) A powerful portmanteau test of lack of fit for time series. Journal of the American Statistical Association 97(458), 601-610.
Transform VAR to VMA coefficients
Wold(x, nfore = 10)
Wold(x, nfore = 10)
x |
VAR coefficients |
nfore |
H-step ahead forecast horizon |
Get VMA coefficients
David Gabauer
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) wold = Wold(fit$B, nfore=10)
data("dy2012") fit = VAR(dy2012, configuration=list(nlag=1)) wold = Wold(fit$B, nfore=10)