ramsey_policy: Ramsey Optimal Policy for a DSGE Model

View source: R/ramsey-policy.R

ramsey_policyR Documentation

Ramsey Optimal Policy for a DSGE Model

Description

Solves for the welfare-maximising policy using the linear-quadratic approach. The planner chooses a feedback rule for the policy instrument(s) to minimise the expected discounted welfare loss function

L = E_0 \sum_{t=0}^{\infty} \beta^t (x_t' Q_{xx} x_t + y_t' Q_{yy} y_t + 2 x_t' Q_{xy} y_t)

subject to the model's equilibrium conditions.

Usage

ramsey_policy(
  model,
  params = NULL,
  shock_sd = NULL,
  instruments,
  welfare_weights,
  beta = 0.99,
  tol = 1e-10,
  max_iter = 10000L
)

Arguments

model

A dsge_model or dsgenl_model object.

params

Named numeric vector of model parameters.

shock_sd

Named numeric vector of shock standard deviations.

instruments

Character vector. Names of the policy instrument variables (subset of the model's control variables).

welfare_weights

A named list specifying the welfare loss weights. Elements:

Q_xx

Square matrix (n_s x n_s) on state variables. If a named vector is provided a diagonal matrix is constructed.

Q_yy

Square matrix (n_c x n_c) on control variables. If a named vector is provided a diagonal matrix is constructed.

Q_xy

Cross-weight matrix (n_s x n_c). Default is zero.

At least one of Q_xx or Q_yy must be supplied.

beta

Numeric. Discount factor (0 < beta < 1). Default 0.99.

tol

Numeric. Convergence tolerance for the Riccati iteration. Default 1e-10.

max_iter

Integer. Maximum Riccati iterations. Default 10000.

Details

The algorithm:

  1. Solve the model to first order to obtain G (controls as a function of states) and H (state transition).

  2. Identify the columns of G and rows of the structural matrices corresponding to the policy instruments u_t.

  3. Formulate the constrained LQR problem:

    x_{t+1} = A x_t + B u_t + \eta \varepsilon_t

    \min \sum \beta^t (x_t' R_x x_t + u_t' R_u u_t + 2 x_t' N u_t)

  4. Solve the DARE

    P = R_x + \beta A' P A - \beta^2 (A' P B + N)(R_u + \beta B' P B)^{-1}(B' P A + N')

    via value-function iteration.

  5. The optimal feedback rule is

    F = -(R_u + \beta B' P B)^{-1}(\beta B' P A + N')

Value

An object of class "dsge_ramsey" containing:

F

Optimal feedback matrix (n_instruments x n_s): the Ramsey policy rule u_t = F x_t.

H_ram

State transition matrix under the optimal policy.

G_ram

Policy matrix under the optimal policy.

welfare_loss

Steady-state welfare loss (unconditional mean).

P

Solution to the discrete-time Riccati equation.

converged

Logical: did the Riccati iteration converge?

n_iter

Number of iterations taken.

instruments

Names of policy instruments.

first_order_sol

The first-order solution used as the basis.

References

Dennis, R. (2007). Optimal policy in rational-expectations models: New solution algorithms. Macroeconomic Dynamics, 11(1), 31-55.

Judd, K. L. (1992). Projection methods for solving aggregate growth models. Journal of Economic Theory, 58(2), 410-452.

See Also

welfare_loss, solve_dsge

Examples


# Simple NK model: planner minimises inflation and output gap variance
m <- dsge_model(
  obs(y ~ z),
  state(z ~ rho * z),
  start = list(rho = 0.8)
)
set.seed(1)
sol <- solve_dsge(m, params = c(rho = 0.8), shock_sd = c(z = 0.1))
n_s <- ncol(sol$H); n_c <- nrow(sol$G)
ram <- ramsey_policy(
  m,
  params    = c(rho = 0.8),
  shock_sd  = c(z = 0.1),
  instruments = "y",
  welfare_weights = list(
    Q_yy = matrix(1, 1, 1, dimnames = list("y", "y"))
  )
)
print(ram)



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