Bug in SimPanelValues_TransPath_InfHorz

Moll’s codes turn out to have a typo. I was building some tests to compare Moll’s transition path codes to VFI Toolkit codes (as an illustration). I came across a minor typo that appears in
huggett_newton.m: lines 60,64
huggett_newton_myAD.m: lines 55,59

It is very minor, Moll’s codes have:

x = x + xi*dx;                % step taken is xi*dx
J = J + f * dx'/(dx'*dx);     % update uses dx

The Broyden update should use the same size step for both, but currently uses xi*dx for one (with xi=0.1) and x for the other. [Minor enough to impact runtimes but still work fine, hence why it has gone unnoticed.]

Also, the AutoDiff approach won’t work for VFI Toolkit. The reason is that it requires using the closed-form of an FOC from the model to be able to implement.

2 Likes