-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Approximate share in Portfolio Model #1122
base: master
Are you sure you want to change the base?
Conversation
a few more comments
|
||
return r_diff, r_diff ** 2 | ||
|
||
prem_mean, prem_var = calc_expectation(self.RiskyDstn, premium) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanlujan91 not sure if this is a bug given your notation, but I think that what your are calling prem_var
is not the variance of the premium, but rather E[premium^2].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting to see what happens when you make the maximum amount of assets something much larger, like 2000 or 10000 or something. Out that far, the consumption function is essentially linear, so the error coming from the approximation's assumption that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mv77 you're right, I have called this prem_sqrd instead.
|
I'm pretty sure there's a more basic error, because as assets go to infinity the consumption function becomes linear and the approximation should become very good. Have you done the version where you increase the maximum value of a and the number of a gridpoints? PS. You should be able to look at just the last period of a 2-period problem; Samuelson showed that the portfolio share is the same no matter how many periods back you are from a terminal period in his model. So, that should let you go to town with lots of points and a very large max point like 2000 or 10000. PPS. If there's still a discrepancy, my guess is that it will be because the approximation to the shock that uses the variance is not very good. |
Do you know why the checks are failing? |
@llorracc this is with aMax = 1000 (instead of 100). |
Yes, the tests for Discrete Solver and Joint Distribution solver are failing, but this is not supposed to be a feature of those models. I have to reorganize where the approximations happen. |
To debug, I suggest you evaluate the last expression in (15) in the appendix to https://github.com/ccarrollATjhuecon/EquityPremiumPuzzle/blob/master/EquityPremiumPuzzle.pdf at If the first expression in (16) is not close to zero
If the first expression in (16) IS close to zero
PS. Whether or not you manage to track down the problem as above, it would be useful if you could edit the GitHub document to incorporate any higher order approximations that you are using so we can see exactly what you are doing. |
Codecov Report
@@ Coverage Diff @@
## master #1122 +/- ##
==========================================
- Coverage 73.96% 73.72% -0.24%
==========================================
Files 70 70
Lines 10761 10809 +48
==========================================
+ Hits 7959 7969 +10
- Misses 2802 2840 +38
Continue to review full report at Codecov.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Linear approximation of risky share given next period's cFunc.