Skip to contents

Identify the main shock by targetting the forecast error variance contribution in the frequency domain.

Usage

id_fevdfd(
  x,
  target,
  freqs = c(0, 2 * pi),
  grid_size = 1000,
  freq_grid = NULL,
  sign = "positive",
  sign_horizon = 1
)

# S3 method for class 'varest'
id_fevdfd(
  x,
  target,
  freqs = c(0, 2 * pi),
  grid_size = 1000,
  freq_grid = NULL,
  sign = "positive",
  sign_horizon = 1
)

# S3 method for class 'varboot'
id_fevdfd(
  x,
  target,
  freqs = c(0, 2 * pi),
  grid_size = 1000,
  freq_grid = NULL,
  sign = "positive",
  sign_horizon = 1
)

# S3 method for class 'bvartools'
id_fevdfd(
  x,
  target,
  freqs = c(0, 2 * pi),
  grid_size = 1000,
  freq_grid = NULL,
  sign = "positive",
  sign_horizon = 1
)

# S3 method for class 'bvar'
id_fevdfd(
  x,
  target,
  freqs = c(0, 2 * pi),
  grid_size = 1000,
  freq_grid = NULL,
  sign = "positive",
  sign_horizon = 1
)

Arguments

x

either a vars::VARS or a BVAR::bvar object

target,

variable name or index to maximize its fev

freqs

vector of length 2 of min and max frequencies (0:2pi)

grid_size

how fine the grid to approximate the frequency domain

freq_grid

Default to NULL. Pass a vector of frequencies in c(0,2pi) to target those specific frequencies. Overides freqs and grid_size arguments.

sign

Default to "positive". Can be "negative". Ensures the cummulative impact of the main shock on the target variable is the given sign.

sign_horizon

Default to 1. The horizon through which to accumulate the impact of the shock.

Value

structural var

Examples

x <- svars::USA
v <- vars::VAR(x, p = 2)
mvar <- id_fevdfd(v, "pi", c(2 * pi / 32, 2 * pi / 6))