solve_3rd_order: Solve Third-Order Perturbation

View source: R/third-order.R

solve_3rd_orderR Documentation

Solve Third-Order Perturbation

Description

Computes the third-order approximation of a nonlinear DSGE model around its deterministic steady state, extending the second-order solution of solve_2nd_order() with cubic terms and sigma^3 corrections.

Usage

solve_3rd_order(model, params, shock_sd, tol = 1e-06)

Arguments

model

A dsgenl_model object.

params

Named numeric vector of parameter values.

shock_sd

Named numeric vector of shock standard deviations.

tol

Eigenvalue tolerance for the first-order solution.

Details

Third-order terms capture:

  • Skewness effects in impulse responses.

  • State-dependent risk premia (g_xss).

  • Higher-order precautionary savings motives (g_sss).

Derivatives of the model equations are computed symbolically (with finite differences as a fallback for functions stats::D cannot differentiate). As in Dynare, shocks are symmetric, so the sigma^3 terms are zero. Pruned simulation is available via simulate_3rd_order.

Value

A dsge_solution object (order = 3) augmented with:

g_xx, h_xx

Second-order quadratic coefficients.

g_ss, h_ss

Second-order sigma^2 corrections.

g_xxx, h_xxx

Third-order cubic coefficients (arrays of dimension n_c|n_s × n_s × n_s × n_s).

g_xss, h_xss

Third-order linear-state × sigma^2 corrections (matrices n_c|n_s × n_s).

g_sss, h_sss

Third-order pure sigma^3 corrections (vectors of length n_c|n_s).

See Also

solve_2nd_order, simulate_3rd_order


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