plot_simulation: Plot simulation results stored in an object of...

Description Usage Arguments Value Examples

View source: R/class_simulation.R

Description

The plot_simulation function plots the simulations or saves them as .eps files in the model's subdirectory /plots.

Usage

1
plot_simulation(sim_obj, to_eps = FALSE)

Arguments

sim_obj

an object of gecon_simulation class.

to_eps

logical. if TRUE, the plot(s) is (are) saved as .eps file(s) in the model's subdirectory /plots and is (are) added to a .results.tex file.

Value

If more than five variables have been selected for simulations, at least two plots are created (max. 5 variables can be depicted on one plot). Separate plots are created for all the impulses, if the compute_irf function has been used for generating simulations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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 plot the IRFs
rbc <- set_shock_cov_mat(rbc, cov_matrix = matrix(0.01, 1, 1),
                         shock_order = "epsilon_Z")
irf_rbc <- compute_irf(rbc)
plot_simulation(irf_rbc)

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

Related to plot_simulation in gEcon...