This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Random Number Questions
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Rodney Sparapani <rsparapa at post dot its dot mcw dot edu>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Sat, 30 Mar 2002 10:47:45 +0000 (GMT)
- Subject: Re: Random Number Questions
- References: <200203291806.g2TI6IP22273@post.its.mcw.edu>
Rodney Sparapani writes:
> gsl-discuss:
> First, there seems to be a problem in the Random Number docs. For
> example, in The Gaussian Dist. I believe that
> gsl_ran_gaussian_ratio_method should be random and
> gsl_ran_ugaussian_pdf should be function. There seem to be many
> instances where function and random are reversed.
Thanks. I can see some.
> In addition, the gaussian functions take the standard deviation
> rather than the variance. I find this contrary to common practice.
> I'd suggest that new functions be added to use the variance (maybe
> these could be provided by the pre-processor).
> Also, it is
> generally more convenient to work with the logarithm of the pdf.
> Could functions like the following be entertained?
> double gsl_ran_gaussian_log_pdf (const double x, const double
> variance) {
> double p = -0.5 * (log (2 * M_PI * variance) + (x * x) /
> variance); return p;
> }
I think the current arrangement is acceptable for most users,
especially for pdfs which return zero.
If you'd like to write and distribute a file with alternate
definitions I'm sure we could link to it from the gsl page. People
could drop it into their own source if they needed it.
Brian