econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
331 stars 198 forks source link

Implementation of quasi hyperbolic discounting #215

Open g-carranza opened 5 years ago

g-carranza commented 5 years ago

Are there any plans for future implementation of hyperbolic discounting for consumer agents? The implementation of naive quasi hyperbolic discounting should not be too complicated.

In the case of the perfect foresight agent: 1) It requires the modification of the effect discounting factor to include the hyperbolic factor. 2) The modification of solution_next to take as input the geometric solution (beta=1), instead of the one calculated with the impacted discount factor.

I have a working example using a PF agent, but the implementation in more complicated agents require perhaps more sophistication and care.

mnwhite commented 5 years ago

My colleague Jeremy Tobacman coded up a (fully naive) quasi-hyperbolic extension of the IndShockConsumerType a while back. We discussed its structure, and how to do it in a simpler, more HARK-like way. I will try to strongarm him into either a) sharing his first version or b) coding up the alternate structure I suggested. Maybe in January?

But yes, we are interested in models with time inconsistency. These are a lot more interesting in two asset models and/or with sophisticated agents who understand their time inconsistency. But as you say, that's a lot harder.

On Tue, Dec 18, 2018 at 7:44 PM Guillermo Carranza Jordan < notifications@github.com> wrote:

Are there any plans for future implementation of hyperbolic discounting for consumer agents? The implementation of naive quasi hyperbolic discounting should not be too complicated.

In the case of the perfect foresight agent:

  1. It requires the modification of the effect discounting factor to include the hyperbolic factor.
  2. The modification of solution_next to take as input the geometric solution (beta=1), instead of the one calculated with the impacted discount factor.

I have a working example using a PF agent, but the implementation in more complicated agents require perhaps more sophistication and care.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215, or mute the thread https://github.com/notifications/unsubscribe-auth/ANUQFexDFCygvM6Js79ATp5IfUg66Ut9ks5u6YwAgaJpZM4ZZVl0 .

jeremytob commented 5 years ago

Guillermo and Matt, The work I did is available here: https://github.com/jeremytob/HARK/tree/quasihyperbolic A few notes:

BaselineExample.solve() PerfectNaivete.cFuncterminal = BaselineExample.solution[0].cFunc PerfectNaivete.vFuncterminal = BaselineExample.solution[0].vFunc PerfectNaivete.solve()

Jeremy

On Tue, Dec 18, 2018 at 7:55 PM Matthew N. White notifications@github.com wrote:

My colleague Jeremy Tobacman coded up a (fully naive) quasi-hyperbolic extension of the IndShockConsumerType a while back. We discussed its structure, and how to do it in a simpler, more HARK-like way. I will try to strongarm him into either a) sharing his first version or b) coding up the alternate structure I suggested. Maybe in January?

But yes, we are interested in models with time inconsistency. These are a lot more interesting in two asset models and/or with sophisticated agents who understand their time inconsistency. But as you say, that's a lot harder.

On Tue, Dec 18, 2018 at 7:44 PM Guillermo Carranza Jordan < notifications@github.com> wrote:

Are there any plans for future implementation of hyperbolic discounting for consumer agents? The implementation of naive quasi hyperbolic discounting should not be too complicated.

In the case of the perfect foresight agent:

  1. It requires the modification of the effect discounting factor to include the hyperbolic factor.
  2. The modification of solution_next to take as input the geometric solution (beta=1), instead of the one calculated with the impacted discount factor.

I have a working example using a PF agent, but the implementation in more complicated agents require perhaps more sophistication and care.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215, or mute the thread < https://github.com/notifications/unsubscribe-auth/ANUQFexDFCygvM6Js79ATp5IfUg66Ut9ks5u6YwAgaJpZM4ZZVl0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448429074, or mute the thread https://github.com/notifications/unsubscribe-auth/AVwgfAqcvVN3t3wcNCNw4CK5GLKZNTrCks5u6Y6KgaJpZM4ZZVl0 .

llorracc commented 5 years ago

I feel that we naively thought that we would get to putting this in "main HARK" at some point in the near future ... for months and months and months.

Oh, the irony!

On Wed, Dec 19, 2018 at 11:37 PM jeremytob notifications@github.com wrote:

Guillermo and Matt, The work I did is available here: https://github.com/jeremytob/HARK/tree/quasihyperbolic A few notes:

  • I was working on this branch a long time ago. As Matt said, I conferred with him about how to make the contribution fit better with current HARK.
  • I only implemented perfect naivete. The reason is that even partial sophistication introduces policy function discontinuities and value function nondifferentiabilities.
  • In the repo linked above, the way to begin is to run ConsumptionSaving/Demos/QuasiHyperbolic.py. Guillermo, as you conjectured, the modifications required for perfect naivete aren't so complicated. They amount (in the branch's dated syntax) to setting things up so that these four lines of code work:

BaselineExample.solve() PerfectNaivete.cFuncterminal = BaselineExample.solution[0].cFunc PerfectNaivete.vFuncterminal = BaselineExample.solution[0].vFunc PerfectNaivete.solve()

Jeremy

On Tue, Dec 18, 2018 at 7:55 PM Matthew N. White <notifications@github.com

wrote:

My colleague Jeremy Tobacman coded up a (fully naive) quasi-hyperbolic extension of the IndShockConsumerType a while back. We discussed its structure, and how to do it in a simpler, more HARK-like way. I will try to strongarm him into either a) sharing his first version or b) coding up the alternate structure I suggested. Maybe in January?

