Skip to content

Commit

Permalink
more reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Feb 22, 2024
1 parent 018abca commit 623c60a
Show file tree
Hide file tree
Showing 7 changed files with 927 additions and 954 deletions.
1,346 changes: 673 additions & 673 deletions code/IndShock.ipynb

Large diffs are not rendered by default.

46 changes: 26 additions & 20 deletions code/Portfolio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"***NOTE: using a 'quick fix' for an attribute error. See 'Error Notes' in EstimationParameter.py for further discussion.***\n"
]
}
],
"outputs": [],
"source": [
"from estimark.agents import PortfolioLifeCycleConsumerType\n",
"import estimark.calibration.estimation_parameters as parameters\n",
"import estimark.calibration.parameters as parameters\n",
"import numpy as np\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -29,28 +21,42 @@
"outputs": [],
"source": [
"DiscFacAdj, CRRA = np.genfromtxt(\n",
" \"tables/Portfolio_estimate_results.csv\", skip_header=1, delimiter=\",\"\n",
" \"tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv\",\n",
" skip_header=1,\n",
" delimiter=\",\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "AttributeError",
"evalue": "module 'estimark.calibration.parameters' has no attribute 'DiscFac_timevary'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[3], line 7\u001b[0m\n\u001b[0;32m 1\u001b[0m portfolio_agent \u001b[38;5;241m=\u001b[39m PortfolioLifeCycleConsumerType(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparameters\u001b[38;5;241m.\u001b[39minit_consumer_objects)\n\u001b[0;32m 4\u001b[0m portfolio_agent\u001b[38;5;241m.\u001b[39mCRRA \u001b[38;5;241m=\u001b[39m CRRA\n\u001b[1;32m----> 7\u001b[0m portfolio_agent\u001b[38;5;241m.\u001b[39mDiscFac \u001b[38;5;241m=\u001b[39m [b \u001b[38;5;241m*\u001b[39m DiscFacAdj \u001b[38;5;28;01mfor\u001b[39;00m b \u001b[38;5;129;01min\u001b[39;00m \u001b[43mparameters\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDiscFac_timevary\u001b[49m]\n",
"\u001b[1;31mAttributeError\u001b[0m: module 'estimark.calibration.parameters' has no attribute 'DiscFac_timevary'"
]
}
],
"source": [
"portfolio_agent = PortfolioLifeCycleConsumerType(**parameters.init_consumer_objects)\n",
"\n",
"\n",
"portfolio_agent.CRRA = CRRA\n",
"\n",
"\n",
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.DiscFac_timevary]"
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.timevary_DiscFac]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -89,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -119,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -134,7 +140,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -153,7 +159,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -185,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down
342 changes: 171 additions & 171 deletions code/WarmGlow.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions code/WarmGlowPortfolio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"source": [
"from estimark.agents import BequestWarmGlowLifeCyclePortfolioType\n",
"import estimark.calibration.estimation_parameters as parameters\n",
"import estimark.calibration.parameters as parameters\n",
"import numpy as np\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt"
Expand Down Expand Up @@ -43,7 +43,7 @@
")\n",
"\n",
"portfolio_agent.CRRA = CRRA\n",
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.DiscFac_timevary]"
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.timevary_DiscFac]"
]
},
{
Expand Down Expand Up @@ -164,4 +164,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
6 changes: 3 additions & 3 deletions code/WealthPortfolio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"source": [
"from estimark.agents import WealthPortfolioLifeCycleConsumerType\n",
"import estimark.calibration.estimation_parameters as parameters\n",
"import estimark.calibration.parameters as parameters\n",
"import numpy as np\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -44,7 +44,7 @@
")\n",
"\n",
"portfolio_agent.CRRA = CRRA\n",
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.DiscFac_timevary]"
"portfolio_agent.DiscFac = [b * DiscFacAdj for b in parameters.timevary_DiscFac]"
]
},
{
Expand Down Expand Up @@ -265,4 +265,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading

0 comments on commit 623c60a

Please sign in to comment.