The Cake Eating Problem in Sage
Im interested in running a basic cake eating problem in sage. In its recursive formulation we have to solve the following bellman equations: v(kt)=ln(kt−kt+1)+βv(kt+1), β∈(0,1)
Step 1: Take an initial guess of v(kt+1)=0
Step 2: Solve for the maximum of v(kt) (in the first iteration this is v(kt)=ln(kt−kt+1), the maximum here is simply where kt+1=0 thus v(kt)=ln(kt) )
Step 3: Using our maximum for v(kt) iterate it forward and update our bellman (in this case we have v(kt)=ln(kt−kt+1)+β[ln(kt+1])
Step 4: Maximize this updated equation and repeat until convergence.
Any help is appreciated.
Hi there. Could you provide a little more detail of what you're after? I'm not famliar with the cake eating problem, so I had to do a bit of googling to get the background needed to understand the question. As far as I can tell, you're looking at something like the example here, with A and a both set to 1 (so that the cake doesn't change size), and b set to your beta (discounted utility for eating the cake in the future):
Using the worked example in that wikipedia page, I played around with the problem. I think I have a feel for the problem, but I'm not sure quite what you're asking.
Related question: Ask Sage question 52565: Recursive problems.
@jaydfox I have a video which goes through the pen and paper work on solving a planners problem here:https://www.youtube.com/watch?v=Bv_tP3GP5Qg&list=PLLAPgKPWbsiQ0Ejh-twYC3Fr8_WA9BKCc&index=4. Its pretty much the same problem for a cake eating problem except the production function changed.