9  Uniform shocks

9.1 Overview

ems_uniform_shock() applies a homogeneous shock over an entire variable or a subset of its elements. The set arguments accepted in ... depend on the variable specified and the set mappings loaded in ems_data().

ems_uniform_shock(
  var,
  value,
  ...
)
Argument Type Description
var Character Variable name as it appears in the model file
value Numeric Shock applied to all targeted elements: a percentage change for a percent-change variable, an ordinary change for a change variable
... Named arguments Set-index pairs restricting the shock. Each value is a single element ("element"), multiple elements (c("a", "b")), or a named subset ("SUBSET")

9.2 Full variable uniform shocks

The simplest uniform shock is applied to a full variable, meaning that all combinations of sets associated with that variable are allocated the same exogenous value. In the example below, all regions (as determined by selected region mappings) will be increased by 1%.

pop_shk <- ems_uniform_shock(var = "pop",
                             value = 1
)

9.3 Partial variable uniform shocks

As with swaps, a uniform shock can be restricted to elements of the sets the variable is declared over, named by the set name concatenated with the variable’s index (REGr, ACTSa). To shock the region “chn” alone:

partial <- ems_uniform_shock(var = "aoall",
                             value = -1,
                             REGr = "chn"
)

Exogenous elements the shock does not name (here every region but “chn”) keep a zero change.

In an intertemporal model the time element may be given as a chronological year, Year = 2017, or as a time step through the time set (see the “Time step summary” that ems_data() prints):

partial <- ems_uniform_shock(
  var = "aoall",
  value = -1,
  REGr = "chn",
  ACTSa = "crops",
  Year = 2017
)

9.4 Subset shocks

A named model subset may be passed in place of individual elements, identical to the subset form in ems_swap(). teems expands the subset to all its elements at the aggregation level specified in ems_data().

In the GTAP-RE model, MARG is a subset of COMM containing margin commodities, and FWDTIME is a subset of ALLTIME containing forward time steps. Using these subset names directly restricts the shock to only those elements:

partial <- ems_uniform_shock(
  var = "qxs",
  value = -1,
  COMMc = "MARG",
  REGs = c("chn", "usa"),
  ALLTIMEt = "FWDTIME"
)

As in the swaps example, REGs = c("chn", "usa") is a multi-element specification while COMMc = "MARG" and ALLTIMEt = "FWDTIME" are subset specifications. This shock would then be deployed alongside the corresponding subset swaps:

cmf_path <- ems_deploy(
  .data = dat,
  model = model,
  shock = partial,
  swap_in = qxs_in,
  swap_out = txs_out
)

9.5 Multiple shocks and mixed swaps

Multiple uniform shocks of different scope can be combined in a list and passed to ems_deploy(). Swaps can also be mixed, combining partial ems_swap() objects with full variable strings (GTAPv6 sets in this example):

partial <- ems_uniform_shock(
  var = "qfd",
  value = -1,
  REGs = "usa",
  PROD_COMMj = "crops"
)

full <- ems_uniform_shock(
  var = "yp",
  value = 0.1
)

qfd <- ems_swap(
  var = "qfd",
  REGs = "usa",
  PROD_COMMj = "crops"
)

tfd <- ems_swap(
  var = "tfd",
  REGr = "usa",
  PROD_COMMj = "crops"
)

cmf_path <- ems_deploy(
  .data = dat,
  model = model,
  shock = list(partial, full),
  swap_in = list(qfd, "yp"),
  swap_out = list(tfd, "dppriv")
)