From 456e1933748f2f2e90ba2108badae6f7ee9f687b Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 5 Feb 2024 20:33:03 +1100 Subject: [PATCH] FIX: fix missing h0 returned from compute_optimal (#348) * FIX: fix missing h0 returned from compute_optimal * add ho --- lectures/cons_smooth.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/cons_smooth.md b/lectures/cons_smooth.md index ea52430a..8d10471f 100644 --- a/lectures/cons_smooth.md +++ b/lectures/cons_smooth.md @@ -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) @@ -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