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
sampling from a general discrete probability distribution #6662
Comments
comment:1
Why is the reference manual formatting broken? After doing "sage -docbuild reference html" the examples in the entry "Interface to gsl discrete random variable generator" in Probability have examples that are not formatted. Why? What's going wrong with the docstring formatting in my pyx file? |
Attachment: general_discrete_distribution.patch.gz |
comment:2
Fixed the docstring formatting. |
comment:3
I can try to test this, but I'm wondering how (for example) do I generate a list of 10 numbers in (0.1,2.3) randomly having the normal distribution with mean 1 and standard deviation 2? (Similar question for other common distributions.) |
comment:4
This patch installs fine with 4.1.1.a1 on an amd64 machine running ubuntu 9.04. It passes sage -testall, except for the known failures. I'm a little concerned about the docstrings. If I were more of a probability expert maybe this would not be an issue but not being an expert (which maybe is a good thing?) I don't see how to use it to do some basic sampling which might be useful for teaching a first course in probability. |
comment:5
I only wrote an interface to one particular discrete distribution in gsl. I'll add stuff for normal distribution, binomial, etc later this month (travelling and no time to do Sage). |
comment:7
Closing this as a duplicate of #6662. |
comment:8
You mean #6827! That wasted 20 minutes for me, Minh. :) |
This patch exposes the general discrete distribution code in the Gnu Scientific Library (GSL). It provides a fast way to sample from a user-defined discrete probability distribution, and it also extends the DiscreteProbabilitySpace class by allowing sampling from the defined distribution.
CC: @sagetrac-kohel
Component: statistics
Author: carlohamalainen
Issue created by migration from https://trac.sagemath.org/ticket/6662
The text was updated successfully, but these errors were encountered: