View source: R/plot_directional_spillover.R
plotdy | R Documentation |
Plot directional spillover index
plotdy(
data,
direction = c("from", "to", "net", "net_pairwise", "from_to_pairwise")
)
data |
An object class |
direction |
A character string indicating the direction of the spillover, see Diebold and Yilmaz (2012) |
a ggplot2 object consisting of directional plots
Diebold, F. X. & Yilmaz, K.(2012). Better to Give than to Receive: Predictive Directional Measurement of Volatility Spillovers. International Journal of Forecasting.
library(Spillover)
require(tidyr)
require(dplyr)
require(ggplot2)
data(dy2012)
dy_results <- dynamic.spillover(data=dy2012, width=200, remove.own = FALSE)
pp_from <- plotdy(dy_results, direction = "from")
pp_from +
labs(title="Any title") +
facet_wrap(~variables, ncol = 2)
pp_to <- plotdy(dy_results, direction = "to")
pp_net <- plotdy(dy_results, direction = "net")
pp_netpairwise <- plotdy(dy_results, direction = "net_pairwise")
pp_from_to_pairwise <- plotdy(dy_results, direction = "from_to_pairwise")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.