# Stochastic simulators: an overview

**URL:** <https://uqworld.org/t/stochastic-simulators-an-overview/158>\
**Category:** Chair's Blog\
**Tags:** stochastic-simulator, surrogate-models\
**Created:** [May 20, 2019, 12:57pm UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158 "2019-05-20T12:57:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xujia](https://uqworld.org/user_avatar/uqworld.org/xujia/32/214_2.png) [@xujia](https://uqworld.org/u/xujia)\
**Post date:** [May 20, 2019, 12:57pm UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/1 "2019-05-20T12:57:30Z")

</div>

In this post, we are going to discuss stochastic simulators, a relatively new concept arising in engineering. In fact, such simulators have been widely applied in many other fields for decades, such as economics, finance, and epidemics. The aim of this discussion is to give a clear overview of the concept of _stochastic simulators_ with a focus on various applications. Furthermore, the necessity of developing _surrogate models_ for such simulators will be briefly introduced.

## What is a stochastic simulator ?

* * *

Simulators are computational codes that are developed to mimic the behaviour of complex systems or model real-life situations. With the increasing computational power, simulators are nowadays used in virtually all fields of applied science and engineering to study the modelled scenario and make predictions about the system performance. For example, if we want to understand the mechanical behaviour of an aircraft under some extreme climate condition, a finite element model can be created to analyse its resistance to environmental loads, instead of resorting to expensive experiments.

More precisely, a simulator can be considered as a function which maps a set of input parameters to the output quantity of interest. For instance, a finite element model for structural analysis takes the loads and material properties as input and produces the displacement-, strain and stress fields as output QoI. Depending on the nature of the QoI, two classes of simulators are usually observed in practice. The first one is the so-called _deterministic_ simulator: deterministic in the sense that repeated runs of the simulator with the same input parameters provide exactly the same value of the output QoI. In contrast, stochastic simulators return different results when run twice with the same input parameters. In other words, the QoI of a stochastic simulator is a random variable.

The random nature sounds a bit weird. Where does the randomness come from? To figure it out, the modelled process is worth a detailed analysis. In fact, a stochastic simulator is based on a deterministic one, since computers (so far…) are deterministic machines. However, the input variables that uniquely determine the QoI are either not fully accessible or have too high a dimension to work with. In the former case, the modelled scenario itself is stochastic due to lack of knowledge (we cannot specify all the relevant input variables), so random seeds are introduced inside the simulator on top of the input parameters to reproduce the randomness within a deterministic framework. In the case of high dimensional input, the problem is usually intractable, so only a few “important” parameters are kept in the study by letting the others as “noisy” variables. Consequently, when we only control a part of the input parameters and let the others vary in their range of definition, the output becomes random.

## Examples

* * *

Despite its weird behaviour, stochastic simulators are widely used in many fields. Let’s look at some typical examples.

### Wind turbine design

In the wind turbine design process, the structural components need to be analyzed under different combinations of environmental loads to access its performance and reliability. Therefore, the simulation consists of two parts: generation of the external excitation (wind inflow) and the aero-servo-elastic simulation referring to the complex multi-physics scenario including mutual interactions of wind inflow (and possibly waves, in case of offshore structures), aerodynamics, hydrodynamics, structural dynamics (elastic deflections) and control systems.

