Skip to content

Commit

Permalink
update slides
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Jun 14, 2024
1 parent 8028033 commit bd8c71d
Show file tree
Hide file tree
Showing 153 changed files with 46,027 additions and 633 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ cython_debug/
.ipynb_checkpoints
_build
code/data/S&P Target Date glidepath.xlsx
.Rproj.user
*.Rproj
*.Rhistory
*.dta
13 changes: 13 additions & 0 deletions EstimatingMicroDSOPs.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
2 changes: 1 addition & 1 deletion code/estimark/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def simBirth(self, which_agents):
# Which period of the cycle each agents is currently in
self.t_cycle[which_agents] = 0

### Overwrite sim_one_period to not have death or look up of agent ages

### Overwrite sim_one_period to not have death or look up of agent ages


class IndShkLifeCycleConsumerType(TempConsumerType, IndShockConsumerType):
Expand Down
2 changes: 1 addition & 1 deletion code/estimark/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def msm_criterion(params, agent=None, emp_moments=None, weights=None):
[
float(weights[key] * (sim_moments[key] - emp_moments[key]))
for key in emp_moments
]
],
)

squared_errors = np.square(errors)
Expand Down
2 changes: 1 addition & 1 deletion code/estimark/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
Cagetti_income,
parse_income_spec,
)
from HARK.Calibration.life_tables.us_ssa.SSATools import parse_ssa_life_table
from HARK.ConsumptionSaving.ConsIndShockModel import init_lifecycle
from HARK.datasets.life_tables.us_ssa.SSATools import parse_ssa_life_table
from HARK.distribution import DiscreteDistribution

# ---------------------------------------------------------------------------------
Expand Down
674 changes: 674 additions & 0 deletions code/msm_notebooks/FinAssets_Cov.ipynb

Large diffs are not rendered by default.

843 changes: 843 additions & 0 deletions code/msm_notebooks/MSM Full Bequest model.ipynb

Large diffs are not rendered by default.

642 changes: 642 additions & 0 deletions code/msm_notebooks/MSM LCIM model.ipynb

Large diffs are not rendered by default.

1,033 changes: 1,033 additions & 0 deletions code/msm_notebooks/MSM TRP model.ipynb

Large diffs are not rendered by default.

809 changes: 809 additions & 0 deletions code/msm_notebooks/MSM Term Bequest model.ipynb

Large diffs are not rendered by default.

790 changes: 790 additions & 0 deletions code/msm_notebooks/MSM Warm Glow Bequest model.ipynb

Large diffs are not rendered by default.

614 changes: 614 additions & 0 deletions code/msm_notebooks/NetWorth_Cov.ipynb

Large diffs are not rendered by default.

Binary file added code/msm_notebooks/beq_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/cis_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/finassets_cov.pkl
Binary file not shown.
Binary file added code/msm_notebooks/fullbeq_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/lcim_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/networth_cov.pkl
Binary file not shown.
Binary file added code/msm_notebooks/networth_mom.pkl
Binary file not shown.
Binary file added code/msm_notebooks/norm_networth_cov.pkl
Binary file not shown.
Binary file added code/msm_notebooks/norm_networth_mom.pkl
Binary file not shown.
1,022 changes: 1,022 additions & 0 deletions code/msm_notebooks/savres.ipynb

Large diffs are not rendered by default.

