Skip to content

Commit

Permalink
FIX: fix missing h0 returned from compute_optimal (#348)
Browse files Browse the repository at this point in the history
* FIX: fix missing h0 returned from compute_optimal

* add ho
  • Loading branch information
mmcky authored Feb 5, 2024
1 parent 194aef5 commit 456e193
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lectures/cons_smooth.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ a0 = -2 # such as "student debt"
y_seq = np.concatenate([np.ones(46), np.zeros(20)])
cs_model = creat_cs_model()
c_seq, a_seq = compute_optimal(cs_model, a0, y_seq)
c_seq, a_seq, h0 = compute_optimal(cs_model, a0, y_seq)
print('check a_T+1=0:',
np.abs(a_seq[-1] - 0) <= 1e-8)
Expand Down Expand Up @@ -429,7 +429,7 @@ def compute_variation(model, ξ1, ϕ, a0, y_seq, verbose=1):
if verbose == 1:
print('check feasible:', np.isclose(β_seq @ v_seq, 0)) # since β = 1/R
c_opt, _ = compute_optimal(model, a0, y_seq)
c_opt, _, _ = compute_optimal(model, a0, y_seq)
cvar_seq = c_opt + v_seq
return cvar_seq
Expand Down

1 comment on commit 456e193

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.