Stochastic Simulation Introduction Bo Friis Nielsen Applied - - PowerPoint PPT Presentation

stochastic simulation introduction
SMART_READER_LITE
LIVE PREVIEW

Stochastic Simulation Introduction Bo Friis Nielsen Applied - - PowerPoint PPT Presentation

Stochastic Simulation Introduction Bo Friis Nielsen Applied Mathematics and Computer Science Technical University of Denmark 2800 Kgs. Lyngby Denmark Email: bfn@imm.dtu.dk Practicalities Practicalities Reading material available


slide-1
SLIDE 1

Stochastic Simulation Introduction

Bo Friis Nielsen

Applied Mathematics and Computer Science Technical University of Denmark 2800 Kgs. Lyngby – Denmark Email: bfn@imm.dtu.dk

slide-2
SLIDE 2

02443 – lecture 1 2

02443

Practicalities Practicalities

  • Reading material available online, with some suggestions for

further reading

  • Course evaluation is: passed/not passed - based on lab reports,

report over final project, and possibly oral presentation of project.

  • Teachers:

⋄ Bo Friis Nielsen, e-mail bfni@dtu.dk ⋄ Clara Brimnes Gardner (s153542@student.dtu.dk), Nikolaj Nikolaj Overgaard Sørensen (s190191@student.dtu.dk), Edward Xu (s181238@student.dtu.dk)

slide-3
SLIDE 3

02443 – lecture 1 3

02443

Significance Significance

  • One of the most (The most?)important Operations Research

techniques

  • Several modern statistical techniques rely on simulation
slide-4
SLIDE 4

What is simulation? What is simulation?

  • (From Concise Oxford Dictionary): To simulate: To pretend, to

act like, to mimic, to imitate.

  • Here: Computer experiments with mathematical model
  • Stochastic simulation

To (have a computer) simulate a system which is affected by randomness. Narrow sense: To generate (pseudo)random numbers from a prescribed distribution (e.g. Gaussian)

  • Computer experiments with mathematical model
  • General engineering technique
  • Analytical/numerical solutions
slide-5
SLIDE 5

02443 – lecture 1 5

02443

Why simulate? Why simulate?

  • Real system expensive
  • Mathematical model to complex
  • Get idea of dynamic behaviour
slide-6
SLIDE 6

02443 – lecture 1 6

02443

Related areas Related areas

  • Statistics
  • Computer science
  • Operations research
slide-7
SLIDE 7

02443 – lecture 1 7

02443

Target group Target group

  • Methodology course of general interest
  • Of special importance for students specialising in

⋄ Computer science ⋄ Statistics ⋄ Operations Research ⋄ Planning and management

slide-8
SLIDE 8

Course goal Course goal

  • Topics related to scientific computer experimentation
  • Specialised techniques

⋄ Variance reduction methods ⋄ Random number generation ⋄ Random variable generation ⋄ The event-by-event principle

  • Simulation based statistical techniques

⋄ Markov chain Monte Carlo ⋄ Bootstrap

  • Validition and verification of models
  • Model building
slide-9
SLIDE 9

02443 – lecture 1 9

02443

Recommended reading Recommended reading

  • Sheldon M. Ross: Simulation, fifth edition, Academic Press 2013

available online for DTU students

  • Søren Asmussen and Peter W. Glynn: Stochastic Simulation:

Algorithms and Analysis, Springer 2007, available online for DTU students

  • C.P. Robert and G. Casella: Introducing Monte Carlo Methods with

R, Springer, 2010

  • Reuven Y. Rubinstein and Benjamin Melamed: Modern Simulation

and Modelling, John Wiley & Sons 1998, First 50 pages available at DTU Inside. It is illegal to distribute these notes

  • Villy Bæk Iversen: Numerisk Simulation (In Danish), DTU, 2007
slide-10
SLIDE 10

02443 – lecture 1 10

02443

Supplementary reading Supplementary reading

  • Averill M. Law: Simulation Modeling and Analysis, McGraw-Hill 2015
  • Jerry Banks, John S. Carson II, Barry L. Nelson, David M. Nicol:

Discrete-Event System Simulation, Prentice and Hall 1999

  • Brian Ripley: Stochastic Simulation, John Wiley & Sons 1987
  • Jack P. C. Kleijnen: Statistical Tools for Simulation Practitioneers,

Marcel Dekker 1987

slide-11
SLIDE 11

02443 – lecture 1 11

02443

Knowledge/science in simulation Knowledge/science in simulation

  • Modelling skill
  • Statistical methods - it is necessary to understand statistical

