set_shock_cov_mat: Setting a covariance matrix of stochastic shocks.

Description Usage Arguments Details Value See Also Examples

View source: R/class_model_shock.R

Description

The set_shock_cov_mat function allows to set a covariance matrix of model shocks.

Usage

1
set_shock_cov_mat(model, cov_matrix, shock_order = NULL)

Arguments

model

an object of gecon_model class.

cov_matrix

a numeric matrix. Shock covariance matrix.

shock_order

a character vector specifying the order of shocks in the cov_matrix. If not specified, shocks will be sorted according to their internal ordering (as reported by the get_shock_names function).

Details

The order of rows/columns of shock covariance matrix must agree with the internal order of shocks in a corresponding gecon_model-class object, unless the shock_order argument is supplied. Shocks' internal order can be checked with the shock_info function as well as the generic function print.

Value

An (updated) object of gecon_model class representing the model.

See Also

Generic functions such as print and summary allow to show the model's components. The shock_info function returns the names of shocks, information about equations which they appear in, and their current covariance matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# copy the example to the current working directory
file.copy(from = file.path(system.file("examples", package = "gEcon"),
          "rbc.gcn"), to = getwd())

# make and load the model
rbc <- make_model("rbc.gcn")
shock_info(rbc, all = TRUE)

# set the shock covariance matrix
rbc <- set_shock_cov_mat(rbc, cov_matrix = matrix(0.01, 1, 1),
                         shock_order = "epsilon_Z")
shock_info(rbc, all = TRUE)

gEcon documentation built on May 2, 2019, 6:52 p.m.