Skip to content

Commit 6619814

Browse files
authored
Update example models guide (#406)
1 parent fc3da1f commit 6619814

3 files changed

Lines changed: 209 additions & 14 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: reorder-python-imports
2121
- repo: https://github.com/psf/black
22-
rev: 21.4b0
22+
rev: 21.4b1
2323
hooks:
2424
- id: black
2525
- repo: https://github.com/asottile/blacken-docs

docs/how_to_guides/how_to_example_models.rst

Lines changed: 206 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,82 @@ Below are the example models that are currently available.
6363

6464
- ``robinson_crusoe_basic``
6565
- ``robinson_crusoe_extended``
66-
66+
67+
The models are centered around Robinson Crusoe, who is stranded on a desert
68+
island. In each period, Robinson decides between fishing or relaxing in a
69+
hammock. In the extended model, he might additionally ask for Friday's advice
70+
to further develop his fishing skills.
71+
6772
These models are excellent examples to use for learning and prototyping: They
6873
include a small number of available choices and a low number of periods such
6974
that they are computationally feasible.
7075

76+
Overview of model characteristics defined by ``params`` and ``options``:
77+
78+
.. tabs::
79+
.. tab:: Basic Model
80+
81+
.. csv-table::
82+
:header: "Parameters", " "
83+
:widths: 20, 40
84+
85+
"Number of choices", "2"
86+
"Work choices", "Fishing"
87+
"Education choices", "None"
88+
"Leisure choices", "Hammock"
89+
"Number of parameters", "7"
90+
"Shock Correlations", "Negative between fishing and hammock"
91+
92+
93+
.. csv-table::
94+
:header: "Options", " "
95+
:widths: 20, 40
96+
97+
"Number of periods", "5"
98+
"Solution draws", "100"
99+
"Estimation draws", "100"
100+
"Solution seed", "456"
101+
"Simulation seed", "132"
102+
"Estimation seed", "100"
103+
"Estimation tau", "0.001"
104+
105+
.. tab:: Extended Model
106+
107+
.. csv-table::
108+
:header: "Parameters", " "
109+
:widths: 20, 40
110+
111+
"Number of choices", "3"
112+
"Work choices", "Fishing"
113+
"Education choices", "Friday"
114+
"Leisure choices", "Hammock"
115+
"Number of parameters", "15"
116+
"Shock Correlations", "None"
117+
"Lagged choices", "Hammock period 1"
118+
"Covariates", "Break in fishing, contemplation with Friday"
119+
120+
.. csv-table::
121+
:header: "Options", " "
122+
:widths: 20, 40
123+
124+
"Number of periods", "10"
125+
"Simulation agents", "1000"
126+
"Solution draws", "500"
127+
"Estimation draws", "200"
128+
"Solution seed", "456"
129+
"Simulation seed", "132"
130+
"Estimation seed", "500"
131+
"Estimation tau", "0.001"
71132

72133
.. tab:: KW (1994)
73134

74135
Aside from toy models, **respy** also provides several models that stem from the
75136
economic literature on dynamic life-cycle models. The most simple examples are a group
76137
of models based on the following publication:
77138

78-
- Keane, M. P., & Wolpin, K. I. (1994). The Solution and Estimation of Discrete Choice
79-
Dynamic Programming Models by Simulation and Interpolation: Monte Carlo Evidence.
80-
*The Review of Economics and Statistics*, 648-672.
139+
* Keane, M. P., & Wolpin, K. I. (1994). The Solution and Estimation of Discrete Choice
140+
Dynamic Programming Models by Simulation and Interpolation: Monte Carlo
141+
Evidence. *The Review of Economics and Statistics*, 648-672.
81142

82143
In the study, Keane and Wolpin (1994) develop an approximate solution method which
83144
consists of Monte Carlo integration with simulation and an interpolation approach to
@@ -94,9 +155,40 @@ Below are the example models that are currently available.
94155
The model consists of four mutually exclusive alternatives that individuals can choose
95156
in each period. Agents can either choose to work in one of two sectors *a* or *b*,
96157
invest in *education* or stay *home*. The work alternatives award a wage and experience,
97-
while school only awards experience. In the home option, individuals gain neither a wage
98-
nor experience. The plot below shows the choice patterns for the three parametrizations.
99-
The model considers a time horizon of 40 periods.
158+
while school only awards experience.
159+
160+
Overview of model characteristics defined by ``params`` and ``options``:
161+
162+
.. csv-table::
163+
:header: "Parameters", "kw_94_one", "kw_94_two", "kw_94_three"
164+
:widths: 20, 20, 20, 20
165+
166+
"Number of choices", ,"4"
167+
"Work choices", ," Cccupation sector a, Cccupation sector b"
168+
"Education choices", , "education"
169+
"Either choices", , "home",
170+
"Number of parameters", , "30"
171+
"Initial schooling", , "10 periods"
172+
"Maximal schooling", , "20 periods",
173+
"Shock Correlations", "None", "None", "Positive (a and b), negative (home and educ)"
174+
"Lagged choices", ,"Education in period 1"
175+
"Covariates", ,"Squared experience, break education, HS Degree"
176+
177+
178+
.. csv-table::
179+
:header: "Options", " "
180+
:widths: 20, 40
181+
182+
"Number of periods", "40"
183+
"Simulation agents", "1000"
184+
"Solution draws", "500"
185+
"Estimation draws", "200"
186+
"Solution seed", "15"
187+
"Simulation seed", "132"
188+
"Estimation seed", "500"
189+
"Estimation tau", "0.001"
190+
"Monte Carlo Sequence", "random"
191+
100192

101193
.. tab:: KW (1997)
102194

@@ -107,11 +199,11 @@ Below are the example models that are currently available.
107199
model parametrization that is very similar to the model of Keane and Wolpin (1994) and
108200
and "extended" parametrization that improves on the empirical fit of the basic model.
109201

110-
- Keane, M. P., & Wolpin, K. I. (1997). The Career Decisions of Young Men.
111-
*Journal of Political Economy*, 105(3), 473-522.
202+
- Keane, M. P., & Wolpin, K. I. (1997). The Career Decisions of Young
203+
Men. *Journal of Political Economy*, 105(3), 473-522.
112204

113205
**respy** supports both the basic and extended parametrization from the paper.
114-
They are named:
206+
They models are named:
115207

116208
- ``kw_97_basic``
117209
- ``kw_97_extended``
@@ -127,19 +219,120 @@ Below are the example models that are currently available.
127219
models and require a considerable amount of computation power to solve, especially the
128220
extended model.
129221

222+
Overview of model characteristics defined by ``params`` and ``options``:
223+
224+
.. tabs::
225+
226+
.. tab:: kw_97_basic
227+
228+
.. csv-table::
229+
:header: "Parameters", " "
230+
:widths: 20, 20
231+
232+
"Number of choices", "5"
233+
"Work hoices", "Blue collar, White collar, Military"
234+
"Education choices", "School"
235+
"Either choices", "Home"
236+
"Number of parameters", "63"
237+
"Initial schooling", "7-11 periods"
238+
"Maximal schooling", "20 periods"
239+
"Lagged choices", "None"
240+
"Covariates", "School degrees, squared experience"
241+
"Unobserved Heterogeneity", "4 types"
242+
243+
.. csv-table::
244+
:header: "Options", " "
245+
:widths: 20, 20
246+
247+
"Number of periods", "50"
248+
"Simulation agents", "5000"
249+
"Solution draws", "200"
250+
"Estimation draws", "200"
251+
"Solution seed", "456"
252+
"Simulation seed", "132"
253+
"Estimation seed", "500"
254+
"Estimation tau", "500"
255+
"Monte Carlo Sequence", "random"
256+
257+
.. tab:: kw_97_extended
258+
259+
.. csv-table::
260+
:header: "Parameters", " "
261+
:widths: 20, 20
262+
263+
"Number of choices", "5"
264+
"Work choices", "Blue collar, White collar, Military"
265+
"Education choices", "Education"
266+
"Either choices", "Home"
267+
"Number of parameters", "115"
268+
"Initial schooling", "7-11 periods"
269+
"Maximal schooling", "20 periods"
270+
"Lagged choices", "School or Home in period 1"
271+
"Covariates", "School degrees, squared experience, age, any or no prev. experience, military dropout, break in schooling"
272+
"Unobserved Heterogeneity", "4 types"
273+
"Measurement Error Wage", "Yes"
274+
275+
.. csv-table::
276+
:header: "Options", "Value"
277+
:widths: 20, 20
278+
279+
"Number of periods", "50"
280+
"Simulation agents", "5000"
281+
"Solution draws", "200"
282+
"Estimation draws", "200"
283+
"Solution seed", "1"
284+
"Simulation seed", "2"
285+
"Estimation seed", "3"
286+
"Estimation tau", "500"
287+
"Monte Carlo Sequence", "random"
288+
289+
130290
.. tab:: KW (2000)
131291

132292
Another example model provided in the respy interface is the model presented in Keane
133293
and Wolpin (2000). The model incorporates an observable characteristic to account for
134294
race, aiming to analyze the effects of monetary incentive schemes designed to reduce
135295
racial differences in school attainment and earnings.
136296

137-
- Keane, M. P., & Wolpin, K. I. (2000). Eliminating Race Differences in School
138-
Attainment and Labor Market Success. *Journal of Labor Economics*, 18(4), 614-652.
297+
- Keane, M. P., & Wolpin, K. I. (2000). Eliminating Race Differences in School Attainment
298+
and Labor Market Success. *Journal of Labor Economics*, 18(4), 614-652.
139299

140300
The model is named
141301

142302
- ``kw_2000``
143303

144304
The model is very similar to the extended model specification in Keane and Wolpin
145-
(1997).
305+
(1997). Overview of model characteristics defined by ``params`` and ``options``:
306+
307+
.. csv-table::
308+
:header: "Parameters", " "
309+
:widths: 20, 20
310+
311+
"Number of choices", "5"
312+
"Choices", "home, school, blue collar, white collar, military"
313+
"Work choices", "blue collar, white collar, military"
314+
"Education choices", "school"
315+
"Either choices", "home"
316+
"Number of parameters", "125"
317+
"Initial education", "7-11 periods"
318+
"Maximal Schooling", "20 periods"
319+
"Correlations", "positive correlation for all work alternatives"
320+
"Lagged choices", "School or Home in Period 1"
321+
"Covariates", "School degrees, squared experience, age, any or no prev. experience, military dropout, break in schooling"
322+
"Observables", "Ethnicity"
323+
"Measurement Error Wage", "Yes"
324+
325+
326+
.. csv-table::
327+
:header: "Options", " "
328+
:widths: 20, 20
329+
330+
"Number of periods", "50"
331+
"Simulation agents", "5000"
332+
"Solution draws", "500"
333+
"Estimation draws", "200"
334+
"Solution seed", "456"
335+
"Simulation seed", "132"
336+
"Estimation seed", "500"
337+
"Estimation Tau", "500"
338+

docs/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ releases are available on `Anaconda.org
1919
- :gh:`395` Adds guides and tutorials for exogenous proccesses, covariates, and maximum
2020
likelihood estimation. Improves structure and appearance of documentation.
2121
(:ghuser:`MaxBlesch`, :ghuser:`amageh`).
22+
- :gh:`406` More information in example models guide (:ghuser:`carolinalvarez`,
23+
:ghuser:`amageh`).
2224

2325

2426
2.0.0 - 2019-2020

0 commit comments

Comments
 (0)