Monte Carlo Simulation

advertisement
Monte Carlo Simulation
CWR 6536
Stochastic Subsurface Hydrology
Steps in Monte Carlo Simulation
• Create input sample space with known
distribution, e.g. ensemble of all possible
combinations of v, D, q, m values
• Run each realization of v, D, q, m values through
model to produce output sample space
• Repeat experiment many times to get accurate
representation of input sample space and accurate
statistics of output sample space
• Calculate statistics of output sample space, i.e.
pdf, mean, variance, etc. as a function of location
Steps in Monte Carlo Simulation
Primary questions to ask
• How to generate input samples?
– are random inputs correlated with each other
– are random inputs correlated in space or time
• How many replicates are required to get
reliable output statistics?
– test input statistics to be sure they are generated correctly
– test convergence of output statistics to constant values
– calculate approximate number of replicates needed as get
an idea of magnitude of mean and variance of the output.
Generating random variables of
arbitrary distribution
• Generate uniform distribution of random numbers
between 0 and 1 (yi)
• yi can be considered the cdf of a random variable
xi with the arbitrary distribution G(x)
Example: Exponential Distribution
y  G ( x)  1  e  ax
1  yi  e  axi
 ln(1  yi )
xi 
a
•
Now x is a random variable with cdf G(x) =1-e-ax and pdf
ae-ax
• Thus can use uniform distribution random number
generator to generate random variable of any distribution
Generating random fields/processes
(See Deutsch & Journel, 1998; Goovaerts, 1997)
• Spatially distributed random fields
- Categorical indicator simulation to honor specific
geometrical patterns (i.e. layering)
- Sequential Gaussian simulation, LU decomposition,
and/or Turning Bands generator to simulate distribution of
continuous properties within geometry
- Can generate conditional or unconditional simulations;
must specify mean & spatial covariance structure, as well
as data to be used for conditioning)
• Temporally correlated random processes:
– Markov process generators (specify m,s2, transition
probabilities)
How many replicates are sufficient?
• Test input statistics for convergence to
known moments
• Test output statistics for convergence to
constant values
• Use confidence intervals to estimate number
replicates required to give desired accuracy
once have estimate of mean and variance of
output
95% Confidence Intervals
• Consider the moment estimator qˆ


Prob qˆ  a  q  qˆ  a  0.95
where qˆ is sample moment and q is population moment
• If qˆ is normally distributed, a=1.97 std err(qˆ )
For qˆ  mˆ
std error 
s
N
For qˆ  sˆ
std error 
s
2N
95% Confidence Intervals
• Suppose want 95% confidence intervals to be +/10% qˆ


Prob qˆ  0.1qˆ  q  qˆ  0.1qˆ  0.95
 a  1.97 std error (qˆ)  0.1qˆ
95% Confidence Intervals
• For the mean
0.1mˆ 
1.97s 1.97sˆ

N
N
 1.97sˆ 
N 

 0.1mˆ 
• For the std dev
2
1.97s 1.39s 1.39sˆ
0.1sˆ 


2N
N
N
2
 1.39 
N 
  196
 0.1 
Download