Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate rescaling of parameters #995

Open
sbenthall opened this issue Apr 5, 2021 · 13 comments
Open

Automate rescaling of parameters #995

sbenthall opened this issue Apr 5, 2021 · 13 comments

Comments

@sbenthall
Copy link
Contributor

Sometimes it's necessary to rescale parameters from annual to quarterly or some other timescale.

This is a coding pattern for doing this, but it's being applied one parameter at a time.

https://github.com/econ-ark/DistributionOfWealthMPC/blob/master/Code/SetupParamsCSTW.py#L103-L124

It would be better to have a function that did this adjustment for all parameters.

See #878

@llorracc
Copy link
Collaborator

llorracc commented Apr 5, 2021

The coding pattern this refers to applies only to permanent multiplicative growth factors. So, for example, the right way to convert a transitory shock from an annual to a quarterly frequency is different from the right way to convert a permanent shock. (Mortality is also assumed to be a permanent state, so the same method applies to survival probabilities!)

Just a warning that any code needs to be sure to explain that it is not a universal tool for time scale conversion.

@sbenthall
Copy link
Contributor Author

That's a very good point! I hadn't thought of that.

What is the right way to convert a transitory shock from annual to quarterly frequency?

The REMARK code has these values pre-converted.
https://github.com/econ-ark/DistributionOfWealthMPC/blob/master/Code/SetupParamsCSTW.py#L75-L79

I'm not sure how Dolo would deal with this problem.

@sbenthall sbenthall added this to the 1.0.0 milestone Apr 5, 2021
@llorracc
Copy link
Collaborator

llorracc commented Apr 5, 2021

What we are doing in the REMARK is actually more complicated than a simple conversion (involving solving a problem called "time aggregation" also -- there's a whole appendix to the paper about it).

In the absence of the time aggregation problem, you can work out what needs to be done to the transitory shocks to convert them to different time scales by asking "what size shock for time scale 1/n would result in the sum of n such shocks having the variance we observe the annual object to have?" The problem with this is that it becomes nonsensical if you make "n" too large, like weekly or daily, because if the shocks are truly transitory (at the daily frequency, say), then 365 completely independent draws of the daily transitory shock are going to require a stupendously large variance in order to generate any meaningful variance when all 365 are averaged together to produce a yearly figure.

@sbenthall
Copy link
Contributor Author

Hmm. Ok. I see now what it needed to adjust the Transitory shock standard deviation.

I believe that in this case, the mean will also need to be adjusted as well.

In the core HARK code, this mean is actually always 1.
https://github.com/econ-ark/HARK/blob/master/HARK/ConsumptionSaving/ConsIndShockModel.py#L2295-L2305

I see this is also the case in the cstwMPC code:
https://github.com/llorracc/cstwMPC/blob/master/Code/cstwMPC_MAIN.py#L126-L135

Am I missing something? Or do we need to change the HARK default income process to allow for changing shock means if we want to allow it to handle quarterly models?

@sbenthall
Copy link
Contributor Author

Also... you mentioned an appendix about time aggregation.
I have not yet been able to find that -- is it printed with the article?
Would you have a link to that handy?

@llorracc
Copy link
Collaborator

llorracc commented Apr 5, 2021 via email

@sbenthall
Copy link
Contributor Author

Let me see if I understand this. Just focusing on the forward simulation:

In each period:

  • The permanent income grows multiplicatively by a mean 1 permanent shock
  • [Implicitly, the agent's non-normalized wealth level grows by this amount]*
  • A mean 1 transitory shock is added to the normalized market resources

When a period is a year, the transitory shock will correspond to an increase of (on average) 1 annual income-level to the market resource level.

When the period is a quarter, each period the agent's market resource level increases by (on average) 1 pLvl.

What isn't happening in the quarterly model is the agent is earning four times the annual income from the yearly model.
What is happening is that the pLvl in the quarterly model represents quarterly income.
Because it is a quarterly income level, the pLvl starts lower and grows more slowly.
This change is represented in the reduced standard deviations of the permanent income shock.

Is that correct?

One other question that comes up for me as I try to think through this:

  • Suppose there is a large downward swing in permanent income level. Theoretically, at that point their wealth level takes a correspondingly steep dive, if it's being computed from a normalized asset level (aLvl = pLvl * aNrm). That seems strange -- why would a sudden reduction of income result in a reduced level of wealth?
  • It's not so simple because there is also a consumption step. Could the consumption be responsible for the (end of period) drop in wealth? The would require the agent to consumer more after a decline in income, which is counterintuitive.

I must be missing something here.

@sbenthall
Copy link
Contributor Author

Because it is a quarterly income level, the pLvl starts lower and grows more slowly.
This change is represented in the reduced standard deviations of the permanent income shock.

I'm sorry -- I was incorrect about this, wasn't I?
The changing income growth rate is captured in the reduced PermGroFac...?

@llorracc
Copy link
Collaborator

llorracc commented Apr 5, 2021 via email

@sbenthall
Copy link
Contributor Author

Thank you. That does help.

I was forgetting that what's driving the mean income change is \Gamma, which is adjusted as a permanent factor in the quarterly model, while the shock definitions are adding variance but not anything to the mean income values.

@sbenthall
Copy link
Contributor Author

Do discount factors (beta) need to be adjusted if period frequency changes?
What about risk aversion factors?

@llorracc
Copy link
Collaborator

llorracc commented Apr 5, 2021

Do discount factors (beta) need to be adjusted if period frequency changes?

Yes. If I discount an event one year in the future by 4 percent, then I discount an event one quarter in the future by 1 percent.

What about risk aversion factors?

No. Those are about how much I dislike not knowing what my circumstances will be in the future. The degree of uncertainty itself increases with the horizon (I have a better idea what things will be like tomorrow than what they will be like 10 years from now), but (in the model we are using) the degree to which I dislike each chunk of uncertainty is independent of how far away it is (except insofar as the discount factor or other aspects of the model interfere). So, relative risk aversion of 3 at the annual frequency corresponds to 3 at the quarterly, monthly, or daily frequency.

@mnwhite
Copy link
Contributor

mnwhite commented Jul 10, 2024

We can definitely add a new set of tools to the Calibration directory that does time conversions of various kinds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants