Uncertainty and Monte Carlo


Lecture 08

September 23, 2024

Review of Last Classes

Simulation

  • “Mimic” data generation given a certain model for the relevant processes;
  • Often requires some type of discretization (not always!)

Simulation Workflow

Simulation Workflow

Simulation

  • “Mimic” data generation given a certain model for the relevant processes;
  • Often requires some type of discretization (not always!)
  • More complex approaches (e.g. discrete-event simulation) for specific use cases.

What We Haven’t Discussed

  • Calibration: How do we select parameter values?
  • Validation: Does the model adequately reproduce the system dynamics?

Dissolved Oxygen

  • Dissolved oxygen (DO) is essential for water quality and aquatic life.
  • Commonly regulated to keep DO above a minimum threshold.
  • DO impacted by a number of factors, notably organic waste decomposition and nitrification.
  • “Sag Curve”: DO reduced near a discharge until waste decomposition reduces OD and re-aeration can occur.

Questions?

Poll Everywhere QR Code

Text: VSRIKRISH to 22333

URL: https://pollev.com/vsrikrish

See Results

Uncertainty and Systems Analysis

Systems and Uncertainty

  • Deterministic models: uncertainty due to the separation between the “internals” of the system and the “external” environment.
  • Stochastic models: additional uncertainty from internal stochasticity

Conceptual Schematic of a Systems Model

What is Uncertainty?

Glib Answer: A lack of certainty!

More Seriously: Uncertainty refers to an inability to exactly describe current or future values or states.

Types of Uncertainty

Two (broad) types of uncertainties:

  • Aleatory uncertainty, or uncertainties resulting from randomness;
  • Epistemic uncertainty, or uncertainties resulting from lack of knowledge.

Risk

Systems and Risk

Designing and managing environmental systems is often about minimizing or managing risk:

  • Maintaining clean air/water;
  • Power grid reliabiliy standards;
  • Flooding/other hazards;
  • Climate change mitigation/adaptation.

What is Risk?

The Society for Risk Analysis definition:

“risk” involves uncertainty about the effects/implications of an activity with respect to something that humans value (such as health, well-being, wealth, property or the environment), often focusing on negative, undesirable consequences.

So What is Risk?

Important: “Risk” is not just another words for probability, but:

  • Involves uncertainty;
  • Undesireable outcomes;
  • Effects matter, not just the events themselves.

Components of Risk

Multiple components which contribute to risk:

  • Probability of a hazard;
  • Exposure to that hazard;
  • Vulnerability to outcomes;
  • Socioeconomic responses.

Overview of the Components of Risk

Systems and Risk Management

Risk management is often a key consideration in systems analysis. For example, consider regulatory standards.

  • Often a tradeoff between strictness of a regulation and costs of compliance.
  • Systems modeling is a key way to understand
    • the impacts of changing a regulation
    • the probability of failure to meet standards.

Probability

Two Definitions of Probability

We often represent uncertainties with probabilities. What is a probability?

  1. Long-run frequency of an event (frequentist)
  2. Degree of belief that a proposition is true (Bayesian)

Conditional Probabilities

We often don’t want to just know if a particular event \(A\) has a certain probability, but also how other events (call them \(B\)) might depend on that outcome.

In other words:

We want the conditional probability of \(B\) given \(A\), denoted \(\mathbb{P}(B|A)\).

Conditional Probabilities

We can write conditional probabilities in terms of unconditional probabilities:

\[\mathbb{P}(B|A) = \frac{\mathbb{P}(BA)}{\mathbb{P}(A)}.\]

Bayes’ Theorem

Conditional probabilities can be inverted according to Bayes’ Theorem:

\[\mathbb{P}(A|B) = \frac{\mathbb{P}(B|A) \times \mathbb{P}(A)}{\mathbb{B}}.\]

Probability Distributions

The probability of possible values of an unknown quantity are often represented as a probability distribution.

Probability distributions associate a probability to every event under consideration (the event space) and have to follow certain rules (for example, total probability = 1).

Selecting a Distribution

The specification of distributions can strongly influence the analysis.

Probabilistic interactions between sea-levels and exposure

Selecting a Distribution

A distribution implicitly answers questions like:

  • What is the most probable event? How much more likely is it than the others?
  • Are larger or smaller events more, less, or equally probable?
  • How probable are extreme events?
  • Are different events correlated, or are they independent?

Key Features of Probability Distributions

  • Mean/Mode (what events are “typical”)
  • Skew (are larger or smaller events more or equally probable)
  • Variance (how spread out is the distribution around the mode)
  • Tail Probabilities (how probable are extreme events)

Common Distributions

  • Gaussian / Normal
  • Lognormal
  • Binomial
  • Uniform / Discrete Uniform

Probability Distribution Tails

The tails of distributions represent the probability of high-impact outcomes.

Key consideration: Small changes to these (low) probabilities can greatly influence risk.

Monte Carlo

Stochastic Simulation

Monte Carlo simulation: Propagating random samples through a model to estimate a value (usually an expectation or a quantile).

G a Probability Distribution b Random Samples a->b Sample c Model b->c Input d Outputs c->d Simulate

Goals of Monte Carlo

Monte Carlo is a broad method, which can be used to:

  1. Obtain probability distributions of outputs;
  2. Estimate deterministic quantities (Monte Carlo estimation).

Monte Carlo Estimation

Monte Carlo estimation involves framing the quantity of interest as a summary statistic (such as an expected value).

MC Example: Finding \(\pi\)

Finding \(\pi\) by sampling random values from the unit square and computing the fraction in the unit circle. This is an example of Monte Carlo integration.

\[\frac{\text{Area of Circle}}{\text{Area of Square}} = \frac{\pi}{4}\]

Figure 1: Monte Carlo simualtion for Estimating pi

MC Example: Dice

What is the probability of rolling 4 dice for a total of 19?

Can simulate dice rolls and find the frequency of 19s among the samples.

Figure 2: Monte Carlo simualtion for Dice Rolls

Monte Carlo Estimation

This type of estimation can be repeated with any simulation model that has a stochastic component.

For example, consider our dissolved oxygen model. Suppose that we have a probability distribution for the inflow DO.

How could we compute the probability of DO falling below the regulatory standard somewhere downstream?

Monte Carlo and Uncertainty Propagation

  1. Draw samples from some distribution;
  2. Eun them through one or more models;
  3. Compute the (conditional) probability of outcomes of interest (for good or bad).

Key Takeaways

Key Takeaways

  • Systems analysis features many uncertainties, which may be neglected with certain methods/model setups.
  • Choice of probability distribution can have large impacts on uncertainty and risk estimates: try not to use distributions just because they’re convenient.
  • Monte Carlo: Estimate expected values of outcomes using simulation.

Upcoming Schedule

Next Classes

Wednesday: Monte Carlo Lab (clone before class, maybe instantiate environment too)

Monday: Why Does Monte Carlo Work?

Assessments

HW3: Released today, due 10/03 at 9pm.