## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 6.5,
  fig.height = 4
)

## ----libs---------------------------------------------------------------------
library(contagionchannels)

## ----wqte-call, eval = FALSE--------------------------------------------------
# F_mat <- compute_wqte_matrix(
#   returns   = my_returns_xts,
#   scale     = 5,
#   tau       = 0.50,
#   n_cores = 1,
# )

## ----iv-call, eval = FALSE----------------------------------------------------
# fit <- iv_2sls_attribute(
#   returns_period  = returns_pc,
#   channels_period = channels_pc,
#   links           = links_pc,
#   instruments     = list(
#     Trade           = "BDI_lag",
#     Financial       = "FRAOIS_lag",
#     Geopolitical    = "GPR_lag",
#     Behavioral      = "VIX_innov_lag",
#     Monetary_Policy = "ShadowRate_surp_lag"
#   ),
#   cluster_se = TRUE
# )

## ----lasso-call, eval = FALSE-------------------------------------------------
# fit_lasso <- lasso_iv_attribute(
#   returns_period  = returns_pc,
#   channels_period = channels_pc,
#   links           = links_pc,
#   candidate_Z     = candidate_instrument_grid,
#   selection       = "post_lasso"
# )

## ----lp-call, eval = FALSE----------------------------------------------------
# lp_fit <- local_projections(
#   returns_period  = returns_pc,
#   channels_period = channels_pc,
#   links           = links_pc,
#   horizons        = c(1, 5, 22),
#   controls        = c("VIX_lag", "USD_lag")
# )

## ----rigobon-call, eval = FALSE-----------------------------------------------
# rig_fit <- rigobon_id(
#   returns_period  = returns_pc,
#   channels_period = channels_pc,
#   links           = links_pc,
#   regime_split    = "vix_high_low"
# )

## ----rv-call, eval = FALSE----------------------------------------------------
# rv <- cinelli_hazlett_rv(
#   theta = fit$shares,
#   se    = fit$se,
#   df    = fit$df_residual
# )

## ----session------------------------------------------------------------------
sessionInfo()

