This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Multinomial randist
- From: Gavin <gec at threeplusone dot com>
- To: gsl-discuss at sources dot redhat dot com
- Date: Fri, 22 Nov 2002 21:06:45 -0800
- Subject: Multinomial randist
Hi,
I've attached code for a multinomial random distribution generator,
which
might be of some use. I used the conditional bionomial method, which,
unlike the implementation that was floating around the list in July,
does
not become much slower as N, the total number of samples, increases.
As well as the standard gsl_ran_multinomial and gsl_ran_multinomial_pdf
functions, I also added a gsl_ran_multinomial_lnpdf function, the log
of the pdf. I've found that the pdf function is useless when the
dimension of the distribution is large; then any point in the
distribution
will be of such low probability that gsl_ran_multinomial_pdf returns
zero.
Gavin
--
Gavin E. Crooks
Postdoctoral Fellow tel: (510) 642-9614
461 Koshland Hall fax: (413) 280-7813
University of California http://threeplusone.com/
Berkeley, CA 94720-3102, USA gec@compbio.berkeley.edu
Attachment:
multinomial.diff
Description: Binary data