model_properties: Model-implied moments, and how they compare with the data

View source: R/properties.R

model_propertiesR Documentation

Model-implied moments, and how they compare with the data

Description

The standard calibration check: does the model reproduce the volatilities and persistence actually observed? Reports the population standard deviation and autocorrelations implied by the solved model — from the stationary covariance V = P V P' + Q S Q' and corr_k = diag(P^k V) / diag(V) — next to the same statistics computed from data, plus the shock that accounts for most of each variable's unconditional variance.

Usage

model_properties(x, data = NULL, vars = NULL, lags = c(1, 4))

Arguments

x

A qpm_solution or qpm_model.

data

Optional data frame of observations in levels (columns named for model variables, an optional period column) whose moments are shown alongside. Missing values are dropped per variable.

vars

Variables to report; default all declared variables.

lags

Autocorrelation orders to report.

Details

Population moments exist only for stationary models. When the model has unit roots (random-walk trends) they are undefined, and the function reports that rather than returning nonsense; use fevd() and qpm_filter() diagnostics instead.

Value

An object of class qpm_properties: a data frame with the model and (optionally) data moments.

Examples

sol <- qpm_solve(qpm_template("bkl"))
model_properties(sol, vars = c("y_gap", "pi", "i", "q"))

# against simulated data
obs <- simulate(sol, nsim = 200, seed = 5, burn = 50)
model_properties(sol, data = obs, vars = c("y_gap", "pi", "i"))

qpmR documentation built on Sept. 29, 2026, 5:10 p.m.