Originally published at: GMM Estimation of Life-Cycle Models – VFI Toolkit
GMM Estimation of Life-Cycle Models is done in Life-Cycle Models 45-50 in pdf: An Introduction to Life-Cycle Modelsand GMM is formally described in the appendix. Once you can solve Life-Cycle models the next obvious question is how to choose the parameter values? An important statistical estimator for Life-Cycle models is the Generalized Method of Moments…
Just to add, runtimes on my desktop are roughly overnight (I set them off at the end of the day, they are finished when I turn up in the morning).
Hi Robert, when I ran LifeCycleModel46, it reported the following errors:
Unrecognized function or variable ‘Parameters’.
Error in CreateGridvals_FnsToEvaluate_FHorz (line 27)
ExogShockFnParamsVec=CreateVectorFromParams(Parameters, simoptions.ExogShockFnParamNames,jj);
Error in LifeCycleProfiles_FHorz_Case1 (line 109)
[n_z,z_gridvals_J,N_z,l_z,simoptions]=CreateGridvals_FnsToEvaluate_FHorz(n_z,z_grid,N_j,simoptions);
Error in LifeCycleModel46 (line 205)
AgeConditionalStats=LifeCycleProfiles_FHorz_Case1(StationaryDist,Policy,FnsToEvaluate,Params,,n_d,n_a,n_z,N_j,d_grid,a_grid,z_grid,simoptions);
Also I wonder does the function EstimateLifeCycleModel_MethodOfMoments() work for OLG models?
I will look and fix later this week (will post again when I do).
It cannot do OLG, although if you look at the paper:
Janssens, E.F. (working paper). Micro Shocks and Macro Blocks: Two-step Estimation of Heterogeneous Agent Models
you can probably do most of this using the EstimateLifeCycleModel_MethodOfMoments() command.
[I am hoping to do an OLG example later this year using the method from the Janssens’ paper. I have not tried it yet.]
Not directly related to GMM estimation of life-cycle model…
Does the toolkit have a routine that does internal calibration of certain parameters? I have in mind e.g. the classic Pijoan-Mas paper (see here for an ungated version of the paper and here for my partial replication of the paper based on the toolkit). In the paper some parameters (discount factor, curvature of utility, etc.) are chosen to match some moments, as the figure below shows. This is a kind of GMM with exact identification (no. of parameters = no. of targets) and no standard errors.
If the toolkit has something to automatize this process (I use to write my own code, define an objective function which is the squared distance between model moments and data moments and takes as input the vector of parameters), I’d be happy to add it to my Pijoan-Mas repo.
There is a not-yet-publicly-documented “CalibrateLifeCycleModel.m” (and PType version). From a code-perspective, GMM estimation is essentially a specific objective function to be minimized, and the calibrate codes just use a different objective function (what exactly is an option), they also skip all the ‘post estimation’ calculations of things like confidence intervals.
But there is not yet an equivalent command for infinite horizon. I will try create one, but is a question of finding time to do so. Will let you know once it exists.
Note that it will not work for general equilibrium. As in the above post about OLG, that is a feature I hope to add either late this year or early next year, but it does not yet exist.
Great! For me it’s not a priority, I was just wondering if such a thing was already available.
I remember that some time ago we discussed about calibration in GE and one option was simply to include the GE conditions as extra moments to target, perhaps giving them more weight than other moments. This is actually what sometimes I do in my projects:
(1) Include GE conditions with all other moments to match. Call nelder meade.
Once “estimation” is done,
(2) Recompute the model and look at the GE conditions. If they are not satisfied within tolerance, do the GE loop again.
(Maybe I’ve seen this in a Castaneda-like model, not sure)
What you describe sounds great. Nice and clean.
Having the calibration as extra GE targets is definitely a good/appropriate idea for calibration. But for estimation it is not sufficient as estimation is very strict about the way it is done (which is where that Janssens paper comes in).
Cool, at some stage I will create versions for infinite horizon but they are not currently a priority for me either, since they are not for you I will bump them into the indefinite future
@Shiki, Life-Cycle model 46 should be fixed now. Thanks for letting me know about it.
(Internally I replaced a bunch of lines that I was copy-pasting to handle grids for each of the various FnsToEvaluate-based commands with a function that I call internally for this, makes it much easier for me to read and improve. But I had omitted an input that is needed when using ExogShockFn so it failed for this; my tests just used standard grids. Anyway, easy fix.)