Here are the results before the error messages.
Number of sample points for RatioEarningsOldYoung
ans =
152980 1
Current CustomModelStats variables (from caliboptions):
CapitalOutputRatio: 3.3976
GovExpenditureToOutputRatio: 0.0520
TransfersToOutputRatio: 0.1068
ShareOfDisposableTimeAllocatedToMarket: 0.1491
RatioOfCoeffOfVarForConsumptionToCoeffOfVarForHoursWorked: 2.2683
RatioOfEarningsOldtoYoung: 1.1213
CrossSectionalCorrelationOfIncomeBetweenFathersAndSons: 0.0773
EffectiveTaxRateOnAverageHHIncome: 0.1578
zlowerbarMinus10timesAverageIncome: -4.3591
EstateTaxRevenueAsFractionOfGDP: 0.0011
EarningsQuintileSharesAsFraction: 0.0000
3.716919e-02: 0.1713
1.783089e-01: 0.5856
WealthQuintileSharesAsFraction: 0.0080
1.697400e-02: 0.0198
2.000852e-01: 0.7316
EarningsTopSharesAsFraction: 0.1417
1.580830e-01: 0.1587
WealthTopSharesAsFraction: 0.1251
1.705189e-01: 0.2382
Current and target moments (first row is current, second row is target)
ans =
Columns 1 through 10
0.5911 0.7377 3.3976 0.0520 0.1068 0.1491 2.2683 1.1213 0.0773 0.1578
0.6300 0.7800 3.1300 0.2020 0.0490 0.3000 3.0000 1.3030 0.4000 0.0762
Columns 11 through 20
-4.3591 0.0011 0 0.0372 0.1713 0.1783 0.5856 0.0080 0.0170 0.0198
0 0.0020 -0.0040 0.0319 0.1249 0.2333 0.6139 -0.0039 0.0174 0.0572
Columns 21 through 28
0.2001 0.7316 0.1417 0.1581 0.1587 0.1251 0.1705 0.2382
0.1343 0.7949 0.1238 0.1637 0.1476 0.1262 0.2395 0.2955
Current (sum-of-squares of) objective fn value is 19.829558097021
Current objective fn value breakdown: Obj1=-0.038943 and Obj2=-0.042337 (with caliboptions.relativeGEweight=0.267582)
Current objective fn value breakdown: Obj1=-0.149960 and Obj2=0.057798 (with caliboptions.relativeGEweight=-0.150894)
Current objective fn value breakdown: Obj1=-0.731725 and Obj2=-0.181660 (with caliboptions.relativeGEweight=-0.322669)
Current objective fn value breakdown: Obj1=0.081583 and Obj2=-4.359091 (with caliboptions.relativeGEweight=-0.000946)
Current objective fn value breakdown: Obj1=0.004000 and Obj2=0.005269 (with caliboptions.relativeGEweight=0.046400)
Current objective fn value breakdown: Obj1=-0.054991 and Obj2=-0.028346 (with caliboptions.relativeGEweight=0.011937)
Current objective fn value breakdown: Obj1=-0.000426 and Obj2=-0.037419 (with caliboptions.relativeGEweight=0.065785)
Current objective fn value breakdown: Obj1=-0.063255 and Obj2=0.017862 (with caliboptions.relativeGEweight=-0.005617)
Current objective fn value breakdown: Obj1=0.011097 and Obj2=-0.001058 (with caliboptions.relativeGEweight=-0.068981)
Current objective fn value breakdown: Obj1=-0.057294 and Obj2=0.002211 (with caliboptions.relativeGEweight=-0.001684)
Current GE prices (this is just repeat of part of current calibration params):
r: 0.0539
a3: 0.0193
Current aggregate variables:
K: 6.3049
L: 0.8881
IncomeTaxRevenue: 0.2928
Pensions: 0.1982
EstateTaxRevenue: 0.0020
Earnings: 1.2647
Wealth: 6.3049
Current GeneralEqmEqns:
CapitalMarket: 0.0022
GovBudget: -0.0017
Current parameter values:
beta= 0.928747
sigma2= 0.710174
chi= 1.674632
G= -0.043125
phi1= 0.698612
phi2= 1.054508
omega= 0.663289
a2= 0.540361
zlowerbar= 14.300681
tauE= 0.707275
e2= 2.889823
e3= 9.677178
e4= 1060.998924
Gamma_ee_12= 0.007412
Gamma_ee_13= 0.001975
Gamma_ee_14= 0.000054
Gamma_ee_21= 0.036381
Gamma_ee_23= 0.003199
Gamma_ee_24= 0.000000
Gamma_ee_31= 0.019753
Gamma_ee_32= 0.004646
Gamma_ee_34= 0.000163
Gamma_ee_41= 0.110377
Gamma_ee_42= 0.004969
Gamma_ee_43= 0.063857
r= 0.060658
a3= -0.042400
Error using ValueFnIter_InfHorz (line 211)
Problem with pi_z in ValueFnIter_Case1: min(min(pi_z))<0 \n
Error in CalibrateBIHAModel_Joint_objectivefn (line 49)
[V, Policy]=ValueFnIter_InfHorz(n_d,n_a,n_z,d_grid, a_grid, z_gridvals, pi_z, ReturnFn, Parameters, DiscountFactorParamNames,[], vfoptions);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in CalibrateBIHAModel>@(calibparamsvec)CalibrateBIHAModel_Joint_objectivefn(calibparamsvec,CalibParamNames,n_d,n_a,n_z,d_grid,a_grid,z_gridvals,pi_z,ReturnFn,Parameters,DiscountFactorParamNames,GEPriceParamNames,ParametrizeParamsFn,FnsToEvaluate,GeneralEqmEqnsCell,GEeqnNames,GeneralEqmEqnParamNames,usingallstats,usingautocorr,usingcrosssec,usingcustomstats,targetmomentvec,allstatmomentnames,autocorrmomentnames,crosssecmomentnames,cmsmomentnames,allstatcummomentsizes,autocorrcummomentsizes,crossseccummomentsizes,cmscummomentsizes,AllStats_whichstats,AutoCorrStats_whichstats,CrossSecStats_whichstats,FnsToEvaluate_AllStats,FnsToEvaluate_AutoCorrStats,FnsToEvaluate_CrossSecStats,nCalibParams,calibparamsvecindex,calibomitparams_counter,calibomitparamsmatrix,caliboptions,heteroagentoptions,vfoptions,simoptions) (line 361)
CalibrationObjectiveFn=@(calibparamsvec) CalibrateBIHAModel_Joint_objectivefn(calibparamsvec, CalibParamNames,n_d,n_a,n_z,d_grid, a_grid, z_gridvals, pi_z, ReturnFn, Parameters, DiscountFactorParamNames, GEPriceParamNames, ParametrizeParamsFn, FnsToEvaluate, GeneralEqmEqnsCell, GEeqnNames, GeneralEqmEqnParamNames, usingallstats,usingautocorr,usingcrosssec,usingcustomstats, targetmomentvec, allstatmomentnames,autocorrmomentnames,crosssecmomentnames,cmsmomentnames, allstatcummomentsizes,autocorrcummomentsizes,crossseccummomentsizes,cmscummomentsizes, AllStats_whichstats,AutoCorrStats_whichstats,CrossSecStats_whichstats, FnsToEvaluate_AllStats, FnsToEvaluate_AutoCorrStats, FnsToEvaluate_CrossSecStats, nCalibParams, calibparamsvecindex, calibomitparams_counter, calibomitparamsmatrix, caliboptions, heteroagentoptions, vfoptions,simoptions);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in snls (line 340)
newfvec = feval(funfcn{3},xcurr,varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in lsqncommon (line 178)
snls(funfcn,xC,lb,ub,flags.verbosity,options,defaultopt,F,Jac,caller, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in lsqnonlin (line 264)
lsqncommon(funfcn,xCurrent,lb,ub,options,defaultopt,caller,...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in CalibrateBIHAModel (line 421)
[calibparamsvec,calibobjvalue]=lsqnonlin(CalibrationObjectiveFn,calibparamsvec0,[],[],[],[],[],[],[],minoptions);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in CastanedaDiazGimenezRiosRull2003 (line 577)
[CalibParams,calibsummary]=CalibrateBIHAModel(CalibParamNames,TargetMoments,n_d,n_a,n_z,d_grid, a_grid, z_grid, pi_z, ReturnFn, Params, DiscountFactorParamNames, [], GEPriceParamNames, FnsToEvaluate, GeneralEqmEqns, heteroagentoptions, caliboptions, vfoptions,simoptions);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^