Optimization and Simulation Introduction to simulation Michel - - PowerPoint PPT Presentation

optimization and simulation
SMART_READER_LITE
LIVE PREVIEW

Optimization and Simulation Introduction to simulation Michel - - PowerPoint PPT Presentation

Optimization and Simulation Introduction to simulation Michel Bierlaire Transport and Mobility Laboratory School of Architecture, Civil and Environmental Engineering Ecole Polytechnique F ed erale de Lausanne M. Bierlaire (TRANSP-OR ENAC


slide-1
SLIDE 1

Optimization and Simulation

Introduction to simulation Michel Bierlaire

Transport and Mobility Laboratory School of Architecture, Civil and Environmental Engineering Ecole Polytechnique F´ ed´ erale de Lausanne

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 1 / 32

slide-2
SLIDE 2

Modeling

Outline

1

Modeling

2

Causal effects

3

Uncertainty

4

Beyond the mean

5

Simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 2 / 32

slide-3
SLIDE 3

Modeling

Modeling

System A system can be seen as a black box, modeled by z = h(x, y, u) Example: a car x captures the state of the system (e.g. speed, position of other vehicles) y captures external influences (e.g. wind) u captures possible human controls on the system (e.g. acceleration/deceleration) z represents indicators of performance (e.g. oil consumption).

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 3 / 32

slide-4
SLIDE 4

Modeling

Modeling

Decompose the complexity The model h is usually decomposed to reflect the interactions of the subsystems For example,

a car-following model captures the target speed of the driver, an engine model derives the actual consumption as a function of the acceleration.

Simulation Captures the causal effects. Captures the uncertainty.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 4 / 32

slide-5
SLIDE 5

Modeling

Simulation

Definition the act of imitating the behavior of some situation or some process by means of something suitably analogous

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 5 / 32

slide-6
SLIDE 6

Causal effects

Outline

1

Modeling

2

Causal effects

3

Uncertainty

4

Beyond the mean

5

Simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 6 / 32

slide-7
SLIDE 7

Causal effects

Modeling

Causal effects Very important to identify the causal effects Failure to do so may generate wrong conclusions

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 7 / 32

slide-8
SLIDE 8

Causal effects

Example: improving safety

Accidents in Kid City The mayor of Kid City has commissioned a consulting company Objective: assess the effectiveness of safety campaigns They propose to use simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 8 / 32

slide-9
SLIDE 9

Causal effects

Example: improving safety

Accidents in Kid City

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 9 / 32

slide-10
SLIDE 10

Causal effects

Example: improving safety

Accidents in Kid City:

5 8 3 8 12 7 9 6

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 10 / 32

slide-11
SLIDE 11

Causal effects

Example: improving safety

Accidents in Kid City

5 8 3 8 12 7 9 6

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 11 / 32

slide-12
SLIDE 12

Causal effects

Example: improving safety

Accidents in Kid City

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 12 / 32

slide-13
SLIDE 13

Causal effects

Example: improving safety

Accidents in Kid City:

12 9 3 6

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 13 / 32

slide-14
SLIDE 14

Causal effects

Example: improving safety

Two major flaws Causal effects are not modeled Simulation performed with only one draw

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 14 / 32

slide-15
SLIDE 15

Simulation: what it is not

slide-16
SLIDE 16

Simulation: what it is not

z = h(x, y, u) External input — y Control — u Complex system — state x Indicators — z

slide-17
SLIDE 17

Uncertainty

Outline

1

Modeling

2

Causal effects

3

Uncertainty

4

Beyond the mean

5

Simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 17 / 32

slide-18
SLIDE 18

Uncertainty

Simulation

Z = h(X, Y , U) + εz εy εu εx εz External input — y Control — u Complex system — state x Indicators — z

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 18 / 32

slide-19
SLIDE 19

Uncertainty

Simulation

Propagation of uncertainty Z = h(X, Y , U) + εz Given the distribution of X, Y , U and εz what is the distribution of Z? Derivation of indicators Mean Variance Modes Quantiles

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 19 / 32

slide-20
SLIDE 20

Uncertainty

Simulation

Sampling Draw realizations of X, Y , U, εz Call them xr, yr, ur, εr

z

For each r, compute zr = h(xr, yr, ur) + εr

z

zr are draws from the random variable Z

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 20 / 32

slide-21
SLIDE 21

Uncertainty

Statistics

Indicators Mean: E[Z] ≈ ¯ ZR = 1

R

R

r=1 zr

Variance: Var(Z) ≈ 1

R

R

r=1(zr − ¯

ZR)2. Modes: based on the histogram Quantiles: sort and select Important: there is more than the mean

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 21 / 32

slide-22
SLIDE 22

Beyond the mean

Outline

1

Modeling

2

Causal effects

3

Uncertainty

4

Beyond the mean

5

Simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 22 / 32

slide-23
SLIDE 23

Beyond the mean

The mean

[Savage et al., 2012]

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 23 / 32

slide-24
SLIDE 24

Beyond the mean

The mean

The flaw of averages

[Savage et al., 2012]

E[Z] = E[h(X, Y , U) + εz] = h(E[X], E[Y ], E[U]) + E[εz] ... except if h is linear.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 24 / 32

slide-25
SLIDE 25

Beyond the mean

There is more than the mean

Example Intersection with capacity 2000 veh/hour Traffic light: 30 sec green / 30 sec red Constant arrival rate: 2000 veh/hour during 30 minutes With 30% probability, capacity at 80%. Indicator: Average time spent by travelers

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 25 / 32

slide-26
SLIDE 26

Beyond the mean

There is more than the mean

50 100 150 200 250 300 350 400 450 500 390 686 1100 Frequency Average travel time (sec)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 26 / 32

slide-27
SLIDE 27

Simulation

Outline

1

Modeling

2

Causal effects

3

Uncertainty

4

Beyond the mean

5

Simulation

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 27 / 32

slide-28
SLIDE 28

Simulation

Pitfalls of simulation

Few number of runs Run time is prohibitive Tempting to generate partial results rather than no result Focus on the mean The mean is useful, but not sufficient. For complex distributions, it may be misleading. Intuition from normal distribution (mode = mean, symmetry) do not hold in general. Important to investigate the whole distribution. Simulation allows to do it easily.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 28 / 32

slide-29
SLIDE 29

Simulation

Challenges

How to generate draws from Z? How to represent complex systems? (specification of h) How large R should be? How good is the approximation?

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 29 / 32

slide-30
SLIDE 30

Simulation

Pseudo-random numbers

Definition Deterministic sequence of numbers which have the appearance of draws from a U(0, 1) distribution Typical sequence xn = axn−1 modulo m This has a period of the order of m So, m should be a large prime number For instance: m = 231 − 1 and a = 75 xn/m lies in the [0, 1[ interval

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 30 / 32

slide-31
SLIDE 31

Simulation

Outline of the lectures

Drawing from distributions Discrete event simulation Data analysis Variance reduction Markov Chain Monte Carlo Reference [Ross, 2006]

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 31 / 32

slide-32
SLIDE 32

Simulation

Bibliography

Ross, S. M. (2006). Simulation. Elsevier, fourth edition. Savage, S., Danziger, J., and Markowitz, H. (2012). The Flaw of Averages: Why We Underestimate Risk in the Face of Uncertainty. Wiley.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Optimization and Simulation 32 / 32