data("bcg2022")

NAMES = colnames(bcg2022)
k = ncol(bcg2022)
Y = bcg2022[-1,]
for (i in 1:k) {
  Y[,i] = 100*diff(log(as.numeric(bcg2022[,i])))
}

# SUMMARY STATISTICS
kable(SummaryStatistics(Y, correlation="pearson"))
US.Green.Bond US.Black.Bond EU.Green.Bond EU.Black.Bond CN.Green.Bond CN.Black.Bond
Mean 0.017* 0.013** 0.011* 0.008 0.015*** 0.015**
(0.053) (0.015) (0.099) (0.158) (0.000) (0.040)
Variance 0.086*** 0.036*** 0.053*** 0.036*** 0.006*** 0.061***
Skewness -0.895*** -0.808*** -1.092*** -0.824*** -1.271*** 0.168**
(0.000) (0.000) (0.000) (0.000) (0.000) (0.019)
Ex.Kurtosis 10.586*** 10.003*** 8.911*** 6.645*** 29.503*** 3.442***
(0.000) (0.000) (0.000) (0.000) (0.000) (0.000)
JB 5628.833*** 5013.559*** 4110.425*** 2288.532*** 42822.697*** 584.175***
(0.000) (0.000) (0.000) (0.000) (0.000) (0.000)
ERS -10.344*** -13.930*** -8.071*** -13.414*** -5.806*** -12.005***
(0.000) (0.000) (0.000) (0.000) (0.000) (0.000)
Q(20) 70.917*** 33.112*** 27.241*** 25.708*** 105.537*** 23.452***
(0.000) (0.000) (0.001) (0.001) (0.000) (0.004)
Q2(20) 469.423*** 1253.746*** 747.621*** 728.895*** 47.643*** 32.941***
(0.000) (0.000) (0.000) (0.000) (0.000) (0.000)
pearson US.Green.Bond US.Black.Bond EU.Green.Bond EU.Black.Bond CN.Green.Bond CN.Black.Bond
US.Green.Bond 1.000*** 0.541*** 0.480*** 0.475*** 0.010 0.313***
US.Black.Bond 0.541*** 1.000*** 0.566*** 0.517*** 0.027 0.025
EU.Green.Bond 0.480*** 0.566*** 1.000*** 0.941*** 0.013 0.049
EU.Black.Bond 0.475*** 0.517*** 0.941*** 1.000*** 0.003 0.055
CN.Green.Bond 0.010 0.027 0.013 0.003 1.000*** 0.082***
CN.Black.Bond 0.313*** 0.025 0.049 0.055 0.082*** 1.000***
nlag = 1
nfore = 20
prior = BayesPrior(Y, nlag=nlag)
fit = TVPVAR(Y, configuration=list(l=c(0.99,0.99), nlag=nlag, prior=prior))
dca = TimeConnectedness(Phi=fit$B_t, Sigma=fit$Q_t, nfore=nfore, corrected=TRUE)
kable(dca$TABLE)
US.Green.Bond US.Black.Bond EU.Green.Bond EU.Black.Bond CN.Green.Bond CN.Black.Bond FROM
US.Green.Bond 57.96 16.28 9.33 9.55 0.32 6.55 42.04
US.Black.Bond 14.91 52.62 17.21 13.88 0.45 0.92 47.38
EU.Green.Bond 7.43 14.10 41.86 35.83 0.25 0.53 58.14
EU.Black.Bond 7.59 11.67 36.71 43.28 0.28 0.48 56.72
CN.Green.Bond 0.95 1.16 1.09 1.12 92.17 3.51 7.83
CN.Black.Bond 13.02 4.28 1.52 1.44 1.65 78.09 21.91
TO 43.90 47.50 65.86 61.82 2.94 12.00 234.01
Inc.Own 101.86 100.12 107.72 105.10 95.12 90.09 cTCI/TCI
NET 1.86 0.12 7.72 5.10 -4.88 -9.91 46.80/39.00
NPT 2.00 3.00 5.00 4.00 0.00 1.00

Figure 3: Dynamic Total Connectedness

PlotTCI(dca, ylim=c(20,60))

Figure 4: Net Total Directional Connectedness

PlotNET(dca, ylim=c(-20,20))

Figure 5: Net Pairwise Directional Connectedness

PlotNPDC(dca, ylim=c(-10,15))

Multivariate Portfolios

