Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: fix missing h0 returned from compute_optimal #348

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading