Skip to content

Commit 456e193

Browse files
authored
FIX: fix missing h0 returned from compute_optimal (#348)
* FIX: fix missing h0 returned from compute_optimal * add ho
1 parent 194aef5 commit 456e193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lectures/cons_smooth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ a0 = -2 # such as "student debt"
311311
y_seq = np.concatenate([np.ones(46), np.zeros(20)])
312312
313313
cs_model = creat_cs_model()
314-
c_seq, a_seq = compute_optimal(cs_model, a0, y_seq)
314+
c_seq, a_seq, h0 = compute_optimal(cs_model, a0, y_seq)
315315
316316
print('check a_T+1=0:',
317317
np.abs(a_seq[-1] - 0) <= 1e-8)
@@ -429,7 +429,7 @@ def compute_variation(model, ξ1, ϕ, a0, y_seq, verbose=1):
429429
if verbose == 1:
430430
print('check feasible:', np.isclose(β_seq @ v_seq, 0)) # since β = 1/R
431431
432-
c_opt, _ = compute_optimal(model, a0, y_seq)
432+
c_opt, _, _ = compute_optimal(model, a0, y_seq)
433433
cvar_seq = c_opt + v_seq
434434
435435
return cvar_seq

0 commit comments

Comments
 (0)