k = 4
y = Y[,1:k]
date = index(y)
Q_t = fit$Q_t[1:k,1:k,]
R_t = ConditionalCorrelation(Q_t)
C_t = dca$PCI[1:k,1:k,]

# Minimum Variance Portfolio
mvp = MinimumConnectednessPortfolio(y, Q_t)
kable(mvp$TABLE)
Mean Std.Dev. 5% 95% HE p-value
US.Green.Bond 0.04 0.05 0.00 0.14 0.69 0.00
US.Black.Bond 0.35 0.10 0.23 0.57 0.25 0.00
EU.Green.Bond 0.02 0.08 0.00 0.27 0.49 0.00
EU.Black.Bond 0.59 0.14 0.16 0.69 0.25 0.00
# Minimum Correlation Portfolio
mcp = MinimumConnectednessPortfolio(y, R_t)
kable(mcp$TABLE)
Mean Std.Dev. 5% 95% HE p-value
US.Green.Bond 0.35 0.06 0.21 0.40 0.63 0.00
US.Black.Bond 0.26 0.06 0.17 0.38 0.10 0.09
EU.Green.Bond 0.11 0.08 0.00 0.22 0.39 0.00
EU.Black.Bond 0.28 0.07 0.18 0.42 0.10 0.07
# Minimum Connectedness Portfolio
mpc = MinimumConnectednessPortfolio(y, C_t)
kable(mpc$TABLE)
Mean Std.Dev. 5% 95% HE p-value
US.Green.Bond 0.34 0.07 0.18 0.40 0.63 0.00
US.Black.Bond 0.26 0.04 0.20 0.34 0.11 0.04
EU.Green.Bond 0.09 0.08 0.00 0.23 0.40 0.00
EU.Black.Bond 0.31 0.10 0.15 0.49 0.12 0.03

Weights

par(mfcol=c(4,3), oma=c(.5,.75,0,0)+0.1, mar=c(.5,.5,.5,.5)+1, mgp=c(.5, .5, 0))
for (i in 1:k) {
  plot(date, mvp$portfolio_weights[,i], type="l", las=1, ylim=c(0,0.8), xaxs="i", xlab="", ylab="", col="steelblue4", main=paste("MVP", NAMES[i])); grid(NA, NULL)
  plot(date, mcp$portfolio_weights[,i], type="l", las=1, ylim=c(0,0.8), xaxs="i", xlab="", ylab="", col="steelblue4", main=paste("MCP", NAMES[i])); grid(NA, NULL)
  plot(date, mpc$portfolio_weights[,i], type="l", las=1, ylim=c(0,0.8), xaxs="i", xlab="", ylab="", col="steelblue4", main=paste("MCoP",NAMES[i])); grid(NA, NULL)
}

Cumulative Returns

par(mfrow=c(1,1))
plot(date, mcp$cumulative_portfolio_return, type="l", las=1, xaxs="i", xlab="", ylab="", col="red")
grid(NA, NULL); abline(h=0, lty=3)
lines(date, mpc$cumulative_portfolio_return, col="steelblue1")
lines(date, mvp$cumulative_portfolio_return, col="steelblue4")
legend("topleft", c("MVP","MCP","MCoP"), fill=c("steelblue4", "red", "steelblue1"), bty="n")

Bivariate Portfolios

bpw = BivariatePortfolio(y, Q_t)
kable(bpw$TABLE)
Mean Std.Dev. 5% 95% HE p-value
US.Green.Bond/US.Black.Bond 0.14 0.12 0.00 0.38 0.61 0.25
US.Green.Bond/EU.Green.Bond 0.32 0.15 0.12 0.66 0.49 0.00
US.Green.Bond/EU.Black.Bond 0.19 0.12 0.04 0.46 0.62 0.10
US.Black.Bond/US.Green.Bond 0.86 0.12 0.62 1.00 0.06 0.00
US.Black.Bond/EU.Green.Bond 0.71 0.10 0.56 0.87 0.11 0.00
US.Black.Bond/EU.Black.Bond 0.51 0.08 0.37 0.62 0.26 0.00
EU.Green.Bond/US.Green.Bond 0.68 0.15 0.34 0.88 0.16 0.00
EU.Green.Bond/US.Black.Bond 0.29 0.10 0.13 0.44 0.40 0.04
EU.Green.Bond/EU.Black.Bond 0.06 0.20 0.00 0.79 0.32 0.91
EU.Black.Bond/US.Green.Bond 0.81 0.12 0.54 0.96 0.09 0.00
EU.Black.Bond/US.Black.Bond 0.49 0.08 0.38 0.63 0.27 0.00
EU.Black.Bond/EU.Green.Bond 0.94 0.20 0.21 1.00 0.01 0.00

