get_model_stats {gEcon}R Documentation

Statistics of the model

Description

The get_model_stats function prints and returns the statistics of the model (absolute and relative to the reference variable).

Usage

get_model_stats(model, variables = NULL,
                basic_stats = TRUE,
                corr = TRUE,
                autocorr = TRUE,
                var_dec = TRUE,
                to_tex = FALSE, silent = FALSE)

Arguments

model

an object of gecon_model class.

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.

Value

The function returns a list of model statistics, which may contain the following fields:

See Also

The compute_model_stats function computes statistics of the model using spectral (FFT) or simulation methods.

Examples

# 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)

[Package gEcon version 1.1.0 Index]