File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66def solve_contract () -> float :
77 """Solve for high-state consumption in a two-state stochastic contract.
88
9- Uses bisection to match a target lifetime utility under log preferences
9+ Uses bisection to match a target lifetime utility under log preferences,
1010 with a participation (exit) constraint in the high-income state.
1111 """
1212 delta = 0.95
1313 prob = 0.5
1414 c_low = 0.95
1515 v0_target = 3.0
1616
17- v_aut_high = math .log (1.1 ) / (1.0 - delta )
18-
1917 def expected_value (c_high : float ) -> float :
2018 if c_high <= 0 :
2119 return - math .inf
2220 eu = prob * math .log (c_low ) + prob * math .log (c_high )
2321 return eu / (1.0 - delta )
2422
2523 def exit_constraint (c_high : float ) -> bool :
24+ # Participation constraint in the high-income state:
25+ # requires c_high >= 1.1 (autarky consumption).
2626 return c_high >= 1.1
2727
2828 tol = 1e-8
@@ -41,6 +41,8 @@ def exit_constraint(c_high: float) -> bool:
4141 hi = mid
4242
4343 sol = 0.5 * (lo + hi )
44+
45+ # Enforce the exit constraint (minimal feasible c_high).
4446 if not exit_constraint (sol ):
4547 sol = 1.1
4648
You can’t perform that action at this time.
0 commit comments