Working on an infinite horizon model and I realized that it would be nice to have a command to calibrate the model parameters
I would like to add the calibration targets to the general equilibrium conditions (for simplicity and also because it is faster to do GE and calibration all in once rather than nested). Among the calibration targets I have the transition rate b/w occupations, which is caliculated as follows:
The code shown above calculates the transition from entrepreneur to worker, given by E_to_W (the mass of agents moving from entre to worker) divided by the mass of entrepreneurs.
Is it possible to incoporate tran_E_to_W as a target in the GE conditions using the toolkit as it is now? Or do I have to wait for the calibration command?
Actually because this is just ratio of means you could already do it in a GeneralEqmEqn.
That said, just pushed two features that will make this much easier for all sorts of moments.
First is âintermediateEqnsâ. These just allow you to take some of the âAggVarsâ and tranform them before you put them into GeneralEqmEqns. As an example, in a closed-economy model with government debt you have K=A-GDebt, where A is total assets (which is a FnsToEvaluate summed over households, so an AggVar) and GDebt is a parameter. You have the standard r=alpha*(K^(alpha-1))*(L^(1-alpha)) as a general eqm condition,
(r equals the Marginal Product of Captial), and K goes into this. You used to have to just substitute K=A-GDebt into the GeneralEqmEqn, which worked but got a bit messy. Now you can set up an intermediateEqn to evaluate K=A-Gdebt, and then pass K into the GeneralEqmEqn. This doesnât really allow you to solve anything you couldnât before, but it does make models much easier to write out and is easier to avoid making mistakes.
The other is âCustomModelStatsâ, this allows you to calculate any kind of crazy model statistic that will then be passed into GeneralEqmEqns. I do an example where the CustomModelStat is the variance of earnings, and the GeneralEqmEqn is to get this to hit a target, and this is done by choosing ârhoâ (the autocorrelation of idiosyncratic shocks) as a general eqm price param. [In Aiyagari model.]
Both intermediateEqns and CustomModelStats should work for InfHorz and FHorz stationary general eqm, including with PTypes.
Anyone who wants, email me and I will send code for Aiyagari model that demos a bunch of this. Proper documentation probably wonât be released for a month or three. But feel free to ask a question.
Basic setup:
when you set up an intermediateEqn can take AggVars and Parameters as inputs, outputs can go into GeneralEqmEqns
when setting up CustomModelStats, the inputs are hardcoded (covers everything you might want), and then you create a structure as output, and the field names of this structure can then be passed as inputs into GeneralEqmEqns
[CustomModelStats does not yet work with PType, but hopefully that should change in later this month.]
Nope. heteroagentoptions.CustomModelStats is where you put it. Has to be a function that takes a fixed set of inputs (that depends on InfHorz or FHorz, and on if using PType), has to output a structure the field names of which are the custom stats you want to be able to use in the GeneralEqmEqns.