Weights

par(mfcol=c(3,2), oma=c(.5,.75,0,0)+0.1, mar=c(.5,.5,.5,.5)+1, mgp=c(.5, .5, 0))
for (i in 1:k) {
  for (j in 1:k) {
    if (i>j) {
      plot(date, bpw$portfolio_weights[i,j,], type="l", las=1, ylim=c(0,1), xaxs="i", xlab="", ylab="", col="steelblue4", main=paste0(NAMES[i], '-', NAMES[j]))
      grid(NA, NULL); box(); abline(h=0, lty=3)
    }
  }
}

Cumulative Returns

par(mfcol=c(3,2), oma=c(.5,.75,0,0)+0.1, mar=c(.5,.5,.5,.5)+1, mgp=c(.5, .5, 0))
for (i in 1:k) {
  for (j in 1:k) {
    if (i>j) {
      plot(date, bpw$cumulative_portfolio_return[i,j,], type="l", las=1, xaxs="i", xlab="", ylab="", col="steelblue4", main=paste0(NAMES[i], '-', NAMES[j]), ylim=c(min(bpw$cumulative_portfolio_return), max(bpw$cumulative_portfolio_return)))
      grid(NA, NULL); box(); abline(h=0, lty=3)
    }
  }
}

Hedge Ratios

hr = HedgeRatio(y, Q_t)
kable(hr$TABLE)
Mean Std.Dev. 5% 95% HE p-value
US.Green.Bond/US.Black.Bond 0.80 0.20 0.50 1.11 0.32 0.00
US.Green.Bond/EU.Green.Bond 0.50 0.21 0.15 0.79 0.28 0.00
US.Green.Bond/EU.Black.Bond 0.60 0.20 0.27 0.94 0.26 0.00
US.Black.Bond/US.Green.Bond 0.35 0.10 0.20 0.57 0.33 0.00
US.Black.Bond/EU.Green.Bond 0.47 0.05 0.40 0.56 0.35 0.00
US.Black.Bond/EU.Black.Bond 0.50 0.08 0.36 0.63 0.30 0.00
EU.Green.Bond/US.Green.Bond 0.32 0.16 0.08 0.61 0.28 0.00
EU.Green.Bond/US.Black.Bond 0.69 0.10 0.53 0.88 0.34 0.00
EU.Green.Bond/EU.Black.Bond 1.11 0.09 0.91 1.21 0.89 0.00
EU.Black.Bond/US.Green.Bond 0.28 0.12 0.10 0.49 0.26 0.00
EU.Black.Bond/US.Black.Bond 0.51 0.11 0.33 0.70 0.29 0.00
EU.Black.Bond/EU.Green.Bond 0.78 0.09 0.62 0.97 0.89 0.00
par(mfcol=c(k,k-1), oma=c(.5,.75,0,0)+0.1, mar=c(.5,.5,.5,.5)+1, mgp=c(.5, .5, 0))
for (i in 1:k) {
  for (j in 1:k) {
    if (i!=j) {
      plot(date, hr$hedge_ratio[i,j,], type="l", las=1, xaxs="i", xlab="", ylab="", col="steelblue4", main=paste0(NAMES[i], '-', NAMES[j]), ylim=c(min(hr$hedge_ratio),max(hr$hedge_ratio)))
      grid(NA, NULL); box(); abline(h=0, lty=3)
    }
  }
}

Cumulative Returns

par(mfcol=c(k,k-1), oma=c(.5,.75,0,0)+0.1, mar=c(.5,.5,.5,.5)+1, mgp=c(.5, .5, 0))
for (i in 1:k) {
  for (j in 1:k) {
    if (i!=j) {
      plot(date, hr$cumulative_portfolio_return[i,j,], type="l", las=1, xaxs="i", xlab="", ylab="", col="steelblue4", main=paste0(NAMES[i], '-', NAMES[j]), ylim=c(min(hr$cumulative_portfolio_return), max(hr$cumulative_portfolio_return)))
      grid(NA, NULL); box(); abline(h=0, lty=3)
    }
  }
}