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 f x (x) X i (t) T(x i ) y i (t) m y f y (y,t) s y (t)
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 (y i ) G(x)= cdf desired for input random variables y i can be considered the cdf of a random variable x i with the arbitrary distribution G(x)
Example: Exponential Distribution y G( x) 1 e ax 1 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 x i y i e ax ln(1 a Exponentially distributed r.v. i y i ) Generate with uniform random # generator
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 - Must specify mean & spatial covariance structure of both indicator variables and continuous random variable processes Temporally correlated random processes: Markov process generators (specify m,s 2, transition probabilities)
How many replicates are sufficient? Test input statistics for convergence to known moments Test hypothesis μ = μ 0 σ 2 = σ 02 Test output statistics for convergence to constant values Test hypothesis μ 1 = μ 2 Z test χ 2 test T test σ 12 = σ 22 F test 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 Prob ˆ q a q ˆ q a 0.95 qˆ Corresponds to 2.5 percentile where ˆ q is sample Corresponds to 97.5 percentile moment and q is population moment If is normally distributed, a=1.97 std err( ) qˆ qˆ For ˆ q ˆ m std error s N For ˆ q ˆ s std error s 2N μ normal as long as x i are independent and drawn from same distribution σ normal for x i independent and drawn from NORMAL distribution
95% Confidence Intervals 1.97σ 2N σ 1.97σ Suppose want 95% confidence intervals to be +/- 10% qˆ 2N Prob ˆ q 0.1 ˆ q q ˆ q a 1.97 std error ( ˆ) q 0.1 ˆ q 0.1 ˆ q 0.95 Estimate w/in 10% of true value with 95% confidence
95% Confidence Intervals For the mean 0.1 ˆ m N 1.97s N 1.97 ˆ s 0.1 ˆ m 2 1.97 ˆ s N # replicates required depends on coefficient of variation of process For the std dev 0.1 ˆ s N 1.97s 1.39s 1.39 ˆ s 2N N N 1.39 0.1 2 196 Only strictly accurate for x i normal and independent. Absolute minimum
Extra Lecture Material Analyzing Categorical/Indicator Data
Analyzing Categorical Data Categorical r.v. set of observations, s( x ), at locations x that can take on any of a finite number of mutually exclusive, exhaustive states (s k ), e.g. soil type, land cover, geology An indicator random variable can be defined Without any natural ordering Use this indicator variable to calculate statistics i x, s k 1 if s( x ) 0 otherwise s k For these indicator transform variables the mean, covariance, semivariogram, cross-covariance and cross-variogram can be defined Each state s k has a unique set of statistics (i.e mean, covariance, semivariogram, etc)
Other Indicator Transforms Sometimes the pattern of spatial continuity of an attribute can vary depending on the magnitude of the attribute. This can be analyzed by defining the indicator transform: i z, x k 1if x( z) 0 otherwise where various levels of threshold values x k can be used For these indicator transform variables the mean, covariance, semi-variogram, cross-covariance and crossvariogram can also be defined x k
Analyzing Indicator Data Mean Covariance Semivariogram Cross-covariance Cross-semivariogram