python - random sampling from a list based on a distribution -
i have list of numbers, , sample list. sampling based on distribution specified user. not sure if alias method (here) using weights right one; limited knowledge says alias method uses uniform distribution lone (correct me on please!). if need specify sample using log-normal underlying distribution or poisson matter? how do kind of sampling?
a related question, if list [1, 2, 3, 4, 5] , mean 3, how sampling?
you can utilize bunch of numpy functions here:
http://docs.scipy.org/doc/numpy/reference/routines.random.html
standard python random library not provide various distrubutions rng. , yes, default 1 uniform.
python statistics sampling
No comments:
Post a Comment