Skip to content

janrosa1/NK-medium-size

Repository files navigation

README

This repository contains code for solving a New Keynesian model with a Noisy Taylor Rule, as described in "Rough Notes".

Python Files

  1. NK_solution – Script for a single-seed solution with a -1 SD TFP shock.
    Produces:

    • IRF plot
    • IRF CSV file: IRF_shock_z_wide.csv
  2. NK_seed_experiment – Runs experiments with 10 random seeds.
    Produces:

    • IRF_seed_* files and plots seed_torch_exp_{date} (for MIT shock IRFs)
    • IRF_noisy_seed_* files and plots seed_torch_exp_{date} (for noisy shock IRFs)
  3. NK_solution_seed – Wrapper for NK_solution, used within NK_seed_experiment.

  4. NK_NN_architecture – Neural network architecture setup module.

  5. NK_residuals – Main module for computing loss functions.

  6. NK_simulations – Contains resampling functions used for solving the model (both log-linear and with arbitrary policy functions).

  7. NK_saving_plotting – Functions for saving IRF results to CSV and plotting IRFs.

  8. params – Parameter setup module.

  9. NK_utils – Additional helper functions.


Solution Method

The NK model is solved in four main steps:

  1. Simulate the initial grid
    Generate a grid over ((k, v, z)) using the log-linearized model.

  2. Deterministic model solution
    Solve the deterministic version of the New Keynesian model using the initial grid.

  3. New grid simulation
    Simulate a new grid based on the policy rules from the deterministic solution.

  4. Full stochastic solution
    Solve the full (stochastic) version of the model on the new grid, with adaptive refinements.

About

Code for the New Keyensian model solution, for the paper "Spooky Boundaries at a Distance: Inductive Bias and Dynamic Macroeconomic Models"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages