Background

Monte Carlo analysis is commonly used to propagate uncertainty in a model. It can be used with practically any model that has inputs, calculations, and outputs. It can also be used to simulate repeated trials or experiments. The general framework for a Monte Carlo analysis has four parts.

  1. Define model inputs with uncertainty
  2. Randomly sample values for the model inputs
  3. Perform a deterministic calculation using the sampled values for model inputs to calculate the model outputs. This represents a random sample of the model outputs. Repeat for many samples.
  4. Aggregate the model outputs by treating them as if they are a random sample.

Given enough samples, the probability distribution of the model outputs from the Monte Carlo analysis will be equivalent to the true uncertainty distribution of the model output. Monte Carlo is useful when other approaches are difficult or impossible. Many types of problems encountered in practice do not have a closed form solution making Monte Carlo analysis an attractive option.

Exercise

Given a set of 100 observed annual maximum flows recorded at a systematic gage, answer the following two questions.

Question 21. On average, what percentage of the observed annual maximum floods will have an AEP less than 0.1?

10%


Question 22. On average, what percentage of the observed annual maximum flows will be greater than the 50-year flow?

2%

Use a Monte Carlo analysis to generate a set of 100 annual maximum flows that represent the possible annual maximum flows that could occur this year.  Assume the annual maximum flood has an LP3 distribution with a mean of 2.5, a standard deviation of 0.3, and a skew of -0.1.

The Excel function RAND() can be used to generate a uniform random number between 0 and 1. According to the inverse transform sampling method, this random number is equal to the non-exceedance probability for the annual maximum flood, F(x) = RAND(). The annual exceedance probability is equal to the complement of the non-exceedance probability, AEP = 1 – F(x). This means that the AEP can be calculated as the complement of the random number, AEP = 1 – RAND().

The corresponding value of X is calculated from the LP3 distribution using the inverse transform sampling method. The user defined function LP3_INV can be used to calculate X based on the sampled AEP value and the given values for the mean, standard deviation, and skew.

https://en.wikipedia.org/wiki/Inverse_transform_sampling

The calculations to generate 100 annual maximum flood samples should look like the Table below.

Sample Number

Random Number (R)

RAND()

AEP

1 – R

X

LP3_INV(1-AEP, M, S, G)

Flow

10^X

1

0.410

0.590

2.437

273

2

0.857

0.143

2.820

660





100

0.221

0.779

2.272

187

Question 23. Given the 100 randomly generated flood samples, what percentage of the samples have an AEP less than 0.1?  The COUNTIF function might help.

10% on average


Question 24. Given the 100 randomly generated flood samples, what percentage of the samples have a flow greater than the 50-year flow? The LP3_INV function might help to calculate the 50-year flow. The COUNTIF function might help.

2% on average


Question 25. How do these estimates compare with the initial estimates?

They are similar.


Question 26. What are some reasons for the estimates being the same, about the same, or different?

In this example, sampling error is the predominant source of uncertainty.


Question 27. Repeat the experiment by generating 1,000 random flood samples. Does this improve the accuracy of the estimates? Why or why not?

Yes.  By sampling more times, uncertainty in the results is reduced.