jmbejara / comp-econ-sp19

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2019)
48 stars 26 forks source link

HW7 eatCake graphs & output #68

Open jonhelium opened 5 years ago

jonhelium commented 5 years ago

For the Cake Lab section of the HW, I'm having a little trouble trying to figure out how to output graphs for the eatcake() function that are fixed at either a single time period or a specific wage, especially with the pre-written code that we are told to put within the function's definition (that given code chunk is below for reference): the outputted colorful 3D graphs look great, but I'm not sure how to fix them at a point and convert them to 2D. Any tips or helpful resources on how to go about that?

Also, since the arrays for the value function and policy function from eatcake()'s output are quite large, is it fine if we truncate how much of the arrays are shown in our output?

Code chunk for plotting given in lab: Screenshot_1

jmbejara commented 5 years ago

Hi @jonhelium . Your array V should have the the value function (as a function of w) for each time period t. So, fixing time or w should be a matter of slicing the array in one dimension or the other.