Description Usage Arguments Details Value See Also Examples
View source: R/class_model_shock.R
The set_shock_cov_mat
function allows to set a covariance matrix of model shocks.
1 | 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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.