Skip to content

Commit 82f9b9e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3cb0704 commit 82f9b9e

7 files changed

Lines changed: 0 additions & 31 deletions

File tree

docs/projects/_numerical_integration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def get_rmse_rate(df, comparison_rates, methods):
7070
- figure
7171
"""
7272
for measure in ["absolute", "relative"]:
73-
7473
fig, ax = plt.subplots(1, 1, figsize=(6.5, 4.5))
7574

7675
for m in methods:

respy/exogenous_processes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def compute_transition_probabilities(
3939
# Compute the probabilities for every exogenous process.
4040
probabilities = []
4141
for exog_proc in exogenous_processes:
42-
4342
# Create the dot product of covariates and parameters.
4443
x_betas = [
4544
pandas_dot(states[params.index], params)

respy/likelihood.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ def _simulate_log_probability_of_individuals_observed_choice(
460460
smoothed_value_functions = np.empty(n_choices)
461461

462462
for i in range(n_draws):
463-
464463
for j in range(n_choices):
465464
value_function, _ = aggregate_keane_wolpin_utility(
466465
wages[j], nonpec[j], continuation_values[j], draws[i, j], delta
@@ -553,7 +552,6 @@ def _process_estimation_data(df, state_space, optim_paras, options):
553552
def _update_optim_paras_with_initial_experience_levels(optim_paras, df):
554553
"""Adjust the initial experience levels in optim_paras from the data."""
555554
for choice in optim_paras["choices_w_exp"]:
556-
557555
# Adjust initial experience levels for all choices with experiences.
558556
init_exp_data = np.sort(
559557
df.query("Period == 0")[f"Experience_{choice.title()}"].unique()

respy/shared.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ def calculate_expected_value_functions(
493493
expected_value_functions[0] = 0
494494

495495
for i in range(n_draws):
496-
497496
max_value_functions = 0
498497

499498
for j in range(n_choices):

respy/solve.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ def _solve_with_backward_induction(state_space, optim_paras, options):
197197
)
198198

199199
else:
200-
201200
wages = state_space.get_attribute_from_period("wages", period)
202201
nonpecs = state_space.get_attribute_from_period("nonpecs", period)
203202
continuation_values = state_space.get_continuation_values(period)

respy/tests/_former_code.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):
7272

7373
# Construct state space by periods
7474
for period in range(n_periods):
75-
7675
# Build periodic indexer.
7776
max_edu_starts = max(edu_starts)
7877
dim_edu = min(max_edu_starts + period, edu_max) + 1
@@ -82,10 +81,8 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):
8281

8382
# Loop over all unobserved types
8483
for type_ in range(n_types):
85-
8684
# Loop overall all initial levels of schooling
8785
for edu_start in edu_starts:
88-
8986
# For occupations and education it is necessary to loop over period
9087
# + 1 as zero has to be included if it is never this choice and period
9188
# + 1 if it is always the same choice.
@@ -95,22 +92,17 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):
9592

9693
# Loop over all admissible work experiences for Occupation A
9794
for exp_a in range(period + 1):
98-
9995
# Loop over all admissible work experience for Occupation B
10096
for exp_b in range(period + 1 - exp_a):
101-
10297
# Loop over all admissible additional education levels
10398
for edu_add in range(
10499
min(period + 1 - exp_a - exp_b, edu_max + 1 - edu_start)
105100
):
106-
107101
# Loop over all admissible values for the lagged activity:
108102
# (1) Occupation A, (2) Occupation B, (3) Education, and (4)
109103
# Home.
110104
for lagged_choice in range(4):
111-
112105
if period > 0:
113-
114106
# (0, 1) Whenever an agent has only worked in
115107
# Occupation A, then the lagged choice cannot be
116108
# anything other than one.
@@ -231,7 +223,6 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):
231223

232224
# Construct state space by periods
233225
for period in range(n_periods):
234-
235226
# Build periodic indexer.
236227
max_edu_starts = max(edu_starts)
237228
dim_edu = min(max_edu_starts + period, edu_max) + 1
@@ -241,10 +232,8 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):
241232

242233
# Loop over all unobserved types
243234
for type_ in range(n_types):
244-
245235
# Loop overall all initial levels of schooling
246236
for edu_start in edu_starts:
247-
248237
# For occupations and education it is necessary to loop over period
249238
# + 1 as zero has to be included if it is never this choice and period
250239
# + 1 if it is always the same choice.
@@ -254,21 +243,17 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):
254243

255244
# Loop over all admissible work experiences for Occupation A
256245
for exp_a in range(period + 1):
257-
258246
# Loop over all admissible work experience for Occupation B
259247
for exp_b in range(period + 1 - exp_a):
260-
261248
# Loop over all admissible work experience for Occupation B
262249
for exp_mil in range(period + 1 - exp_a - exp_b):
263-
264250
# Loop over all admissible additional education levels
265251
for edu_add in range(
266252
min(
267253
period + 1 - exp_a - exp_b - exp_mil,
268254
edu_max + 1 - edu_start,
269255
)
270256
):
271-
272257
# Continue if state still exist. This condition is
273258
# only triggered by multiple initial levels of
274259
# education.
@@ -336,7 +321,6 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):
336321

337322
# Construct state space by periods
338323
for period in range(n_periods):
339-
340324
# Build periodic indexer.
341325
max_edu_starts = max(edu_starts)
342326
dim_edu = min(max_edu_starts + period, edu_max) + 1
@@ -346,10 +330,8 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):
346330

347331
# Loop over all unobserved types
348332
for type_ in range(n_types):
349-
350333
# Loop overall all initial levels of schooling
351334
for edu_start in edu_starts:
352-
353335
# For occupations and education it is necessary to loop over period
354336
# + 1 as zero has to be included if it is never this choice and period
355337
# + 1 if it is always the same choice.
@@ -359,28 +341,22 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):
359341

360342
# Loop over all admissible work experiences for Occupation A
361343
for exp_a in range(period + 1):
362-
363344
# Loop over all admissible work experience for Occupation B
364345
for exp_b in range(period + 1 - exp_a):
365-
366346
# Loop over all admissible work experience for Occupation B
367347
for exp_mil in range(period + 1 - exp_a - exp_b):
368-
369348
# Loop over all admissible additional education levels
370349
for edu_add in range(
371350
min(
372351
period + 1 - exp_a - exp_b - exp_mil,
373352
edu_max + 1 - edu_start,
374353
)
375354
):
376-
377355
# Loop over all admissible values for the lagged
378356
# activity: (1) Occupation A, (2) Occupation B, (3)
379357
# Military, (4) Education, and (5) Home.
380358
for lagged_choice in range(5):
381-
382359
if period > 0:
383-
384360
# (0, 1) Whenever an agent has only worked in
385361
# Occupation A, then the lagged choice cannot be
386362
# anything other than one.

respy/tests/test_solve.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ def test_create_state_space_vs_specialized_kw97(model):
226226
]
227227

228228
for index in indexer.keys():
229-
230229
if index[0] == period:
231230
assert list(index) in indices_old
232231

0 commit comments

Comments
 (0)