[R] random numbers

2007-06-30 Thread Ross Boylan
Although this query was inspired by distributed random number generation, one of the questions (#2 below) is a single-machine issue. I call C++ code from R to generate simulated data. I'm doing this on a cluster, and use rmpi and rsprng. While rsprng randomizes R-level random numbers (e.g.,

Re: [R] random numbers

2007-06-30 Thread Dirk Eddelbuettel
On 30 June 2007 at 12:12, Ross Boylan wrote: | I call C++ code from R to generate simulated data. I'm doing this on a | cluster, and use rmpi and rsprng. While rsprng randomizes R-level | random numbers (e.g., from runif), it has no effect on the C code, which | is completely SPRNG and MPI

Re: [R] random numbers

2007-06-30 Thread Ross Boylan
On Sat, 2007-06-30 at 14:50 -0500, Dirk Eddelbuettel wrote: On 30 June 2007 at 12:12, Ross Boylan wrote: | I call C++ code from R to generate simulated data. I'm doing this on a | cluster, and use rmpi and rsprng. While rsprng randomizes R-level | random numbers (e.g., from runif), it has no

[R] Random numbers from skewed distributions

2007-06-25 Thread Anup Nandialath
Dear Friends, I was wondering if there is any package to get random numbers from the Burr 10 distribution. I checked the rmutil and actuar package. Both seems to implement the Burr 12 distribution. thanks in advance Regards Anup -

[R] random numbers selection - simple example

2007-06-06 Thread Jenny Barnes
Dear R-help, Which random number generator function would you recommend for simply picking 15 random numbers from the sequence 0-42? I want to use replacement (so that the same number could potentially be picked more than once). I have read the R-help archives and the statistics and computing

Re: [R] random numbers selection - simple example

2007-06-06 Thread Jenny Barnes
it helps, kevin - Original Message - From: Jenny Barnes [EMAIL PROTECTED] Date: Wednesday, June 6, 2007 10:30 am Subject: [R] random numbers selection - simple example Dear R-help, Which random number generator function would you recommend for simply picking 15 random numbers from

Re: [R] random numbers selection - simple example

2007-06-06 Thread Sarah Goslee
Assuming you want only integers, see ?sample Sarah On 6/6/07, Jenny Barnes [EMAIL PROTECTED] wrote: Dear R-help, Which random number generator function would you recommend for simply picking 15 random numbers from the sequence 0-42? I want to use replacement (so that the same number could

Re: [R] random numbers selection - simple example

2007-06-06 Thread Ted Harding
On 06-Jun-07 14:30:44, Jenny Barnes wrote: Dear R-help, Which random number generator function would you recommend for simply picking 15 random numbers from the sequence 0-42? I want to use replacement (so that the same number could potentially be picked more than once). R has the function

Re: [R] random numbers selection - simple example

2007-06-06 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenny Barnes Sent: Wednesday, June 06, 2007 7:55 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] random numbers selection - simple example You're all stars - thanks for the replies - I will go ahead

[R] Random numbers from noncentral t-distribution

2006-06-30 Thread Long Qu
Hi there: I'd thought these two versions of noncentral t-distribution are essentially the same: qqplot(rt(1000,df=20,ncp=3),qt(runif(1000),df=20,ncp=3)) But, the scales of the x-axis and the y-axis are quite different according to the QQ-plot. Did I make any mistakes

Re: [R] Random numbers from noncentral t-distribution

2006-06-30 Thread Thomas Lumley
On Fri, 30 Jun 2006, Long Qu wrote: Hi there: I'd thought these two versions of noncentral t-distribution are essentially the same: qqplot(rt(1000,df=20,ncp=3),qt(runif(1000),df=20,ncp=3)) But, the scales of the x-axis and the y-axis are quite different according to the QQ-plot.

Re: [R] Random numbers from noncentral t-distribution

2006-06-30 Thread Long Qu
Thank you very much for your kind reply. It solved the problem of rt( ). :D But it seems that the qt( ) also have problems: I modified the rt( ) function as you suggested, rt - function (n, df, ncp = 0) { if (ncp == 0) .Internal(rt(n, df)) else rnorm(n, ncp)/sqrt(rchisq(n, df)/df) }

Re: [R] Random numbers from noncentral t-distribution

2006-06-30 Thread Thomas Lumley
On Sat, 1 Jul 2006, Long Qu wrote: Thank you very much for your kind reply. It solved the problem of rt( ). :D But it seems that the qt( ) also have problems: Yes, there does seem to be a problem near zero. A clearer version is curve(qt(x,df=20,ncp=3),from=0,to=0.004)

[R] Random numbers negatively correlated?

2006-06-27 Thread Christian Hennig
Dear list, I did simulations in which I generated 1 independent Bernoulli(0.5)-sequences of length 100. I estimated p for each sequence and I also estimated the conditional probability that a one is followed by another one (which should be p as well). However, the second probability is

Re: [R] Random numbers negatively correlated?

2006-06-27 Thread Thomas Lumley
On Tue, 27 Jun 2006, Christian Hennig wrote: Dear list, I did simulations in which I generated 1 independent Bernoulli(0.5)-sequences of length 100. I estimated p for each sequence and I also estimated the conditional probability that a one is followed by another one (which should be p

Re: [R] Random numbers negatively correlated?

2006-06-27 Thread Thomas Lumley
On Tue, 27 Jun 2006, Thomas Lumley wrote: I got the table wrong, it should read x1/0 1/1 est11 000 - - - 001 - - - 010 1 0 0 011 0 1 1 100 1 0 0 101 1 0 0 110 1 1 0.5 111 0 2 1 So the explanation is slightly

[R] Random numbers

2005-12-21 Thread Carl
Hi All. I have R code whose functionality is being replicated within a C+ program. The outputs are to be compared to validate the conversion somewhat - however (as is always the case) I have stuffed my code with random number calls. Random uniform numbers in C+ are being produced using the

Re: [R] Random numbers

2005-12-21 Thread Duncan Murdoch
On 12/21/2005 9:47 AM, Carl wrote: Hi All. I have R code whose functionality is being replicated within a C+ program. The outputs are to be compared to validate the conversion somewhat - however (as is always the case) I have stuffed my code with random number calls. Random uniform

Re: [R] Random numbers

2005-12-21 Thread Bob Wheeler
You can use Marsaglia's multiply with carry. I haven't looked at the C code in R recently, but doubt if it has changed. The C code is very neat, using 6 #defines: static const double RANDCONST=2.32830643654e-10; unsigned long zSeed=362436069, wSeed=521288629; #define zNew

[R] random numbers within a given range

2004-12-27 Thread Rajdeep Das
Dear Colleagues, Is there a way to get random numbers within a given range? Regards and thanks in advance, Raj [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] random numbers within a given range

2004-12-27 Thread Peter Dalgaard
Rajdeep Das [EMAIL PROTECTED] writes: Is there a way to get random numbers within a given range? Yes. What distribution? If uniform, see help(Uniform). -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of

[R] Random Numbers

2003-12-16 Thread Silvia Perez Martin
Hello I´m a student from Spain. I couldn´t find something about R and I was asking if someone could tell me which generator of random numbers use rnorm and runif. I think I have discovered that in runif they use the inversion method, but I don´t find any clue where they use the Super-duper

Re: [R] Random Numbers

2003-12-16 Thread Spencer Graves
Have you looked at ?set.seed? This provides some detail in R 1.8.1 for Windows. hope this helps. spencer graves p.d. No hay que desculparse por su inglés. Está claro. Silvia Perez Martin wrote: Hello I´m a student from Spain. I couldn´t find something about R and I was asking if

Re: [R] Random Numbers

2003-12-16 Thread Ravi Varadhan
Take a look at the help for RNGkind as follows: ?RNGkind Ravi. - Original Message - From: Silvia Perez Martin [EMAIL PROTECTED] Date: Tuesday, December 16, 2003 12:45 pm Subject: [R] Random Numbers Hello Im a student from Spain. I couldnt find something about R and I was asking

Re: [R] Random Numbers

2003-12-16 Thread Thomas Lumley
On Tue, 16 Dec 2003, Silvia Perez Martin wrote: Hello I´m a student from Spain. I couldn´t find something about R and I was asking if someone could tell me which generator of random numbers use rnorm and runif. I think I have discovered that in runif they use the inversion method, but I

[R] Random numbers

2003-08-03 Thread dcum007
Thank you to all who helped me with the generation of random numbers. I have read much and learned even more. I even found some code that I have translated into java and am getting seemingly random output. :) I was wondering if there were any libraries for R which test the 'randomness' of the

[R] Random Numbers

2003-07-21 Thread dcum007
Thank you to all who replied to my previous question regarding the generation of random numbers. I have read up on the literature and learnt a whole lot more. In my research I found code for many generators which I have translated into java for my project. I'm now at the stage of testing