set_shock_cov_mat {gEcon} | R Documentation |
The set_shock_cov_mat
function allows to set a covariance matrix of model shocks.
set_shock_cov_mat(model, cov_matrix, shock_order = NULL)
model |
an object of |
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 |
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
.
An (updated) object of gecon_model
class representing the model.
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.
# 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)