Dear Robert,
I ran an infinite horizon model (see my repo GitHub - aledinola/PijoanMasTaxes) and the default options are good. Thanks for improving the code!
However, if I set vfoptions.lowmemory = 1;
, I get the following error message:
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 622)
[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 HeteroAgentStationaryEqm_Case1_subfn (line 8)
[~,Policy]=ValueFnIter_Case1(n_d,n_a,n_s,d_grid,a_grid,s_grid, pi_s, ReturnFn, Parameters, DiscountFactorParamNames,ReturnFnParamNames,vfoptions);
Error in HeteroAgentStationaryEqm_Case1>@(p)HeteroAgentStationaryEqm_Case1_subfn(p,n_d,n_a,n_z,l_p,pi_z,d_grid,a_grid,z_grid,ReturnFn,FnsToEvaluate,GeneralEqmEqns,Parameters,DiscountFactorParamNames,ReturnFnParamNames,FnsToEvaluateParamNames,GeneralEqmEqnParamNames,GEPriceParamNames,heteroagentoptions,simoptions,vfoptions) (line 197)
GeneralEqmConditionsFnOpt=@(p) HeteroAgentStationaryEqm_Case1_subfn(p, n_d, n_a, n_z, l_p, pi_z, d_grid, a_grid, z_grid, ReturnFn, FnsToEvaluate, GeneralEqmEqns, Parameters, DiscountFactorParamNames, ReturnFnParamNames, FnsToEvaluateParamNames, GeneralEqmEqnParamNames, GEPriceParamNames, heteroagentoptions, simoptions, vfoptions)
Error in fminsearch (line 216)
fv(:,1) = funfcn(x,varargin{:});
Error in HeteroAgentStationaryEqm_Case1 (line 216)
[p_eqm_vec,GeneralEqmConditions]=fminsearch(GeneralEqmConditionsFnOpt,p0,optimoptions);
The code does not have the variable ReturnFnParams
which is a cell array of characters with the names of the parameters in the ReturnFn. It used to be an input set manually but now the toolkit should do it automatically, I think.
Unrelated to the bug: is the divide and conquer method implemented also for infinite horizon models?