Hi Community,
I am trying to follow the replication of Cocco, Gomes, and Maenhout 2005 using the code below.
I ran into an error in the line 102 of CreateReturnFnMatrix_Case2_Disc_Par2e.m that is in “ReturnFnMatrix” folder of the package because the variable d_grid is not defined in the function.
I am not sure if I can put d_grid == 0, as there is d variable.
It would be great if you could share your insight if you know the solution.
Best,
Charlie
1 Like
Fixed. Update to latest github of toolkit. Thanks for letting me know!
If you are more interested in playing with the CGM2005 model than with the details of the full replication, it might be worth playing with the CMG2005 example instead.
Unimportant detail: I’ve been trying to move internally from d_grid to d_gridvals (from stacked column to joint-grid). Lets me do some more sophisticated tricks internally, and especially lets me do less reshaping, it’s especially handy for things like divide-and-conquer and grid interpolation layer because it means I can just treat all the d variables as a single dimension when using arrayfun() which lets me have crazy dimensions on aprime. I had missed one mention of d_grid that was only triggered in certain circumstances and hence was not triggered by the example test I ran.
PS. Just noticed in your post that you were already using the example rather than the full replication 
Hi Rob,
Thank you so much for the quick fix. I’ve updated to the latest toolkit and can confirm it’s working on my end now. Yes, I am looking at the CMG2005 example, as I am trying to learn about how to execute life-cycle models. Your videos and slides are greatly helpful. I appreciate your service to the field!
When you have a chance, can you also upload a replication code for Catherine (2022): https://doi.org/10.1093/rfs/hhab136?
Best,
Charlie
2 Likes
Hi @Charlie_9839, do you know if the original code for Catherine (2022) article is available somewhere? That would help
@Charlie_9839, I looked at Catherine (2022). Because it needs to do correlation of u (shocks to the risky asset return) with z (idiosyncratic markov on earnings) the toolkit is going to have the same issue as described in:
Replication: Cocco (2005) - #7 by robertdkirkby
[and the same workaround of doing the ‘riskyasset’ as two endogenous states]
I hope to put aggregate shocks into the toolkit at some point. But remains just a hope for now.
1 Like