-
-
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
calc_expectation
returns additional dimension
#1098
Comments
This bit of code is handling the dimensionality of the Lines 1341 to 1345 in 84ee03e
It appears that it does not handle this use case properly. It should be outputing an [b_N, s_N] sized array. The fix for this should be good for any number of arguments. Test-driven development would be good here. |
@llorracc did some work on this in his HARK 2.0 pre-alpha PR and is interested in talking to @nicksawhney about this. |
I would be happy to discuss whenever convenient, feel free to shoot me an email @llorracc I’ll make sure to use test driven development @sbenthall |
Nick and Alan and I had a conv about this, in which I suggested that Nick
do a deep dive into how Mathematica handles expectations (sympy does it in
very much the same way, and I'm pretty well convinced it's because there's
basically one pretty compellingly right way to do it; I recommended
Mathematica only because there's great documentation and tutorial material
for Mma's handing of prob and stat, and of Expectations and related
topics).
The deep dive will take some time -- a few days, maybe -- and I wanted to
make sure you knew I'd proposed this to him because it's up to you as his
real boss to decide how he allocates his time.
…On Wed, Feb 9, 2022 at 1:13 PM nicksawhney ***@***.***> wrote:
I would be happy to discuss whenever convenient, feel free to shoot me an
email @llorracc <https://github.com/llorracc>
I’ll make sure to use test driven development @sbenthall
<https://github.com/sbenthall>
—
Reply to this email directly, view it on GitHub
<#1098 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCK7ZONIFSHKTXH2AYLQDU2KVE3ANCNFSM5LRAXTVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
- Chris Carroll
|
@llorracc @alanlujan91 Could either of you point to what aspect of Mathematica/Sympy you are interested in reproducing in HARK? |
I am not very familiar with Mathematica either, but I was at the meeting yesterday and I think @llorracc wants an https://docs.sympy.org/latest/modules/stats.html
The |
Almost.
A Mathematica (Mma) example would be something like:
which would return
which would return (Wolfram has a free online version of Mathematica in which you can paste small snippets of Mma code to try them out; it should be possible to copy and paste these there and get the promised results). sympy does exactly the same thing (with slightly different syntax), and from a brief examination of it I believe TensorFlow permits the same thing (though for some reason they call a Both Mathematica and sympy will allow us to leave the objects in symbolic form, and are capable of doing symbolic manipulations on them while they remain in symbolic form. That is, if Probably the best way to do this would just be to make sympy a dependency and use sympy's syntax. Or TensorFlow or maybe pytorch. Once we adopt some foundational architecture, we can build on top of it the things we've been wanting to build, like a system for generating and keeping track of discretizations. cc'ing @Mv77 |
I think the main thing blocking practical exploration of this space is #1105 |
From discussion with @llorracc today:
|
Just wanted to make sure @nicksawhney saw this |
Yeah, |
HARK/HARK/ConsumptionSaving/ConsPortfolioModel.py
Lines 657 to 663 in 1d37908
In the above code,
calc_expectation
returns an additional dimension (dvdb_intermed
is returned with shape[b_N, s_N, 1]
). This might have to do with passing 2 arguments to the function since this is not an issue that I'm aware of when only 1 argument is passed.The text was updated successfully, but these errors were encountered: