Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 8, 2024
1 parent b2837af commit 815e3f3
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion docs/projects/_numerical_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def get_rmse_rate(df, comparison_rates, methods):
- figure
"""
for measure in ["absolute", "relative"]:

fig, ax = plt.subplots(1, 1, figsize=(6.5, 4.5))

for m in methods:
Expand Down
1 change: 0 additions & 1 deletion respy/exogenous_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def compute_transition_probabilities(
# Compute the probabilities for every exogenous process.
probabilities = []
for exog_proc in exogenous_processes:

# Create the dot product of covariates and parameters.
x_betas = [
pandas_dot(states[params.index], params)
Expand Down
2 changes: 0 additions & 2 deletions respy/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ def _simulate_log_probability_of_individuals_observed_choice(
smoothed_value_functions = np.empty(n_choices)

for i in range(n_draws):

for j in range(n_choices):
value_function, _ = aggregate_keane_wolpin_utility(
wages[j], nonpec[j], continuation_values[j], draws[i, j], delta
Expand Down Expand Up @@ -553,7 +552,6 @@ def _process_estimation_data(df, state_space, optim_paras, options):
def _update_optim_paras_with_initial_experience_levels(optim_paras, df):
"""Adjust the initial experience levels in optim_paras from the data."""
for choice in optim_paras["choices_w_exp"]:

# Adjust initial experience levels for all choices with experiences.
init_exp_data = np.sort(
df.query("Period == 0")[f"Experience_{choice.title()}"].unique()
Expand Down
1 change: 0 additions & 1 deletion respy/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ def calculate_expected_value_functions(
expected_value_functions[0] = 0

for i in range(n_draws):

max_value_functions = 0

for j in range(n_choices):
Expand Down
1 change: 0 additions & 1 deletion respy/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def _solve_with_backward_induction(state_space, optim_paras, options):
)

else:

wages = state_space.get_attribute_from_period("wages", period)
nonpecs = state_space.get_attribute_from_period("nonpecs", period)
continuation_values = state_space.get_continuation_values(period)
Expand Down
24 changes: 0 additions & 24 deletions respy/tests/_former_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):

# Construct state space by periods
for period in range(n_periods):

# Build periodic indexer.
max_edu_starts = max(edu_starts)
dim_edu = min(max_edu_starts + period, edu_max) + 1
Expand All @@ -82,10 +81,8 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):

# Loop over all unobserved types
for type_ in range(n_types):

# Loop overall all initial levels of schooling
for edu_start in edu_starts:

# For occupations and education it is necessary to loop over period
# + 1 as zero has to be included if it is never this choice and period
# + 1 if it is always the same choice.
Expand All @@ -95,22 +92,17 @@ def _create_state_space_kw94(n_periods, n_types, edu_starts, edu_max):

# Loop over all admissible work experiences for Occupation A
for exp_a in range(period + 1):

# Loop over all admissible work experience for Occupation B
for exp_b in range(period + 1 - exp_a):

# Loop over all admissible additional education levels
for edu_add in range(
min(period + 1 - exp_a - exp_b, edu_max + 1 - edu_start)
):

# Loop over all admissible values for the lagged activity:
# (1) Occupation A, (2) Occupation B, (3) Education, and (4)
# Home.
for lagged_choice in range(4):

if period > 0:

# (0, 1) Whenever an agent has only worked in
# Occupation A, then the lagged choice cannot be
# anything other than one.
Expand Down Expand Up @@ -231,7 +223,6 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):

# Construct state space by periods
for period in range(n_periods):

# Build periodic indexer.
max_edu_starts = max(edu_starts)
dim_edu = min(max_edu_starts + period, edu_max) + 1
Expand All @@ -241,10 +232,8 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):

# Loop over all unobserved types
for type_ in range(n_types):

# Loop overall all initial levels of schooling
for edu_start in edu_starts:

# For occupations and education it is necessary to loop over period
# + 1 as zero has to be included if it is never this choice and period
# + 1 if it is always the same choice.
Expand All @@ -254,21 +243,17 @@ def _create_state_space_kw97_base(n_periods, n_types, edu_starts, edu_max):

# Loop over all admissible work experiences for Occupation A
for exp_a in range(period + 1):

# Loop over all admissible work experience for Occupation B
for exp_b in range(period + 1 - exp_a):

# Loop over all admissible work experience for Occupation B
for exp_mil in range(period + 1 - exp_a - exp_b):

# Loop over all admissible additional education levels
for edu_add in range(
min(
period + 1 - exp_a - exp_b - exp_mil,
edu_max + 1 - edu_start,
)
):

# Continue if state still exist. This condition is
# only triggered by multiple initial levels of
# education.
Expand Down Expand Up @@ -336,7 +321,6 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):

# Construct state space by periods
for period in range(n_periods):

# Build periodic indexer.
max_edu_starts = max(edu_starts)
dim_edu = min(max_edu_starts + period, edu_max) + 1
Expand All @@ -346,10 +330,8 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):

# Loop over all unobserved types
for type_ in range(n_types):

# Loop overall all initial levels of schooling
for edu_start in edu_starts:

# For occupations and education it is necessary to loop over period
# + 1 as zero has to be included if it is never this choice and period
# + 1 if it is always the same choice.
Expand All @@ -359,28 +341,22 @@ def _create_state_space_kw97_extended(n_periods, n_types, edu_starts, edu_max):

# Loop over all admissible work experiences for Occupation A
for exp_a in range(period + 1):

# Loop over all admissible work experience for Occupation B
for exp_b in range(period + 1 - exp_a):

# Loop over all admissible work experience for Occupation B
for exp_mil in range(period + 1 - exp_a - exp_b):

# Loop over all admissible additional education levels
for edu_add in range(
min(
period + 1 - exp_a - exp_b - exp_mil,
edu_max + 1 - edu_start,
)
):

# Loop over all admissible values for the lagged
# activity: (1) Occupation A, (2) Occupation B, (3)
# Military, (4) Education, and (5) Home.
for lagged_choice in range(5):

if period > 0:

# (0, 1) Whenever an agent has only worked in
# Occupation A, then the lagged choice cannot be
# anything other than one.
Expand Down
1 change: 0 additions & 1 deletion respy/tests/test_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def test_create_state_space_vs_specialized_kw97(model):
]

for index in indexer.keys():

if index[0] == period:
assert list(index) in indices_old

Expand Down

0 comments on commit 815e3f3

Please sign in to comment.