Description Usage Arguments Value See Also Examples
View source: R/class_simulation.R
The get_simulation_results
function retrieves the time series of simulated variables
from an object of gecon_simulation
class.
1 | get_simulation_results(sim_obj)
|
sim_obj |
An object of |
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.
For details, see gecon_simulation-class
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.