get_shock_names_by_index {gEcon}R Documentation

Shocks corresponding to given indices

Description

The get_shock_names_by_index function allows to retrieve the names of shocks with given indices.

Usage

get_shock_names_by_index(model, index_names)

Arguments

model

an object of gecon_model class.

index_names

a character vector of indices.

Details

Cf. gEcon users' guide, chapter ‘Templates’.

Value

The function returns a character vector of relevant shocks' names.

Examples

# copy the example to the current working directory
file.copy(from = file.path(system.file("examples", package = "gEcon"),
          "home_production_templ.gcn"), to = getwd())

# make and load the model
home_prod_templ <- make_model("home_production_templ.gcn")

# get shocks affecting home production technology
hp_shocks <- get_shock_names_by_index(home_prod_templ, "H")

# print information about selected shocks
shock_info(home_prod_templ, hp_shocks)

[Package gEcon version 1.2.0 Index]