Matlab and Python codes for 2012 Paper by Cogley, Sargent, and Surico