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

Let ConsRiskyAssetModel handle time-varying Rfree #1343

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

Mv77
Copy link
Contributor

@Mv77 Mv77 commented Aug 19, 2023

I was getting errors trying to get ConsPortfolio to use time varying interest rates Rfree.

The culprit was that the share-limit calculation assumed Rfree is constant. This PR fixes the issue.

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: +0.02% 🎉

Comparison is base (b18c71f) 72.68% compared to head (39abdcd) 72.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1343      +/-   ##
==========================================
+ Coverage   72.68%   72.71%   +0.02%     
==========================================
  Files          78       78              
  Lines       13052    13057       +5     
==========================================
+ Hits         9487     9494       +7     
+ Misses       3565     3563       -2     
Files Changed Coverage Δ
HARK/ConsumptionSaving/ConsRiskyAssetModel.py 44.55% <71.42%> (+0.18%) ⬆️
...ConsumptionSaving/tests/test_ConsPortfolioModel.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Mv77
Copy link
Contributor Author

Mv77 commented Aug 21, 2023

This is a pretty trivial PR and most of you are in Lausanne. Also, all tests pass and test coverage increases.

I'll merge without review.

@Mv77 Mv77 merged commit 7ce7138 into econ-ark:master Aug 21, 2023
17 checks passed
@alanlujan91
Copy link
Member

Can you confirm that the share limit applies to the 1 period solution and not just to the infinite horizon problem? I thought the share limit only existed in infinite horizon problem

@Mv77
Copy link
Contributor Author

Mv77 commented Aug 21, 2023

Hey, I think so. See below.

In any case we were computing that object even for LC calibrations (whether we're using it or not, which I'm not sure). And so time varying Rfree's resulted in errors.

Here's why I think the result applies:

As long as an agent has CRRA utility, no income, and decides on the share of wealth in stocks continuously, it is the case that $$v_t(m_t) = \Omega_t u(m_t)$$ for some possibly time-varying constant $\Omega$. This is true in infinite horizon and in finite horizon as long as every period satisfies that description (no income, etc) and the CRRA is constant.

So the portfolio problem is
$$\max_{s_t} E[\Omega_{t+1}u( a_t (R + s_t(\tilde{R} - R)))] = \Omega_{t+1}a_t^{1-\rho}\max_{s_t} E[u( R + s_t(\tilde{R} - R) )] )],$$
and I think we're using the FOC to the second problem to get the limiting share. If we interpret the limiting share as the share that would be optimal as assets become so large that income is irrelevant, it applies.

Does that sound right @llorracc ?

@Mv77 Mv77 deleted the plumbing/time-varying-rfree branch September 1, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants