-
-
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
Array-valued discrete distribution #1146
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ff335f1
Add tests that a matrix valued distribution should pass
Mv77 d2f038e
Let dim and draw support matrices
Mv77 4cf28a8
Implement calc_expectation
Mv77 4a52f23
Fix mvnorm test
Mv77 c811a18
Extra args in calc_expectations
Mv77 58e0247
Add support and test for dstn of function
Mv77 8ad4a34
Lint
Mv77 3ba9d11
Change DiscreteDistribution to assume its receiving an array
Mv77 d058028
Update combine_distributions and calc_expectation
Mv77 ddf7ba9
Update core tests
Mv77 e1f8a85
Update distr_of_function
Mv77 271c6c0
Change indexing to maintain sim tests
Mv77 6bd15d9
Revert the calc_expectations dimension upgrade
Mv77 390447b
Add behavior that old models expect
Mv77 de47745
Adapt models and tests to new dstn.X
Mv77 d863f45
Enforce dimension types in draw
Mv77 3cd5def
Fix failing examples
Mv77 e6d31b9
Update docstrings
Mv77 0dce71e
Update CHANGELOG.md
Mv77 73f2f78
Replace list(map()) with list comprehensions
Mv77 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 seems like a lot of extra code is now needed to flip vertical vectors/arrays into horizontal ones.
Would it be possible to have the arrays oriented horizontal in the DiscreteDistribution object?
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.
Possible yes, but I still thought this would be the path of least resistance.
I think other parts of HARK that deal with multivariate distributions use things like
dstn.X[n]
to find all the possible draws of the nth dimension. This seems like an intuitive and compact code pattern that I would like to keep. It was easier for me to conceptually think that nature was always the last dimension.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.
"X" is truly a terrible name for an object property that is doing so much work. See #1051
I'm not suggesting you replace "X" with something else in this PR, but I wonder what mathematical object X is now.
It's possible that we could have multiple ways of accessing this data within a distribution, so it requires less manipulation before entering and after pulling it from the object.