pac_simulate: Simulate a PAC Equation Along a Target Path

View source: R/pac-equations.R

pac_simulateR Documentation

Simulate a PAC Equation Along a Target Path

Description

Simulates y_t = \sum_k a_k y_{t-k} + \sum_j c w_j E_t y^*_{t+j} given a deterministic path for the target under perfect foresight (the target path is known at t = 1). Values of the target beyond the end of the supplied path are held at its final value, so a path that ends at a constant is treated as settling there permanently.

Usage

pac_simulate(pac, ystar, y_init = NULL)

Arguments

pac

A "dsge_pac" object from pac_weights.

ystar

Numeric vector giving the target path.

y_init

Optional numeric vector of m initial lags of y, ordered y_0, y_{-1}, \ldots. Defaults to zeros.

Value

A numeric vector of the simulated y path, the same length as ystar.

See Also

pac_weights

Examples

pac <- pac_weights(beta = 0.99, d = 3)
# Permanent unit step in the target
y <- pac_simulate(pac, ystar = c(rep(0, 5), rep(1, 60)))
round(head(y, 12), 3)
# Adjustment is gradual but eventually complete
round(tail(y, 1), 6)


dsge documentation built on Sept. 25, 2026, 5:08 p.m.