respy.tests.test_solve

Module Contents

Functions

test_check_solution(model_or_seed)

Test solution of a random model.

test_state_space_restrictions_by_traversing_forward(model)

Test for inadmissible states in the state space.

test_invariance_of_solution(model_or_seed)

Test for the invariance of the solution.

test_create_state_space_vs_specialized_kw94(model)

Test whether create state space reproduces invariant features of the kw94

test_create_state_space_vs_specialized_kw97(model)

State space reproduces invariant features of the kw97 state space.

test_explicitly_nonpec_choice_rewards_of_kw_94_one()

Test values of non-pecuniary rewards for Keane & Wolpin 1994.

test_explicitly_nonpec_choice_rewards_of_kw_94_two()

Test values of non-pecuniary rewards for Keane & Wolpin 1994.

test_dense_choice_cores()

Check whether continuation values are equal for paths where the restrictions do not

test_invariance_of_wage_calc()

The model reproduces invariant properties of wage outcomes.

test_child_indices()

Testing existence of properties for calculation of child indices!

test_wage_nonpecs()

Replace constants in reward functions with constants due to observables.

respy.tests.test_solve.test_check_solution(model_or_seed)[source]

Test solution of a random model.

respy.tests.test_solve.test_state_space_restrictions_by_traversing_forward(model)[source]

Test for inadmissible states in the state space.

The test is motivated by the addition of another restriction in https://github.com/OpenSourceEconomics/respy/pull/145. To ensure that similar errors do not happen again, this test takes all states of the first period and finds all their child states. Taking only the child states their children are found and so on. At last, the set of visited states is compared against the total set of states.

The test can only applied to some models. Most models would need custom options["core_state_space_filters"] to remove inaccessible states from the state space.

respy.tests.test_solve.test_invariance_of_solution(model_or_seed)[source]

Test for the invariance of the solution.

We run solve two times and check whether all attributes of the state space match.

respy.tests.test_solve.test_create_state_space_vs_specialized_kw94(model)[source]

Test whether create state space reproduces invariant features of the kw94 state space!

respy.tests.test_solve.test_create_state_space_vs_specialized_kw97(model)[source]

State space reproduces invariant features of the kw97 state space.

respy.tests.test_solve.test_explicitly_nonpec_choice_rewards_of_kw_94_one()[source]

Test values of non-pecuniary rewards for Keane & Wolpin 1994.

respy.tests.test_solve.test_explicitly_nonpec_choice_rewards_of_kw_94_two()[source]

Test values of non-pecuniary rewards for Keane & Wolpin 1994.

respy.tests.test_solve.test_dense_choice_cores()[source]

Check whether continuation values are equal for paths where the restrictions do not make any difference. We check continuation values at states where one choice leads to a remaining decision tree that is equivalent to the unrestricted problem and one where this is not the case!

respy.tests.test_solve.test_invariance_of_wage_calc()[source]

The model reproduces invariant properties of wage outcomes.

respy.tests.test_solve.test_child_indices()[source]

Testing existence of properties for calculation of child indices!

respy.tests.test_solve.test_wage_nonpecs()[source]

Replace constants in reward functions with constants due to observables.