Description Usage Arguments Value See Also Examples
View source: R/class_model_stat_sim.R
The get_model_stats
function prints and returns the statistics of the model (absolute and relative to the reference variable).
1 2 3 4 5 6 |
model |
an object of |
variables |
the names or the indices of the variables of interest. All variables are selected by default. |
basic_stats |
a logical value. If TRUE, the following information is returned for selected variables: steady-state value, standard deviation, variance, and information whether a variable has been log-linearised. The default value is TRUE. |
corr |
a logical value. If TRUE, a correlation matrix is returned. If a reference variable was not NULL while invoking the 'compute_model_stats' function, then correlations of selected variables with leads and lags of the reference variable are also returned. The default value is TRUE. |
autocorr |
a logical value. If TRUE, autocorrelations of selected variables are returned. The default value is TRUE. |
var_dec |
a logical value. If TRUE, variance decomposition (contributions of shocks to the variables' variances) is returned. The default value is TRUE. |
to_tex |
a logical value. If TRUE, the output is written to a .tex file. The default value is FALSE. |
silent |
a logical value. If TRUE, console output is suppressed. The default value is FALSE. |
The function returns a list of model statistics, which may contain the following fields:
basic_stats
- a data frame with steady-state values, standard deviations, variances, and information whether variables have been log-linearised,
corr
- a correlation matrix,
corr_refvar
- a matrix of correlations of selected variables with the reference variable (its lags and leads),
autocorr
- a matrix of autocorrelations,
var_dec
- a matrix of variance decomposition, i.e. contributions of shocks to the variables' variances.
The compute_model_stats
function computes statistics of the model using spectral (FFT) or simulation methods.
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)
rbc <- set_shock_cov_mat(rbc, cov_matrix = matrix(0.01, 1, 1),
shock_order = "epsilon_Z")
# compute and retrieve model statistics
rbc <- compute_model_stats(rbc, ref_var = "Y")
get_model_stats(model = rbc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.