Environmental Engineering Reference
In-Depth Information
expects five simulated samples to be rejected on the average , despite the fact that all samples
belong to a normal distribution. This is another interpretation of the significance level α. In
the presence of statistical uncertainty, one must expect to make a wrong conclusion (reject
null hypothesis although it is true) on some occasions. One can also make a wrong conclu-
sion by failing to reject the null hypothesis although it is false. This is known as Type II
error. We do not elaborate further on hypothesis testing, because details are available in
standard texts.
1.2.4 Simulation of a normal random variable
1.2.4.1 Simulating standard uniform random variable U
The standard uniform distribution refers to the uniform distribution that is defined on [0,
1]. Both MATLAB and EXCEL have built-in function or add-in for simulating the standard
uniform random variable, denoted by U. These are in fact “pseudo” random number genera-
tors that generate deterministic numbers that mimic the behaviors of random numbers. In
MATLAB, the function rand( n , 1) will generate an ( n × 1) vector that contains n -indepen-
dent and identically distributed (iid) samples of U. In EXCEL, the “data analysis” add-in
can generate samples of U.
1.2.4.2 Simulating standard normal random variable X
Let us denote the standard normal random variable by X. It is first noted that Φ(X) is a
standard uniform random variable. This is due to the fact that the CDF of Φ(X) has the
following expression:
()
()
()
=
1
=
1
=
PXuPX
Φ
Φ
u
ΦΦ
uu
(1.27)
Since F( u ) = u is the CDF of the standard uniform distribution, Φ(X) is indeed a standard
uniform random variable. Namely,
= ()
UX
Φ
(1.28)
where U is a standard uniform random variable. In other words,
= ()
Φ 1
X
U
(1.29)
where Φ −1 is the inverse of the standard normal CDF. As a result, the following steps can be
used to simulate X:
1. Simulate U using MATLAB function 'rand' or EXCEL data analysis add-in.
2. Let X = Φ −1 (U). The Φ −1 function can be evaluated using MATLAB function
norminv(U), or using EXCEL NORMSINV(U).
It is worthwhile to point out that Equation 1.29 can be generalized to simulate any ran-
dom variable by replacing Φ −1 with the inverse CDF of the random variable. However, the
inverse CDF is usually not available in closed form and alternate methods have been devel-
oped to circumvent this computational difficulty. For example, the normal random variable
can be simulated using the following Box-Muller method (Box and Muller 1958):
 
Search WWH ::




Custom Search