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

Small: alternate drawDiscrete #50

Closed
mnwhite opened this issue Jun 3, 2016 · 1 comment
Closed

Small: alternate drawDiscrete #50

mnwhite opened this issue Jun 3, 2016 · 1 comment

Comments

@mnwhite
Copy link
Contributor

mnwhite commented Jun 3, 2016

The drawDiscrete function in HARKsimulation should be extended with a boolean input to choose between two modes:

  1. Current implementation, where draws from a discrete distribution are independent of each other. Thus an input of p = [1/3,1/3,1/3] and x = [1,2,3] and N = 10000 might return an array of all 1's (with very small probability).

  2. Alternate version that forces the simulated draws to match the discrete distribution as closely as possible, given the finite number of draws. A version of this is in ConsumerType.makeIncShkHist(), so not much new coding is required.

I think (1) should be the default, as that's how the other drawX functions work.

@mnwhite
Copy link
Contributor Author

mnwhite commented Jun 17, 2016

Done in new commit to comments-and-cleanup.

@mnwhite mnwhite closed this as completed Jun 17, 2016
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

No branches or pull requests

1 participant