I’m going over the Julia notebook on Arellano (2008) and I’m struggling to understand something.

In the inner for-loop of the one_step_update! function, it seems like optimal bond choice is solved by taking the maximum over consumption. However, I would’ve thought that the max should be taken over the value function for continuing/commitment, instead.

Is there a particular reason why this is done/why this is okay?

I understand most of it except for one small bit - I agree that v_c(B^\prime, y^\prime) is a constant term w.r.t. B, but since we’re maximizing w.r.t. B^\prime, wouldn’t we need v_c(B^\prime, y^\prime) to be constant w.r.t. B^\prime for it to be okay to take the max operator inside u()?