get_shock_cov_mat {gEcon}R Documentation

Accessing a covariance matrix of model shocks.

Description

The get_shock_cov_mat function returns a covariance matrix of model shocks.

Usage

get_shock_cov_mat(model)

Arguments

model

an object of gecon_model class.

Value

The function returns a covariance matrix of model shocks.

See Also

For details, see gecon_model-class. The set_shock_cov_mat function allows to set/modify shock covariance matrix. The set_shock_distr_par function sets distribution parameters (standard deviations, correlations, etc.) of shocks.

Examples

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

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

# set the shock distribution parameters
home_production <- set_shock_distr_par(home_production,
                                       distr_par = list("sd(epsilon_h)" = 0.7,
                                                        "var(epsilon_m)" = 0.49,
                                                        "cor(epsilon_m,
                                                             epsilon_h)" = 2/3))

# retrieve and show the covariance matrix of model shocks
cov_mat <- get_shock_cov_mat(home_production)
cov_mat

[Package gEcon version 1.2.0 Index]