methodology

  • OR - Stochastic Processes
  • Technical skills

⋄ Random number generations ⋄ Sampling from distributions ⋄ Variance reduction techniques ⋄ Statistical techniques bootstrap/MCMC

  • General purpose/and specialised simulation software
slide-12
SLIDE 12

02443 – lecture 1 12

02443

Discrete versus continuous Discrete versus continuous

  • Discrete event simulation
  • as opposed to continuous simulation
  • mixed models
slide-13
SLIDE 13

Probability basics Probability basics

  • 0 ≤ P(A) ≤ 1

P(Ω) = 1 P(∅) = 0

  • A ∩ B = ∅ ⇒ P(A ∪ B) = P(A) + P(B)
  • Complement rule P(Ac) = 1 − P(A)
  • Difference rule for A ⊂ B: P(B ∩ Ac) = P(B) − P(A)
  • Inclusion, exclusion for 2 events

P(A ∪ B) = P(A) + P(B) − P(A ∩ B)

  • Conditional probability: for A given B (partial information): P(A|B) =

P(A∩B) P(B)

  • Multiplication rule: P(A ∩ B) = P(B)P(A|B)
  • Law of total probability (Bi is a partitioning):

P(A) =

i P(Bi)P(A|Bi)

  • Bayes theorem: (Bi is a partitioning): P(Bi|A) =

P(A|Bi)P(Bi)

  • j P(A|Bj)P(Bj)
  • independence: P(A|B) = P(A|Bc)

(P(A ∩ B) = P(A)P(B))

slide-14
SLIDE 14

02443 – lecture 1 14

02443

Random variables Random variables

  • Mapping from sample space to the real line
  • Probabilities defined in terms of the preimage
  • Most probabilitistic calculations are performed with only a slight

reference to the underlying sample space

slide-15
SLIDE 15

02443 – lecture 1 15

02443

Random variables Random variables

  • Random variables: maps outcomes to real values

⋄ Distribution P(X = x)

  • x P(X = x) = 1

⋄ Joint distribution P(X = x, Y = y)

  • x,y P(X = x, Y = y) = 1

⋄ Marginal distribution PX(X = x) =

y P(X = x, Y = y)

⋄ Conditional distribution P(Y = y|X = x) = P(X=x,Y =y) PX(X=x) ⋄ independence P(Y = y, X = x) = PX(X = x)PY (Y = y), ∀(x, y)

  • Mean value E(X) = x · P(X = x)
  • General expectation E(g(X)) =

x g(x) · P(X = x)

  • Linearity E(aX + bY + c) = aE(X) + bE(Y ) + c
slide-16
SLIDE 16

02443 – lecture 1 16

DTU

Continuous random variables Continuous random variables

  • Uniform distribution of two variables: P ((x, y) ∈ C) = A(C)

A(D)

  • Continuous random variables

⋄ Density: f(x) ≥ 0,

  • f(x)dx = 1,

P(X ∈ dx) = f(x)dx

⋄ Mean, variance (moments): E(X) =

  • xf(x)dx

E(g(X)) =

  • g(x)f(x)dx, E
  • Xk

=

  • xkf(x)dx
  • Normal distribuion: f(x) =

1 √ 2πσe− 1

2( x−µ σ ) 2

Z = X−µ

σ

  • Joint densities

f(x, y)dxdy = P(x ≤ X ≤ x + dx, y ≤ Y ≤ y + dy), f(x, y) ≥ 0

  • Joint distribution

F(x, y) = P(X ≤ x, Y ≤ y) = y

−∞

x

−∞

f(u, v)dudv

slide-17
SLIDE 17

Continuous random variables continued Continuous random variables continued

  • Conditional continous distributions fY (y|X = x) = f(x,y)

fX(x)

  • Integral version of law of total probability

P(A) =

  • P(A|X = x)fX(x)dx
  • Conditional expectation E(Y ) = E(E(Y |X))
  • Covariance/corellation

Cov(X, Y ) = E[(X − E(X))(Y − E(Y ))] = E(XY ) − E(X)E(Y ) Corr(X, Y ) = Cov(X, Y ) SD(X)SD(Y )

  • (X, Y ) independent ⇒ Corr(X, Y ) = 0
  • Variance of sum of variables

Var N

k=1 Xk

  • = n

k=1 Var(Xk) + 2 1≤j<k≤n Cov(Xj, Xk)

  • Bilinearity of covariance

Cov n

i=1 aiXi, m j=1 bjYj

  • = n

i=1

m

j=1 aibjCov(Xi, Yj)