[R] Random numbers with PDF of user-defined function

2010-04-29 Thread Nick Crosbie
Hi, In S+/R, is there an easy way to generate random numbers with a probability distribution specified by an exact user-defined function? For example, I have a function: f(x) = 1/(365 * x), which should be fitted for values of x between 1 and 100,000 How do I generate random numbers with a

Re: [R] Random numbers with PDF of user-defined function

2010-04-29 Thread Robert A LaBudde
At 05:40 AM 4/29/2010, Nick Crosbie wrote: Hi, In S+/R, is there an easy way to generate random numbers with a probability distribution specified by an exact user-defined function? For example, I have a function: f(x) = 1/(365 * x), which should be fitted for values of x between 1 and 100,000

Re: [R] Random numbers with PDF of user-defined function

2010-04-29 Thread Duncan Murdoch
On 29/04/2010 5:40 AM, Nick Crosbie wrote: Hi, In S+/R, is there an easy way to generate random numbers with a probability distribution specified by an exact user-defined function? For example, I have a function: f(x) = 1/(365 * x), which should be fitted for values of x between 1 and 100,000