Skip to content

Commit

Permalink
show bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dedwar65 committed Feb 27, 2024
1 parent c379ccd commit bb92a90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/ConsBequestModel/example.ConsPortfolioComp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -40,7 +40,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[21], line 7\u001b[0m\n\u001b[1;32m 4\u001b[0m beq_type\u001b[38;5;241m.\u001b[39mTermBeqFac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 5\u001b[0m beq_type\u001b[38;5;241m.\u001b[39mBeqFac \u001b[38;5;241m=\u001b[39m [\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m----> 7\u001b[0m \u001b[43mbeq_type\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msolve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"Cell \u001b[0;32mIn[3], line 7\u001b[0m\n\u001b[1;32m 4\u001b[0m beq_type\u001b[38;5;241m.\u001b[39mTermBeqFac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 5\u001b[0m beq_type\u001b[38;5;241m.\u001b[39mBeqFac \u001b[38;5;241m=\u001b[39m [\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m----> 7\u001b[0m \u001b[43mbeq_type\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msolve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/hark/lib/python3.9/site-packages/HARK/core.py:519\u001b[0m, in \u001b[0;36mAgentType.solve\u001b[0;34m(self, verbose)\u001b[0m\n\u001b[1;32m 513\u001b[0m \u001b[38;5;66;03m# Ignore floating point \"errors\". Numpy calls it \"errors\", but really it's excep-\u001b[39;00m\n\u001b[1;32m 514\u001b[0m \u001b[38;5;66;03m# tions with well-defined answers such as 1.0/0.0 that is np.inf, -1.0/0.0 that is\u001b[39;00m\n\u001b[1;32m 515\u001b[0m \u001b[38;5;66;03m# -np.inf, np.inf/np.inf is np.nan and so on.\u001b[39;00m\n\u001b[1;32m 516\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m np\u001b[38;5;241m.\u001b[39merrstate(\n\u001b[1;32m 517\u001b[0m divide\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m, over\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m, under\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m, invalid\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 518\u001b[0m ):\n\u001b[0;32m--> 519\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpre_solve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# Do pre-solution stuff\u001b[39;00m\n\u001b[1;32m 520\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msolution \u001b[38;5;241m=\u001b[39m solve_agent(\n\u001b[1;32m 521\u001b[0m \u001b[38;5;28mself\u001b[39m, verbose\n\u001b[1;32m 522\u001b[0m ) \u001b[38;5;66;03m# Solve the model by backward induction\u001b[39;00m\n\u001b[1;32m 523\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpost_solve()\n",
"File \u001b[0;32m~/mambaforge/envs/hark/lib/python3.9/site-packages/HARK/ConsumptionSaving/ConsPortfolioModel.py:188\u001b[0m, in \u001b[0;36mPortfolioConsumerType.pre_solve\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpre_solve\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 187\u001b[0m AgentType\u001b[38;5;241m.\u001b[39mpre_solve(\u001b[38;5;28mself\u001b[39m)\n\u001b[0;32m--> 188\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupdate_solution_terminal\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/hark/lib/python3.9/site-packages/HARK/ConsumptionSaving/ConsBequestModel.py:141\u001b[0m, in \u001b[0;36mBequestWarmGlowPortfolioType.update_solution_terminal\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 138\u001b[0m BequestWarmGlowConsumerType\u001b[38;5;241m.\u001b[39mupdate_solution_terminal(\u001b[38;5;28mself\u001b[39m)\n\u001b[1;32m 140\u001b[0m \u001b[38;5;66;03m# Consume all market resources: c_T = m_T\u001b[39;00m\n\u001b[0;32m--> 141\u001b[0m cFuncAdj_terminal \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msolution_terminal\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcFunc\u001b[49m\n\u001b[1;32m 142\u001b[0m cFuncFxd_terminal \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mlambda\u001b[39;00m m, s: \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msolution_terminal\u001b[38;5;241m.\u001b[39mcFunc(m)\n\u001b[1;32m 144\u001b[0m \u001b[38;5;66;03m# Risky share is irrelevant-- no end-of-period assets; set to zero\u001b[39;00m\n",
Expand All @@ -52,7 +52,7 @@
"beq_type = BequestWarmGlowPortfolioType(\n",
" **init_portfolio)\n",
"\n",
"beq_type.TermBeqFac = 1\n",
"beq_type.TermBeqFac = 0\n",
"beq_type.BeqFac = [0]\n",
"\n",
"beq_type.solve()\n",
Expand Down
Loading

0 comments on commit bb92a90

Please sign in to comment.