Background

Monte Carlo analysis can also be used for numerical integration. The values of X, (X-M)2, and (X-M)3 in the expected moments equations are uncertain for censored data. The expected moments algorithm uses an estimate of the expected (or average) values referred to as E[X], E[(X-M)2], and E[(X-M)3]. These expected values are calculated as a weighted average by integration. Monte Carlo analysis can be used to perform the integration.

The expected moments depend on the low and high flow values that define the flow interval and the parameter estimates that define the frequency curve. This means the value of X depends on the flow interval and the frequency curve. Therefore, random samples of X in the flow interval can be generated from the frequency curve. Each sample of X must be in the flow interval and must come from the frequency curve. The values of X, (X-M)2, and (X-M)3 can then be calculated for each random sample of X. The average of these values can be calculated over many samples of X to obtain estimates for E[X], E[(X-M)2], and E[(X-M)3].

Exercises

Use a Monte Carlo analysis to generate a set of 100 random annual maximum flood samples

Assume the flow for each sample must be in a flow interval between 1,500 and 2,100 cfs. Assume the annual maximum floods have an LP3 distribution with a mean of 2.5, a standard deviation of 0.3, and a skew of -0.1.

Generating a uniform random number between 0 and 1 will not work for this exercise because a uniform number between 0 and 1 samples from all the possible flood events over every possible AEP value. In other words, samples are generated over the entire distribution.

The sampled floods for this exercise must have a flow between 1,500 and 2,100 cfs. This means the random samples must be generated only over the portion of the distribution that falls within the flow interval. This constraint can be accommodated by constraining the random numbers based on the AEPs of the lower and upper flow values.

The first step is to calculate the AEPs for the lower and upper flow values using the LP3_DIST function.

  • AEPL = 1 - LP3_DIST(Log(1500), 2.5, 0.3, -0.1, TRUE) = 0.00997
  • AEPU = 0.00212

The second step is to calculate the non-exceedance probability F(x) for the lower and upper flow values based on the AEP.

  • F(x) = 1 – AEP
  • F(XL) = 0.990
  • F(XU) = 0.998

The third step is to generate uniform random numbers between the lower and upper values of F(x). This is equivalent to only sampling flood events from the frequency curve that are in the flow interval. Because this approach is still sampling a non-exceedance probability from the cumulative distribution, the random numbers still have a uniform distribution.  Uniform random numbers between a and b can be generated using the Excel RAND() function.

  • Random Number = a + (b – a) * RAND()
  • Random Number = F(XL) + (F(XU) - F(XL)) * RAND()

The remaining steps are like the previous exercise. The calculations to generate 100 annual maximum flood samples should look like the Table below.

Sample Number

Random Number (R)

F(XL) + (F(XU) - F(XL)) * RAND()

AEP

1 – R

X

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

Flow

10^X

1

0.990

0.00980

3.178

1506

2

0.997

0.00310

3.289

1944





100

0.992

0.00821

3.196

1570


Question 28. What are the maximum and minimum values of flow over the 100 samples? Are all of the sampled flow values between 1500 and 2100 cfs?

Min: 1500 cfs

Max: 2100 cfs


Question 29. What is the average value of X over the 100 samples? This is the value of E[X] in the expected moments equation for the mean.

1718 cfs

Perform a B17C EMA analysis for the flow dataset provided in Part 1 using a Monte Carlo analysis to estimate the expected moments

A template is provided in the EMA_Exercise_MonteCarloAnalysis v2.0.0.xlsb workbook.

The first step on the “EMA Iteration 0 – Step 1” worksheet is identical to the previous exercise in Initial Parameter Estimates Using Exact (Systematic) Data.

In the second step on the “EMA Iteration 1 – Step 2” worksheet, the midpoint Riemann sum calculations are replaced by a Monte Carlo analysis that generates random samples of X. Formulas for the flow interval have been entered. Using the flow interval calculations as a guide, estimate the expected moments for the perception threshold.

The third step on the “EMA Iteration 1 – Step 3” worksheet is identical to the previous exercise in Numerical Integration.

After completing EMA Iteration 1, create a copy and rename the Step 2 and Step 3 worksheets to perform EMA Iteration 2.  Repeat this process for the 3rd, 4th and 5th EMA Iterations.

Question 30. Report the results for the 5th EMA iteration to three decimal places.

Parameter

Manual

Mean

3.335

Std Dev

0.146

Skew

0.149


Question 31. Compare these results to the results from the HEC-SSP analysis in Overview and the manual calculations in Numerical Integration.

The results are similar.


Question 32. Can anything be done to improve the accuracy of the parameter estimates?

Increase number of samples of X

The solution to all Excel exercises can be found within the EMA_Exercise_MonteCarloAnalysis_Solution v2.0.0.xlsb workbook.