-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add reference guide about the state space. #372
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #372 +/- ##
=======================================
Coverage 85.43% 85.43%
=======================================
Files 47 47
Lines 3418 3418
=======================================
Hits 2920 2920
Misses 498 498
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
I am not particular confident in the review myself :). Maybe we should talk tomorrow to resolve the issue. We should both read this section (https://respy--372.org.readthedocs.build/en/372/development/contributing_to_respy.html#types-of-documents) and the link to find out where we want to go with this.
groups. This guide contains an explanation the most important components of the state | ||
space. | ||
|
||
The implementation of the state space in respy serves several purposes. |
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.
I think this paragraph should be split into two parts.
The first part defines what is meant by the state space which is exactly what you do in the beginning. If you feel you delve too much into the economics, you could draft references to the explanations written by Rafael and Benedikt.
The other part defines the problem we need to solve. Talk about memory demands. Reference the curse of the dimensionality. Maybe a back-of-the-envelop calculation: 52 Mio states for KW97. A float64 variables costs 400mb and int8 52mb. The other part defines the problem we need to solve. Talk about memory demands. Reference the curse of the dimensionality. Maybe a back-of-the-envelop calculation: 52 Mio states for KW97. A float64 variables costs 400mb and int8 52mb. What is a float? 10 wages and nonpecs, 1 expected vlaue functions, temporariliy 5 continuation values, 4 of 16 coviarates-> 20 * 400mb = 8GB. What is uint8? 6 state dimensions, 12 covariates -> 18 * 52MB = 1GB.
Then, I could also add some history information. The evolution of the state space: storing all states in tabular format and having a matrix to find child states -> having core states in tabular format and adding dense information if necessary combined with period specific indexer.
a tuple for the choice set which contains booleans for whether a choice is available. | ||
The complex index for a dense index also contains the dense vector in the last position. | ||
Communication | ||
------------- | ||
|
||
.. _state_space_methods: |
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.
The following are docstrings.
|
||
Returns | ||
---------- | ||
wages : np.array |
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.
wages : np.array | |
wages : numpy.ndarray |
Array with dimensions n_states x n_choices. | ||
Contains all wages for a particular state choice | ||
combination within a dense period choice core. | ||
nonpecs : np.array |
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.
nonpecs : np.array | |
nonpecs : numpy.ndarray |
This is the correct type.
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.
And you need to write out numpy and pandas
@@ -171,6 +189,10 @@ def _full_solution( | |||
In contrast to approximate solution, the Monte Carlo integration is done for each | |||
state and not only a subset of states. | |||
|
|||
Returns | |||
---------- | |||
period_expected_value_functions: np.array |
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.
period_expected_value_functions: np.array | |
period_expected_value_functions: numpy.ndarray |
|
||
See also | ||
-------- | ||
See :ref:`state space location indices <state_space_location_indices>` |
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.
no indent.
@@ -331,6 +366,11 @@ def set_attribute_from_keys(self, attribute, value): | |||
value : numpy.ndarray | |||
The value to which the Numpy array is set. | |||
|
|||
See also | |||
-------- | |||
A more theoretical explanation can be found here: See :ref:`set attribute |
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.
no ikndent.
essentially copies the full state space. The disjunction makes use of this property. By | ||
expressing a state as a combination of a dense and a core state we avoid several | ||
duplications. | ||
.. _dense_grid: |
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.
I think that some of the information below should be moved to the attribute section in the docstring of the state space.
the objects are saved to disk after they are created and only called whenever | ||
they are required. | ||
|
||
Division |
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.
Partly attribute description or moved up where the separation by choice sets is explained.
Complete reference guide for the new state space.
Todo