Hello Robert
I have some problems when trying to re-run RestucciaRogerson2008.m. Here are some error messages:
******* Error Message Begin ********
Incorrect use of fieldnames
The input parameter of type 'cell' is invalid. The input must be a struct or a Java or COM object.
Erros in HeteroAgentStationaryEqm_Case1_EntryExit_subfn (Line 136)
if ~isempty(fieldnames(FnsToEvaluate)) % Note that the entry/exit aggregates are treated seperately, so it is possible for this to be empty
Errors in
HeteroAgentStationaryEqm_Case1_EntryExit>@(p)HeteroAgentStationaryEqm_Case1_EntryExit_subfn(p,n_d,n_a,n_s,pi_s,d_grid,a_grid,s_grid,ReturnFn,FnsToEvaluate,GeneralEqmEqns,Parameters,DiscountFactorParamNames,ReturnFnParamNames,FnsToEvaluateParamNames,GeneralEqmEqnParamNames,GEPriceParamNames,EntryExitParamNames,heteroagentoptions,simoptions,vfoptions) (Line 102)
GeneralEqmConditionsFnOpt=@(p) HeteroAgentStationaryEqm_Case1_EntryExit_subfn(p, n_d, n_a, n_s, pi_s, d_grid, a_grid, s_grid, ReturnFn, FnsToEvaluate, GeneralEqmEqns, Parameters, DiscountFactorParamNames, ReturnFnParamNames, FnsToEvaluateParamNames, GeneralEqmEqnParamNames, GEPriceParamNames, EntryExitParamNames, heteroagentoptions, simoptions, vfoptions);
Erros in fminsearch (Line 201)
fv(:,1) = funfcn(x,varargin{:});
Errors in HeteroAgentStationaryEqm_Case1_EntryExit (Line 116)
[p_eqm_vec,GeneralEqmConditions]=fminsearch(GeneralEqmConditionsFnOpt,p0,minoptions);
Erros in HeteroAgentStationaryEqm_Case1 (Line 117)
[p_eqm,p_eqm_index, GeneralEqmConditions]=HeteroAgentStationaryEqm_Case1_EntryExit(n_d, n_a, n_z, n_p, pi_z, d_grid, a_grid, z_grid, ReturnFn, FnsToEvaluate, GeneralEqmEqns, Parameters, DiscountFactorParamNames, ReturnFnParamNames, FnsToEvaluateParamNames, GeneralEqmEqnParamNames, GEPriceParamNames, EntryExitParamNames, heteroagentoptions, simoptions, vfoptions);
Errors in RestucciaRogerson2008 (Line 302 )
[p_eqm,p_eqm_index, GeneralEqmCondition]=HeteroAgentStationaryEqm_Case1(0, n_a, n_z, n_p, pi_z, [], a_grid, z_grid, ReturnFn, FnsToEvaluate, GeneralEqmEqns, Params, DiscountFactorParamNames, ReturnFnParamNames, FnsToEvaluateParamNames, GeneralEqmEqnParamNames, GEPriceParamNames,heteroagentoptions, simoptions, vfoptions, EntryExitParamNames);
****** Error Message End**********
Thank you for your help!