@@ -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.
0 commit comments