![windturbine](https://uqworld.org/uploads/default/original/1X/b072b5aea017a5f1539f9393fb22f124129b17cd.jpeg)  
**Figure 1** : General scheme for wind turbine simulations

In the generation phase, the simulator takes some macroscopic values as input such as the mean speed of wind, turbulence intensity, profile with height, _etc_. However, these synthetic values cannot uniquely determine a wind field. Therefore, the generator uses random seeds on top of the well-defined characteristic variables to have a coherent inflow, which is usually based on the [power spectrum density](https://en.wikipedia.org/wiki/Spectral_density#Power_spectral_density).\[1\] Although the aero-servo-elastic simulation is deterministic with respect to the generated inflow, considering both simulations with the macroscopic descriptors as input parameters, the wind turbine simulator is stochastic: a single realization of the three parameters listed above leads to different realizations of the wind field, and thus to different structural performance.

### Stock pricing model in Finance

In finance, a [stock](https://en.wikipedia.org/wiki/Stock) represents a share in the ownership of an incorporated company. Stocks are issued by a corporation in the market, and investors buy stocks anticipating that it will yield income from dividends and appreciate, or grow, in value. In financial markets, the dynamics of stock prices are reflected by fluctuations of their price (or value) over time, denoted by S\_t (referring to the value at time t). The stock price is affected not only by complex interactions inside the market but also by politics and external hazards, and thus it is almost impossible to propose a deterministic model regrouping all the relevant factors together, which gives precise insights of the evolution of stock price. Therefore, S\_t is modeled as a [stochastic process](https://en.wikipedia.org/wiki/Stochastic_process) to represent its random nature.

![stockprice](https://uqworld.org/uploads/default/original/1X/ac2ef4bd4c560feadc6a195c2d5d23583b57670f.png)  
**Figure 2** : Evolution of the price of Alphabet (Google) stocks

The mathematical equation that is broadly used to simulate the evolution of stock price is the [geometric Brownian motion](https://en.wikipedia.org/wiki/Geometric_Brownian_motion), expressed by the _stochastic differential equation_

dS\_t = \mu S\_t dt + \sigma S\_t dW\_t 

where \mu is called _drift_, which denotes the expected return per unit stock per unit time, \sigma is called _volatility_, which measures the stability of stock price, and W\_t is a [Wiener process](https://en.wikipedia.org/wiki/Wiener_process) (a.k.a. Brownian motion), which represents unexpected hazards perturbing the price.\[2\]

![GBW_simulation](https://uqworld.org/uploads/default/original/1X/90764c9e27b80f1e832f0b724a0eee0bfb326b04.png)  
**Figure 3** : Trajectories of a geometric Brownian motion

The equation implies that with a fixed drift and volatility, S\_t can have different profile due to different realizations of W\_t, and thus the return for a certain time period is a random variable. Thanks to the simplicity of the equation, the analytical solution can be derived with the help of [Itô’s calculus](https://en.wikipedia.org/wiki/It%C3%B4_calculus). Nevertheless, more complex pricing models are used in practice (_e.g._ the [Heston model](https://en.wikipedia.org/wiki/Heston_model)), where closed-form analytical solutions are generally not available, and the associated stochastic differential equation can only be solved numerically.

### Epidemics

One of the key topics in epidemics is to study the spread of infectious diseases, which helps carry out necessary operations to minimize the social and ethical impacts during the outbreak. Similar to the previous example about the stock price, the process is rather complex: it depends highly on the interactions among individuals after the outbreak and the recovery ability of each infected individual.

Deterministic simulators have been proposed to represent the spread scenario, especially the [susceptible-infected-recovered (SIR) model](https://www.maa.org/press/periodicals/loci/joma/the-sir-model-for-spread-of-disease-the-differential-equation-model). Despite the well-established deterministic models, stochastic epidemic models have shown diverse advantages.\[3\] The standard stochastic SIR epidemic model is a simple extension to the deterministic model: the contacts among individuals are random in time, and the recovery time of each infected individual is also random.

![epidemics](https://uqworld.org/uploads/default/original/1X/da09e2d0cfe3b5c07929dc4cdc821fc8191740c9.png)  
**Figure 4** : Sketch of the SIR model

The procedure is illustrated in Figure 4 above: susceptible individuals are marked as black, while infected and recovered individuals are red and green, respectively. We will summarize some important aspects without going into the details. For a given configuration of individuals, the next configuration has two possibilities: either one susceptible individual gets infected (highlighted in yellow) or one infected individual is recovered (highlighted in cyan). The evolution depends on which state comes first in time, where both occurring times are described as random variables. As a result, for a given initial configuration, the dynamics are stochastic.

![SIR_simulation](https://uqworld.org/uploads/default/original/1X/a368e4b422e7e6ed86cd1625e58b661b8d6e2329.png)  
**Figure 5** : Sample trajectories of the fraction of infected individuals

## Why surrogate models of stochastic simulators?

* * *

As it is well known, high-fidelity simulators can be very costly to run. Due to their random nature, stochastic simulators should be repeatedly run many times with the _same_ input parameters to fully characterize the output QoI, which is a probability distribution. Moreover, in the context of robust design, we may want to find the best design parameters to optimize certain functions, such as the expectation of the output QoI.

An appropriate way to alleviate the burden is to build a _surrogate model_ (a.k.a. emulator), which mimics the original computational model but requires much fewer computation resources. Conventional surrogate modelling methods such as Gaussian processes\[4\] and polynomial chaos expansions\[5\], which have been successfully developed for deterministic simulators, cannot be directly applied to stochastic codes due to the random nature of the latter.

## Summary

* * *

Stochastic simulators are computational models that have intrinsic randomness and are used to model complex stochastic scenarios. As a result, each model evaluation for given input parameters produces a realization of a random variable. Despite the arbitrary definition, stochastic simulators are ubiquitous: whenever all the relevant input parameters that uniquely determine the output cannot be fully specified, the output of the model will be uncertain. They are present in various fields, among others, engineering, finance, and epidemics.

Unlike deterministic simulators, surrogate modelling for stochastic simulators is still in its infancy. The development of appropriate stochastic emulators will provide a more efficient way to quantify uncertainty within complex systems: the low-cost surrogate models can be run as many times as desired with reasonable computational resources. Therefore, it will allow engineers to optimize the behavior of structures and help assess potential risks for decision making.

* * *

_[Back to the Chair’s Blog index](https://uqworld.org/t/about-the-chairs-blog-category)_

## References

* * *

1. Jonkman B. J., “TurbSim User’s Guide: Version 1.50”, _National Renewable Energy Laboratory, U.S. Department of Energy_, 2009. [URL](https://nwtc.nrel.gov/system/files/TurbSim.pdf) 

2. Wilmott P., Howison S., and Dewynne J., “The Mathematics of Financial Derivatives”, _Cambridge University Press_, 1995. [DOI:10.1017/CBO9780511812545](https://doi.org/10.1017/CBO9780511812545) 

3. Britton T., “Stochastic epidemic models: A survey”, _Mathematical Biosciences_, vol. 225, pp. 24–35, 2010. [DOI:10.1016/j.mbs.2010.01.006](https://doi.org/10.1016/j.mbs.2010.01.006) 

4. Rasmussen C. E. and Williams C. K. I., “Gaussian processes for machine learning”, _MIT Press_, 2005. [URL](https://mitpress.mit.edu/books/gaussian-processes-machine-learning) 

5. Ghanem R. and Spanos P., “Stochastic Finite Elements: A Spectral Approach”, _Courier Dover Publications_, 2003. [DOI:10.1007/978-1-4612-3094-6](https://doi.org/10.1007/978-1-4612-3094-6)

---

<div class="post-metadata">

**Author:** ![ali](https://uqworld.org/user_avatar/uqworld.org/ali/32/487_2.png) [@ali](https://uqworld.org/u/ali)\
**Post date:** [August 2, 2020, 6:34am UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/2 "2020-08-02T06:34:14Z")

</div>

Dear @xujia

Thanks for your interesting discussion.  
I was wondering how to apply the **Stochastic Simulators** in UQLab?  
As you are well aware, the **application of the metamodelling methods** seems to be appealing  
Unfortunately, I cant implement your proposed methodology in the field of “Structural Engineering”.  
In particular, I was wondering if you could guide me to learn more from you.

Best regards  
Ali

---

<div class="post-metadata">

**Author:** ![xujia](https://uqworld.org/user_avatar/uqworld.org/xujia/32/214_2.png) [@xujia](https://uqworld.org/u/xujia)\
**Post date:** [August 2, 2020, 10:16am UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/3 "2020-08-02T10:16:25Z")

</div>

Dear @ali,

Thanks for the comments. Similar to conducting UQ for a deterministic model, several aspects can be developed for analyzing a stochastic simulator, namely uncertainty propagation, sensitivity analysis, and reliability analysis. Generally speaking, Monte Carlo simulations can be applied for these analyses. Hence, UQLab can be still used as far as Monte Carlo methods are concerned (_e.g._ for sensitivity analysis, you can read our recent paper\[1\] for details).

As you mentioned, surrogate models can typically help us alleviate the computational burden. That is why we launched the [SAMOS project](https://sudret.ibk.ethz.ch/research/ongoing-projects/stochastic-simulators.html). However, the metamodels\[2\]\[3\] that we are developing are not available in UQLab yet (but will certainly be included in a future version). Nevertheless, if you want to perform a specific analysis for a case study in structural engineering, we can have a more detailed discussion.

Best regards,  
Xujia

* * *

1. X. Zhu and B. Sudret, “Global sensitivity analysis for stochastic simulators based on generalized lambda surrogate models”, 2020. [arXiv:2005.01309](https://arxiv.org/abs/2005.01309) 

2. X. Zhu and B. Sudret, “Replication-based emulation of the response distribution of stochastic simulators using generalized lambda distributions”, _Int. J. Uncertainty Quantification_, vol. 10, pp. 249–275, 2020. [DOI:10.1615/Int.J.UncertaintyQuantification.2020033029](http://www.dl.begellhouse.com/journals/52034eb04b657aea,5047a058688097ba,17fb6a69404aa954.html) 

3. X. Zhu and B. Sudret, “Emulation of stochastic simulators using generalized lambda models”, 2020. [arXiv:2007.00996](https://arxiv.org/abs/2007.00996)

---

<div class="post-metadata">

**Author:** ![ali](https://uqworld.org/user_avatar/uqworld.org/ali/32/487_2.png) [@ali](https://uqworld.org/u/ali)\
**Post date:** [August 3, 2020, 5:33am UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/4 "2020-08-03T05:33:14Z")

</div>

Dear @xujia

Thanks for your quick reply,  
However, I am so interested in continuing the discussion but I prefer to wait for the results of the “SAMOS project”. Due to the exhaustive documentation which always provided by RSUQ, it’s better for UQLab users to benefit from them to learn in detail.  
I am a bit curious about the probable release time of your work!

Best regards  
Ali

---

<div class="post-metadata">

**Author:** ![xujia](https://uqworld.org/user_avatar/uqworld.org/xujia/32/214_2.png) [@xujia](https://uqworld.org/u/xujia)\
**Post date:** [August 3, 2020, 6:29am UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/5 "2020-08-03T06:29:17Z")

</div>

Dear @ali,

Some methods are still under development, and it may take some time to have a mature module. We will keep you informed of it. Besides, if you come up with interesting topics/applications, we can have further discussions :).

Best regards,  
Xujia

---

<div class="post-metadata">

**Author:** ![ali](https://uqworld.org/user_avatar/uqworld.org/ali/32/487_2.png) [@ali](https://uqworld.org/u/ali)\
**Post date:** [August 3, 2020, 12:23pm UTC](https://uqworld.org/t/stochastic-simulators-an-overview/158/6 "2020-08-03T12:23:50Z")

</div>

Dear @xujia

Thanks for the clarification.

Best regards  
Ali