Binary file added code/msm_notebooks/termbeq_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/trp_results.pkl
Binary file not shown.
Binary file added code/msm_notebooks/wgbeq_results.pkl
Binary file not shown.
6 changes: 3 additions & 3 deletions code/notebooks/IndShock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"from estimark.agents import IndShkLifeCycleConsumerType\n",
"from estimark.parameters import init_calibration\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd"
"from HARK.utilities import plot_funcs"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions code/notebooks/Model_Comparisons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"from estimark.estimation import get_weighted_moments\n",
"from estimark.parameters import age_mapping, init_calibration\n",
"from estimark.scf import scf_data\n",
"from estimark.snp import snp_data, snp_data_full\n",
"from HARK.utilities import plot_funcs"
"from estimark.snp import snp_data_full"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions code/notebooks/Portfolio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"metadata": {},
"outputs": [],
"source": [
"from estimark.agents import PortfolioLifeCycleConsumerType\n",
"from estimark.parameters import init_calibration\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"from estimark.agents import PortfolioLifeCycleConsumerType\n",
"from estimark.parameters import init_calibration\n",
"from estimark.snp import snp_data, snp_data_full\n",
"import numpy as np"
"from HARK.utilities import plot_funcs"
]
},
{
Expand Down
10 changes: 6 additions & 4 deletions code/notebooks/SCF_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"metadata": {},
"outputs": [],
"source": [
"from estimark.scf import scf_data_full\n",
"from estimark.parameters import age_mapping\n",
"from estimark.estimation import get_weighted_moments\n",
"import matplotlib.pyplot as plt\n",
"from estimark.estimation import get_weighted_moments\n",
"from estimark.parameters import age_mapping\n",
"from estimark.scf import scf_data_full\n",
"from statsmodels.stats.weightstats import DescrStatsW"
]
},
Expand Down Expand Up @@ -621,7 +621,9 @@
],
"source": [
"scf_data_full.groupby([\"age_group\", \"wave\"]).apply(\n",
" weighted_median, var=\"wealth_income_ratio\", weights=\"weight\"\n",
" weighted_median,\n",
" var=\"wealth_income_ratio\",\n",
" weights=\"weight\",\n",
").unstack().plot()"
]
},
Expand Down
342 changes: 172 additions & 170 deletions code/notebooks/WarmGlow.ipynb

Large diffs are not rendered by default.

468 changes: 234 additions & 234 deletions code/notebooks/WarmGlowPortfolio.ipynb

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions code/notebooks/WealthPortfolio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"metadata": {},
"outputs": [],
"source": [
"from estimark.agents import WealthPortfolioLifeCycleConsumerType\n",
"from estimark.parameters import init_calibration\n",
"from HARK.utilities import plot_funcs\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"from estimark.agents import WealthPortfolioLifeCycleConsumerType\n",
"from estimark.parameters import init_calibration\n",
"from estimark.snp import snp_data, snp_data_full\n",
"import numpy as np"
"from HARK.utilities import plot_funcs"
]
},
{
Expand Down Expand Up @@ -154,9 +154,8 @@
"outputs": [],
"source": [
"from estimark.estimation import get_weighted_moments\n",
"from estimark.scf import scf_data\n",
"from estimark.parameters import age_mapping\n",
"\n",
"from estimark.scf import scf_data\n",
"\n",
"moments = get_weighted_moments(\n",
" data=scf_data,\n",
Expand Down
6 changes: 3 additions & 3 deletions code/notebooks/parse_tables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
"import pandas as pd"
]
},
Expand All @@ -18,7 +19,7 @@
"source": [
"csv_file_dir = Path(\"../../content/tables/TRP/\")\n",
"params_to_keep = set(\n",
" [\"CRRA\", \"BeqFac\", \"BeqShift\", \"WealthShare\", \"WealthShift\", \"criterion\"]\n",
" [\"CRRA\", \"BeqFac\", \"BeqShift\", \"WealthShare\", \"WealthShift\", \"criterion\"],\n",
")\n",
"\n",
"# Get all files in the directory\n",
Expand Down Expand Up @@ -144,8 +145,7 @@
"\n",
"\n",
"# Define the order of columns\n",
"column_order = [\"Name\", \"criterion\", \"CRRA\",\n",
" \"WealthShare\", \"BeqFac\", \"BeqShift\"]\n",
"column_order = [\"Name\", \"criterion\", \"CRRA\", \"WealthShare\", \"BeqFac\", \"BeqShift\"]\n",
"\n",
"df = pd.DataFrame(parameters)\n",
"formatted_df = format_df(df)[column_order].sort_index()\n",
Expand Down
13 changes: 13 additions & 0 deletions content/slides/_extensions/grantmcdermott/clean/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: clean
author: Grant McDermott
version: 1.0.0
quarto-required: ">=1.3.0"
contributes:
formats:
revealjs:
theme: [default, clean.scss]
menu:
side: left
slide-number: true
date-format: long

Loading

0 comments on commit bd8c71d

Please sign in to comment.