Skip to content

Testing mc_sample_path with np.random.seed#152

Closed
oyamad wants to merge 1 commit intomasterfrom
test_mc_sample_path
Closed

Testing mc_sample_path with np.random.seed#152
oyamad wants to merge 1 commit intomasterfrom
test_mc_sample_path

Conversation

@oyamad
Copy link
Copy Markdown
Member

@oyamad oyamad commented May 8, 2015

Following the discussion in #147:

>>> import numpy as np
>>> prng = np.random.RandomState(42)
>>> u = prng.random_sample(size=10)
>>> u
array([ 0.37454012,  0.95071431,  0.73199394,  0.59865848,  0.15601864,
        0.15599452,  0.05808361,  0.86617615,  0.60111501,  0.70807258])

Let P = [[0.4, 0.6], [0.2, 0.8]], init = 0 (so u[0] is not used), and sample_size = 10. Given the values in u[1:], mc_sample_path should return [0, 1, 1, 1, 0, 0, 0, 1, 1, 1].

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 89.07% when pulling bdc6e67 on test_mc_sample_path into a9ee37a on master.

@jstac
Copy link
Copy Markdown
Contributor

jstac commented May 10, 2015

@oyamad I just commented on #147 without noticing this PR. What do you think about adding an optional argument to supply a seed to mc_sample_path?

To me it does seem desirable to allow users to supply seeds in a straightforward way.

oyamad added a commit that referenced this pull request Jun 6, 2015
@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Aug 7, 2015

@oyamad Has this issue now been addressed with the inclusion of PR #154?

oyamad added a commit that referenced this pull request Aug 8, 2015
@oyamad
Copy link
Copy Markdown
Member Author

oyamad commented Aug 8, 2015

@mmcky This is addressed by PR #166. See also my comment there.

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Aug 11, 2015

Great - thanks. I will close this PR then in preference or PR #166.

@mmcky mmcky closed this Aug 11, 2015
@oyamad oyamad deleted the test_mc_sample_path branch August 12, 2015 00:57
oyamad added a commit that referenced this pull request Aug 25, 2015
oyamad added a commit that referenced this pull request Aug 26, 2015
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.

4 participants