get_shock_cov_mat: Accessing a covariance matrix of model shocks.

Description Usage Arguments Value See Also Examples

View source: R/class_model_shock.R

Description

The get_shock_cov_mat function returns a covariance matrix of model shocks.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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

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