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

sampling from a general discrete probability distribution #6662

Closed
sagetrac-carlohamalainen mannequin opened this issue Jul 31, 2009 · 8 comments
Closed

sampling from a general discrete probability distribution #6662

sagetrac-carlohamalainen mannequin opened this issue Jul 31, 2009 · 8 comments

Comments

@sagetrac-carlohamalainen
Copy link
Mannequin

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

@sagetrac-carlohamalainen
Copy link
Mannequin Author

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?

@sagetrac-carlohamalainen
Copy link
Mannequin Author

Attachment: general_discrete_distribution.patch.gz

@sagetrac-carlohamalainen
Copy link
Mannequin Author

comment:2

Fixed the docstring formatting.

@wdjoyner
Copy link

wdjoyner commented Aug 2, 2009

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.)

@wdjoyner
Copy link

wdjoyner commented Aug 2, 2009

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.

@sagetrac-carlohamalainen
Copy link
Mannequin Author

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).

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 9, 2009

comment:7

Closing this as a duplicate of #6662.

@sagetrac-mvngu sagetrac-mvngu mannequin added r: duplicate and removed p: minor / 4 labels Sep 9, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Sep 9, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin removed this from the sage-4.1.2 milestone Sep 9, 2009
@kcrisman
Copy link
Member

comment:8

You mean #6827! That wasted 20 minutes for me, Minh.

:)

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

No branches or pull requests

2 participants