
74 Data Analysis and Statistics for Geography, Environmental Science, and Engineering
For practical purposes, it is the same to use u instead of 1 − u. So, rst generate u and then apply
the inverse x = −ln(u)/a.
A value z from a standard normal Z can be generated from two u
1
, u
2
numbers generated from
U(0,1) using
zuu
cos( )ln( )
π
(3.40)
In R, a uniform RV can be in any range [a, b] directly by using runif(1,a,b). In addition, there are
a variety of functions for other distributions, such as the normal and the exponential. For example,
the normal of mean u and standard deviation s can be generated with rnorm(n,u,s) where n is the
number of ...