Skip to content

Commit cc734f5

Browse files
committed
Child states including trans probs calc.
1 parent 841fa7c commit cc734f5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/dcegm/interfaces/model_class.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,17 @@ def get_child_states(self, state, choice):
322322
}
323323
return pd.DataFrame(child_states)
324324

325+
def get_child_states_and_calc_trans_probs(self, state, choice, params):
326+
"""Get the child states for a given state and choice and calculate the
327+
transition probabilities."""
328+
child_states_df = self.get_child_states(state, choice)
329+
330+
trans_probs = self.model_funcs["compute_stochastic_transition_vec"](
331+
params=params, choice=choice, **state
332+
)
333+
child_states_df["trans_probs"] = trans_probs
334+
return child_states_df
335+
325336
def compute_law_of_motions(self, params):
326337
return calc_cont_grids_next_period(
327338
params=params,

src/dcegm/solve_single_period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def solve_for_interpolated_values(
122122
debug_info,
123123
):
124124
# EGM step 2)
125-
# Aggregate the marginal utilities and expected values over all state-choice
125+
# Aggregate the marginal utilities and expected values over all child state-choice
126126
# combinations and income shock draws
127127
marg_util, emax = aggregate_marg_utils_and_exp_values(
128128
value_state_choice_specific=value_interpolated,

0 commit comments

Comments
 (0)