But yes, we are interested in models with time inconsistency. These are a lot more interesting in two asset models and/or with sophisticated agents who understand their time inconsistency. But as you say, that's a lot harder.

On Tue, Dec 18, 2018 at 7:44 PM Guillermo Carranza Jordan < notifications@github.com> wrote:

Are there any plans for future implementation of hyperbolic discounting for consumer agents? The implementation of naive quasi hyperbolic discounting should not be too complicated.

In the case of the perfect foresight agent:

  1. It requires the modification of the effect discounting factor to include the hyperbolic factor.
  2. The modification of solution_next to take as input the geometric solution (beta=1), instead of the one calculated with the impacted discount factor.

I have a working example using a PF agent, but the implementation in more complicated agents require perhaps more sophistication and care.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215, or mute the thread <

https://github.com/notifications/unsubscribe-auth/ANUQFexDFCygvM6Js79ATp5IfUg66Ut9ks5u6YwAgaJpZM4ZZVl0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448429074, or mute the thread < https://github.com/notifications/unsubscribe-auth/AVwgfAqcvVN3t3wcNCNw4CK5GLKZNTrCks5u6Y6KgaJpZM4ZZVl0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448790505, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQlfxfGqrddKFtGzSwOPYw6r1oBOBFKks5u6s2bgaJpZM4ZZVl0 .

--

mnwhite commented 5 years ago

Oh, we will. It is persistently true that naive hyperbolic discounting will be added to HARK in a couple months.

On Wed, Dec 19, 2018 at 9:16 PM Christopher Llorracc Carroll < notifications@github.com> wrote:

I feel that we naively thought that we would get to putting this in "main HARK" at some point in the near future ... for months and months and months.

Oh, the irony!

On Wed, Dec 19, 2018 at 11:37 PM jeremytob notifications@github.com wrote:

Guillermo and Matt, The work I did is available here: https://github.com/jeremytob/HARK/tree/quasihyperbolic A few notes:

  • I was working on this branch a long time ago. As Matt said, I conferred with him about how to make the contribution fit better with current HARK.
  • I only implemented perfect naivete. The reason is that even partial sophistication introduces policy function discontinuities and value function nondifferentiabilities.
  • In the repo linked above, the way to begin is to run ConsumptionSaving/Demos/QuasiHyperbolic.py. Guillermo, as you conjectured, the modifications required for perfect naivete aren't so complicated. They amount (in the branch's dated syntax) to setting things up so that these four lines of code work:

BaselineExample.solve() PerfectNaivete.cFuncterminal = BaselineExample.solution[0].cFunc PerfectNaivete.vFuncterminal = BaselineExample.solution[0].vFunc PerfectNaivete.solve()

Jeremy

On Tue, Dec 18, 2018 at 7:55 PM Matthew N. White < notifications@github.com

wrote:

My colleague Jeremy Tobacman coded up a (fully naive) quasi-hyperbolic extension of the IndShockConsumerType a while back. We discussed its structure, and how to do it in a simpler, more HARK-like way. I will try to strongarm him into either a) sharing his first version or b) coding up the alternate structure I suggested. Maybe in January?

But yes, we are interested in models with time inconsistency. These are a lot more interesting in two asset models and/or with sophisticated agents who understand their time inconsistency. But as you say, that's a lot harder.

On Tue, Dec 18, 2018 at 7:44 PM Guillermo Carranza Jordan < notifications@github.com> wrote:

Are there any plans for future implementation of hyperbolic discounting for consumer agents? The implementation of naive quasi hyperbolic discounting should not be too complicated.

In the case of the perfect foresight agent:

  1. It requires the modification of the effect discounting factor to include the hyperbolic factor.
  2. The modification of solution_next to take as input the geometric solution (beta=1), instead of the one calculated with the impacted discount factor.

I have a working example using a PF agent, but the implementation in more complicated agents require perhaps more sophistication and care.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215, or mute the thread <

https://github.com/notifications/unsubscribe-auth/ANUQFexDFCygvM6Js79ATp5IfUg66Ut9ks5u6YwAgaJpZM4ZZVl0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448429074, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AVwgfAqcvVN3t3wcNCNw4CK5GLKZNTrCks5u6Y6KgaJpZM4ZZVl0

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448790505, or mute the thread < https://github.com/notifications/unsubscribe-auth/ABQlfxfGqrddKFtGzSwOPYw6r1oBOBFKks5u6s2bgaJpZM4ZZVl0

.

--

  • Chris Carroll

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/issues/215#issuecomment-448833817, or mute the thread https://github.com/notifications/unsubscribe-auth/ANUQFfN2UpzIGqJFq8WqB9aZj1reNfe8ks5u6vMCgaJpZM4ZZVl0 .

g-carranza commented 5 years ago

I created a branch quasi-hyperbolic-pf with an implementation of naive hyperbolic discounting using the PF agent.

The branch modification does two things:

I tested this implementation using a simple 3 period setup, which has an easy algebraic solution. I corroborate the implementation's solution against the closed form algebra in a Jupiter notebook ConsIndShockModelDemos/testing_hyperbolic_discounting.ipynb. I focused on a finite lifespan agent so I'm not sure how this solution translates to infinite lived agents. Also, the implementation currently breaks for other agents but the logic should be pretty similar.

mnwhite commented 3 months ago

This long fell off our radar, but it has a PR that I need to look at.