Hansen(1985) Replication errors

Has anyone been able to successfully run the replication of Hansen (1985) on CPU not GPU. I’ve updated the VFIToolkit but getting the following errors:

Solve value fn problem
Unrecognized function or variable ‘ReturnFnParams’.

Error in ValueFnIter_Case1_Refine (line 43)
ReturnMatrix_z=CreateReturnFnMatrix_Case1_Disc_Par2(ReturnFn,n_d, n_a, n_z_temp,d_grid, a_grid, zvals,ReturnFnParams,1); % the 1 at the end is to output for refine

Error in ValueFnIter_Case1 (line 629)
[VKron,Policy]=ValueFnIter_Case1_Refine(V0,n_d,n_a,n_z,d_grid,a_grid,z_grid,pi_z,ReturnFn,ReturnFnParamsVec,DiscountFactorParamsVec,vfoptions);

Error in code1 (line 86)
[V,Policy]=ValueFnIter_Case1(n_d,n_a,n_z,d_grid,a_grid,z_grid,pi_z, ReturnFn, Params, DiscountFactorParamNames, , vfoptions);

1 Like

The ‘replications’ are only intended for GPU (they would otherwise take a fair while to run anyway).

If you are just interested in how to solve a basic RBC, you can check out

(you need the return function file as well)

PS. If your goal is learning value functions, great. If your goal is solving RBC models you will be much better of with Dynare.

PPS. Only basic functionality of VFI Toolkit can be done without a gpu

1 Like