Error in LifeCycleProfiles_FHorz_Case1 due to "unrecognized variable 'PolicyIndexes'"

Hello everyone,

I’m trying to run a life cycle model based on the VFI Toolkit (you can find the .m file from https://www.dropbox.com/scl/fi/rrrnl3sglgngrdvcekhfv/PensionDualTrack_Xu2013_eng.m?rlkey=wqsqltp92zcy0w1sxwot2m1vs&st=bzcnltcf&dl=0). After successfully computing the stationary distribution, I’m encountering an error when I try to compute the life cycle profiles using LifeCycleProfiles_FHorz_Case1.

I suspect this is related to a recent breaking change in the input order of the LifeCycleProfiles_FHorz_Case1 function, as discussed in this forum. The function now requires PolicyIndexes as an input. I have attached my script file for reference.The exact error message is as follows:

========== Compute Life Cycle Profiles ==========
Stationary Distribution computed (Civil Servant: 0.06 seconds, Enterprise Employee: 0.02 seconds)
Unrecognized function or variable 'PolicyIndexes'.

Error in LifeCycleProfiles_FHorz_Case1_cpu (line 51)
l_daprime=size(PolicyIndexes,1);
             ^^^^^^^^^^^^^
Error in LifeCycleProfiles_FHorz_Case1 (line 103)
    AgeConditionalStats=LifeCycleProfiles_FHorz_Case1_cpu(StationaryDist,PolicyIndexes,FnsToEvaluate,FnsToEvaluateParamNames,Parameters,n_d,n_a,n_z,N_j,d_grid,a_grid,z_grid,simoptions);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in PensionDualTrack_VFItoolkit (line 306)
AgeConditionalStats_pub = LifeCycleProfiles_FHorz_Case1(StationaryDist_pub, Policy_pub, ...
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Could you please advise on how to properly integrate the PolicyIndexes variable into my script? Any help would be greatly appreciated!

Thank you,

2 Likes

Sorry. Was error at my end. Just pushed an update to github.

If you update toolkit it should hopefully work now. Thanks for letting me know.

1 Like