s-news
[Top] [All Lists]

Re: Generating random real numbers

To: Alastair Dempster <demp2979@mach1.wlu.ca>
Subject: Re: Generating random real numbers
From: "Mike C. Sawada" <msawada@aix1.uottawa.ca>
Date: Tue, 3 Apr 2001 13:33:52 -0400 (EDT)
Cc: splus list <s-news@wubios.wustl.edu>
In-reply-to: <3AC9FDBD.2FA414DA@mach1.wlu.ca>
Try:

 runif(100,min=0.005,max=0.035)

will produce 100 real numbers (real as far as rational and irrational
numbers may ocurr) between the ranges of 0.005 and 0.035.

-------------------------------------------------------------------------------
Mike C. Sawada                                 |Tel: 613-562-5800 x1734
Laboratory of Paleoclimatology and Climatology |Fax: 613-562-5145
Department of Geography                        |msawada@aix1.uottawa.ca         
University of Ottawa
165 Waller Street
Ottawa, ON K1N 6N5
  -----------------                                      -----------------
        ************************************************************
        WWW: http://www.uottawa.ca/academic/arts/geographie/lpcweb/
        ************************************************************
-------------------------------------------------------------------------------

On Tue, 3 Apr 2001, Alastair Dempster wrote:

> I'm posting this for an Splus user who is not part of this
> discussion group:
> 
> She writes:
> "I am interested in generating a set of 100 random real numbers
> between 0.005 and 0.035, where the probability of drawing a specific
> value is
> defined by the normal distribution.  rnorm() will not let me define
> the limits of
> my dataset, yet my model parameter values cannot physically exceed
> 0.035 by
> definition.  Is anyone aware of how to specify range limits when
> generating random
> numbers with a non-uniform distribution? I have explored sample(),
> runif(), rnorm(), and rmvnorm(), all of
> which nicely generate random numbers.  However, either they are not
> real (as in the case of sample()), or I cannot figure out how to
> define a range of values for the random sample."
> 
> She is using Splus 2000 under NT4.
> 
> I have had a look at the discussions about random number generation
> in the archives but did not find anything suitable.
> 
> Can anyone tell us how to code this or provide a reference?  I will
> post a summary on behalf of my colleague.
> 
> Thank you,
> 
> Alastair Dempster
> Wilfrid Laurier University
> Waterloo, Canada
> 
> 
> 
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
> 


<Prev in Thread] Current Thread [Next in Thread>