Behavior NK3E#

This documents the behavior module of the New Keynesian 3-Equation model and exposes the public simulation methods.

Initialization#

BehaviorNK3E.initialize()[source]

Set the model at its steady state before shocks start.

At steady state, by definition y = y_e, r = r_s and pi = pi_T. We use the current (pre-shock) parameter values to compute r_s and then set all state variables accordingly. The base class will record this initial state for the required number of initialization timesteps.

Main Simulation Loop#

BehaviorNK3E.central_bank_slope(t: int, scenario: dict, params: dict | None = None)[source]

Compute the monetary policy reaction slope a3 from structural parameters.

Parameters:
  • t (int) – Current period (for bookkeeping only).

  • scenario (dict) – Scenario dictionary (not used).

  • params (dict | None) – Parameter values for time t with scenario shocks already applied.

Equations

\[a_3 = \frac{1}{a_1\left(\frac{1}{a_2 b} + a_2\right)}\]

Dependency

  • parameters: a1

  • parameters: a2

  • parameters: b

Sets

  • a3

BehaviorNK3E.stabilizing_real_rate(t: int, scenario: dict, params: dict | None = None)[source]

Compute the stabilizing real rate r_s consistent with output at potential.

Parameters:
  • t (int) – Current period (for bookkeeping only).

  • scenario (dict) – Scenario dictionary (not used).

  • params (dict | None) – Parameter values for time t with scenario shocks already applied.

Equations

\[r_s = \frac{A - y_e}{a_1}\]

Dependency

  • parameters: A

  • parameters: y_e

  • parameters: a1

Sets

  • r_s

BehaviorNK3E.is_curve_output(t: int, scenario: dict, params: dict | None = None)[source]

IS curve: output as a function of demand shifter and lagged real rate.

Parameters:
  • t (int) – Current period (for bookkeeping only).

  • scenario (dict) – Scenario dictionary (not used).

  • params (dict | None) – Parameter values for time t with scenario shocks already applied.

Equations

\[y_t = A - a_1 r_{t-1}\]

Dependency

  • parameters: A

  • parameters: a1

  • prior: r

Sets

  • y

BehaviorNK3E.phillips_curve_inflation(t: int, scenario: dict, params: dict | None = None)[source]

Phillips curve: inflation responds to the output gap.

Parameters:
  • t (int) – Current period (for bookkeeping only).

  • scenario (dict) – Scenario dictionary (not used).

  • params (dict | None) – Parameter values for time t with scenario shocks already applied.

Equations

\[\pi_t = \pi_{t-1} + a_2 (y_t - y_e)\]

Dependency

  • prior: pi

  • state: y

  • parameters: a2

  • parameters: y_e

Sets

  • pi

BehaviorNK3E.monetary_policy_rate(t: int, scenario: dict, params: dict | None = None)[source]

Monetary policy rule: real rate reacts to inflation deviations.

Parameters:
  • t (int) – Current period (for bookkeeping only).

  • scenario (dict) – Scenario dictionary (not used).

  • params (dict | None) – Parameter values for time t with scenario shocks already applied.

Equations

\[r_t = r_s + a_3 (\pi_t - \pi^T)\]

Dependency

  • state: r_s

  • state: a3

  • state: pi

  • parameters: pi_T

Sets

  • r