Skip to content
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

Distribution updates #1323

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

alanlujan91
Copy link
Member

Please ensure your pull request adheres to the following guidelines:

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

random seed now returns a seed generated from the RNG of this distribution
discretize only applies to continuous distributions
return DiscreteDistribution if sigma = 0
add endpoint options
use `random_seed`
clean up code and add endpoints
HARK.distribution.random_seed() generates a seed from entropy
the class method random_seed generates a seed from distribution RNG
@alanlujan91
Copy link
Member Author

Do not merge until #1306 is merged

@Mv77
Copy link
Contributor

Mv77 commented Jul 26, 2023

Hey,

#1306 is pending on the whole "what should happen when we pass different things to .expected and .dist_of_fun."

If you want me to merge that in and postpone that conversation to let this advance, happy to do it.

@alanlujan91
Copy link
Member Author

5 tests fail, which isn't drastic, will test what happens if I set seeds to 0

@alanlujan91
Copy link
Member Author

Only 3 tests fail when changing the way default and random seeds work throughout HARK in a way that is recommended by folks at scipy. See Warning https://docs.scipy.org/doc/scipy/tutorial/stats.html#random-number-generation

This PR allows us to use simple seeds when we must (seed = 0) and "good" pseudorandom seeds when we need.

@sbenthall
Copy link
Contributor

Of the failing tests, one is of a simulation output. But a couple are testing the output of the AFunc. Is this concerning?

self.assertAlmostEqual(self.economy.AFunc.slope, 1.11810, places=HARK_PRECISION)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants