I'm a bit confused by the query from Alistair Dempster and the
reply from Mike Sawada re random numbers.
In the first place, "defined by the normal distribution" is a bit
unclear: normal with what mean and variance? Presumably one does
not want mean=0 and variance=1 when truncating to keep the values
in the interval (.005, .035). For mean = .020 and sdev = .001,
one can get 100 values by .020 + .001*rnorm(100) -- the limits are
at +/- 15 standard deviations. For mean = .020 and stdev = .005,
the simplest procedure is to generate a large normal vector,
truncate it at the limits, and then use sample(), e.g.:
x <- .020 + .005*rnorm(10^5)
y <- x[ x > .005 & x < .035 ]
sample(y, 100);
similarly for any other mean and stdev.
Finally, none of the numbers generated will be irrational, because
of the inherent limit on number of digits in the representation
of computer numbers.
Dave Krantz
|