Errors in the part of calibration of WorkshopOLGModel4

Hi, running the WorkshopOLGModel4, I get the error hints from the calibrating section below:

Unrecognized function or variable ‘nCalibParams’.

Error in [CalibrateOLGModel](matlab:matlab.lang.internal.introspective.errorDocCallback(‘CalibrateOLGModel’, ‘C:\Program Files\MATLAB\VFIToolkit\Estimation\Calibration\CalibrateOLGModel.m’, 215)) ([line 215](matlab: opentoline(‘C:\Program Files\MATLAB\VFIToolkit\Estimation\Calibration\CalibrateOLGModel.m’,215,0)))
CalibParamNames{nCalibParams+pp}=GEPriceParamNames{pp};
^^^^^^^^^^^^
Error in [WorkshopOLGModel4](matlab:matlab.lang.internal.introspective.errorDocCallback(‘WorkshopOLGModel4’, ‘C:\Downloads_20251105\2025Workshop-LSE\VFIWorkshop2025\Part4\WorkshopOLGModel4.m’, 191)) ([line 191](matlab: opentoline(‘C:\Downloads_20251105\2025Workshop-LSE\VFIWorkshop2025\Part4\WorkshopOLGModel4.m’,191,0)))
[CalibParams,calibsummary]=CalibrateOLGModel(CalibParamNames,TargetMoments,n_d,n_a,n_z,N_j,d_grid, a_grid, z_grid, pi_z, ReturnFn, Params, DiscountFactorParamNames, jequaloneDist, AgeWeightParamNames, , GEPriceParamNames, FnsToEvaluate, GeneralEqmEqns, heteroagentoptions, caliboptions, vfoptions,simoptions);
^^^^^^^^^^^^^^^^^^^^

By the way, there is a typo in the ReturnFn for the WorkshopOLGModel1 and 3:

w=(1-alpha)*((r+delta)/alpha)^(alpha/(1-alpha));

I think the power would be ^(alpha/(alpha-1))?

1 Like

Thanks for letting me know. I should be able to fix this early next week (I’m away at a conference).

This should be fixed now, update to latest github version of the toolkit (just ran it and works on my desktop; let me know if there is still any issue).

You are correct about the typos you point out in the two ReturnFns. I have now fixed them. Thanks for spotting this!

1 Like

It works fine. Thanks a lot for your work.

1 Like