get_simulation_results: Retrieve time series of simulated variables

Description Usage Arguments Value See Also Examples

View source: R/class_simulation.R

Description

The get_simulation_results function retrieves the time series of simulated variables from an object of gecon_simulation class.

Usage

1

Arguments

sim_obj

An object of gecon_simulation-class class.

Value

The results are returned as a matrix if the simulation has been generated by a call to the random_path or simulate_model function or a list of matrices corresponding to selected shocks in a call to the compute_irf function.

See Also

For details, see gecon_simulation-class.

Examples

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

# solve the model
rbc <- steady_state(rbc)
rbc <- solve_pert(rbc)

# compute and print the IRFs
rbc <- set_shock_cov_mat(rbc, cov_matrix = matrix(0.01, 1, 1),
                         shock_order = "epsilon_Z")
irf_rbc <- compute_irf(rbc, cholesky = TRUE,
                       variables = c("K_s", "C", "Z", "I", "Y"))
get_simulation_results(irf_rbc)

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