-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Centralizing Value and MargValue functions #888
Conversation
The previous commits centralize If you like this idea, I can continue with |
In my view this is exactly the right direction. |
The previous commits implement n-dimensional |
Would you like me to review this? I see it is not marked as WIP |
Yes, please |
Beautiful work. Thanks for doing this. It passes review. Could I ask you to please add a commit with an edit to the CHANGELOG describing the change and linking to this PR? https://github.com/econ-ark/HARK/blob/master/Documentation/CHANGELOG.md I believe it counts as a Major change. It should make it into the next release, which may be early this week. |
One other question: I've noticed this related code in the PerfectForesight model which is involved in constructing value functions.
Is it possible to streamline that code any further given the changes you are making here? |
Does not seem to me like it is. There are four lines of code, two using |
Ready! (in the last commit) |
Call them ___CRRA. |
Since @sbenthall's review, I have:
|
The trick of working with value and marginal value functions in 'inverse-space' is now applied in many models in HARK. This happens mostly through the
ValueFunc
andMargValueFunc
classes.However, the general idea of these classes is not captured in a centralized place. Different versions have been defined as models have been added: the 1-d version is in
ConsIndShockModel
, the 2-d version inConsGenIncProcessModel
, and my new portfolio model will use a 3-d version.This makes it so that if I'm working on a new, say, 2-d model, I have to go check whether this has already been implemented in some of the existing models. Or if I need both 1-d and 2-d versions (as
ConsPortfolioModel
does), I need to import them from different models. I think this will lead to multiple versions of these objects being defined in different places.This pr aims to construct general n-dimensional versions that can be imported from
interpolation
(or somewhere else?).Would this be useful or is there a reason for these objects to be defined in different places?