Skip to content
Back to formatted view

Raw Message

Message-ID: <3A822319EB35174CA3714066D590DCD504AF7641@usrymx25.merck.com>
Date: 2004-01-16T23:19:11Z
From: Liaw, Andy
Subject: generate random number of any given distribution

If you can compute the quantile function of the distribution (i.e., the
inverse of the integral of the pdf), then you can use the probability
integral transform:  If U is a U(0,1) random variable and Q is the quantile
function of the distribution F, then Q(U) is a random variable distributed
as F.

This is not necessarily the most efficient way of generating the random
number, but it may be the only way in some cases.

HTH,
Andy 

> From: Yan Yu
> 
> Hello,
> Is there a function in R to generate random number of any given
> distribution (its pdf is given), besides uniform and gaussian
> distribution?
> 
> Thanks,
> yan


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}