Emulation

Neil D. Lawrence

Accelerate Programme

  • Computer Lab hosts Accelerate Programme for Scientific Discovery
  • Use ML techniques to deliver scientific advances
  • Four DECAF fellows: MPhil Projects Available!

Probabilistic Programming

  • Dates back to BUGS
  • Modern descendent (same spirit) is Stan
  • Also languages like pyro (based on PyTorch)

Approximate Bayesian Computation

Causality

Emulation

Deep Thought and the Challenge of Computation

  • Deep Thought computed for 7.5 million years
  • Answer: “42”
  • Problem: Didn’t know the question
  • Built Earth as a computer to find the question
  • Illustrates challenges with complex computations

When you are a Bear of Very Little Brain, and you Think of Things, you find sometimes that a Thing which seemed very Thingish inside you is quite different when it gets out into the open and has other people looking at it.

A.A. Milne as Winnie-the-Pooh in The House at Pooh Corner, 1928

Surrogate Modelling in Practice

  • Emergent phenomena require computational power.
  • In surrogate modelling we use statistical/ML models to learn regularities in those emergent phenomena.

Types of Simulations

  • Three main categories:
    • Differential equation models
    • Discrete event simulations
    • Software system simulations

Differential Equation Models

  • Two main approaches:
    • Abstracted (e.g., epidemiological models)
    • Fine-grained (e.g., climate/weather models)
  • Based on mathematical representations
  • Often require numerical solutions

Discrete Event Simulations

  • Two main types:
    • Turn-based (Game of Life, F1 Strategy)
    • Event-driven (Gillespie algorithm)
  • Updates happen at specific moments
  • Can be regular or irregular intervals

Software System Simulations

  • Used for testing production code
  • Enable “what if” scenarios (counterfactuals)
  • Can involve entire codebases
  • Useful for complex interacting systems

F1 and Fidelity

  • Simulations work at different fidelities
    • F1 Race Strategy vs Aerodynamics
  • Must maintain consistent granularity
  • Adding detail can degrade performance

Epidemiology

Modelling Herd Immunity

\[ \frac{\text{d}{S}}{\text{d}t} = - \beta S (I_1 + I_2). \]

\[ \frac{\text{d}{E_1}}{\text{d}t} = \beta S (I_1 + I_2) - \sigma E_1. \]

\[ \frac{\text{d}{E_2}}{\text{d}t} = \sigma E_1 - \sigma E_2. \]

\[ \frac{\text{d}{I_1}}{\text{d}t} = \sigma E_2 - \gamma I_1, \]

\[ \frac{\text{d}{I_2}}{\text{d}t} = \gamma I_1 - \gamma I_2. \]

\[ \frac{\text{d}R}{\text{d}t} = \gamma I_2. \]

Strategies for Simulation

  • Split variables into state variables, parameters and results.
  • In herd immunity
    • State variables: susceptible, exposed, infectious, recovered.
    • Parameters: reproduction number, expected lengths of infection, lockdown timings.
    • Results: e.g. total number of deaths

Strategies for Simulation

  • Use emulator to map from e.g. parameters to total number of deaths.
  • Treat parameters and results of simulator as inputs and outputs for emulator.

.

Backtesting Production Code

  • Third major type of simulation
  • Running system code counterfactually
  • Examples include:
    • Supply chain systems
    • Autonomous systems (Prime Air)
    • Voice assistants (Alexa)
    • Automated buying systems
  • Challenges:
    • Intellectual debt
    • ML component interactions
    • System complexity

Alexa

\tomTaylorPicture{15%}\joeWalowskiPicture{15%}\rohitPrasadPicture{15%}

Alexa

\rohitPrasadPicture{15%}

Alexa

\tomTaylorPicture{15%}\joeWalowskiPicture{15%}\rohitPrasadPicture{15%}

Speech to Text

Catherine Breslin

Cloud Service: Knowledge Base

\davidHardcastlePicture{15%}\arpitMittalPicture{15%}\christosChristodoulopoulosPicture{15%}

Text to Speech

\andrewBreenPicture{15%}\robertoBarraChicotePicture{15%}

Prime Air

\gurKimchiPicture{15%}\paulViolaPicture{15%}\davidMoroPicture{15%}

Supply Chain Optimization

\llewMasonPicture{15%}\deveshMishraPicture{15%}

Supply Chain Optimization

\llewMasonPicture{15%}\deveshMishraPicture{15%}

Forecasting

\jennyFreshwaterPicture{15%}\pingXuPicture{15%}\deanFosterPicture{15%}

Inventory and Buying

\deepakBhatiaPicture{15%}\piyushSaraogiPicture{15%}\ramanIyerPicture{15%}\salalHumairPicture{15%}\narayanVenkatasubramanyanPicture{15%}
  • Automated buying based on:
    • Supplier lead times.
    • Demand Forecast.
    • Cost basis of the product.

Buying System

Monolithic System

\charlieBellPicture{15%}\peterVosshallPicture{15%}

Service Oriented Architecture

\charlieBellPicture{15%}\peterVosshallPicture{15%}

Intellectual Debt

Examples in Python

  • Wide range of Python simulation tools:

    • SimPy - Discrete event simulation
    • OpenAI Gym - Control problems
    • Fluid dynamics and FEA examples
    • Domain-specific examples (F1, supply chain)
  • Simpy

  • News Vendor Problem in python (for ordering NFL Replica Jerseys.

  • Amazon Supply Chain

  • Trolley & Pendulum using sympy (symbolic python)

Examples in Python

Conclusions

  • Characterised types of simulation.
    • Physical laws
    • Discrete event
    • Production Software Systems
  • Introduced notion of emulation to replace simulation.
  • Overviewed GPy software.

Thanks!

References