{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# New Keynesian 3-Equation (NK3E)\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Model ready: NK3E with 50 timesteps\n" ] } ], "source": [ "import os\n", "import sys\n", "import math\n", "import numpy as np\n", "import pandas as pd\n", "\n", "# Optional plotting\n", "try:\n", " import matplotlib.pyplot as plt\n", " HAVE_PLT = True\n", "except Exception:\n", " HAVE_PLT = False\n", "\n", "# Ensure src is on path if running notebook directly\n", "root = os.path.abspath(os.path.join(os.getcwd()))\n", "src_path = os.path.join(root, \"src\")\n", "if os.path.isdir(src_path) and src_path not in sys.path:\n", " sys.path.insert(0, src_path)\n", "\n", "from macrostat.models.NK3E import (\n", " NK3E,\n", " ParametersNK3E,\n", " VariablesNK3E,\n", " ScenariosNK3E,\n", ")\n", "\n", "# Configure a short horizon and ensure no tqdm\n", "params = ParametersNK3E(\n", " hyperparameters={\n", " \"timesteps\": 50,\n", " \"timesteps_initialization\": 1,\n", " \"use_tqdm\": False,\n", " }\n", ")\n", "variables = VariablesNK3E(parameters=params)\n", "scenarios = ScenariosNK3E(parameters=params)\n", "model = NK3E(parameters=params, variables=variables, scenarios=scenarios)\n", "\n", "print(\"Model ready: NK3E with\", params[\"timesteps\"], \"timesteps\")\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | y | \n", "pi | \n", "r | \n", "r_s | \n", "
|---|---|---|---|---|
| 45 | \n", "5.0 | \n", "2.0 | \n", "16.666666 | \n", "16.666666 | \n", "
| 46 | \n", "5.0 | \n", "2.0 | \n", "16.666666 | \n", "16.666666 | \n", "
| 47 | \n", "5.0 | \n", "2.0 | \n", "16.666666 | \n", "16.666666 | \n", "
| 48 | \n", "5.0 | \n", "2.0 | \n", "16.666666 | \n", "16.666666 | \n", "
| 49 | \n", "5.0 | \n", "2.0 | \n", "16.666666 | \n", "16.666666 | \n", "