help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Random numbers within some ranges in the domain using dif


From: Daniel J Farrell
Subject: Re: [Help-gsl] Random numbers within some ranges in the domain using different distributipons?
Date: Tue, 17 Jun 2008 17:01:02 +0100

Hello Mohd,

I think you are looking for this function:

f(r) = a + (b - a) * r

where a is the min value, b is the max values and r is a random number distributed between 0 and 1 (e.g. use gsl_rng_uniform_pos() to generate r).

This come up a lot on the mailing list maybe it should be added to the library?

Cheers,

Dan.



On 17 Jun 2008, at 16:26, Mohammad Khaleghi wrote:

Hi everybody!

Could somebody please tell me how to generate random numbers within some ranges in the domain? I saw the documentation and did not see anything like setting a min and max. I mean for a distribution that has a domain (-inf, + inf) could one set some range (min, max) to sample from? Or it is not possible with gsl?

thans, Mohd

_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/? address@hidden



_______________________________________________
Help-gsl mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-gsl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]