Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem.

Slides:



Advertisements
Similar presentations
11 Simulation. 22 Overview of Simulation – When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions.
Advertisements

Generating Random Numbers
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Statistics review of basic probability and statistics.
1 Methods of Experimental Particle Physics Alexei Safonov Lecture #21.
Random Variables and Distributions COMP5318 Knowledge Discovery and Data Mining.
FIN 685: Risk Management Topic 5: Simulation Larry Schrenk, Instructor.
Review of Basic Probability and Statistics
Chapter 7(7b): Statistical Applications in Traffic Engineering Chapter objectives: By the end of these chapters the student will be able to (We spend 3.
Descriptive statistics Experiment  Data  Sample Statistics Sample mean Sample variance Normalize sample variance by N-1 Standard deviation goes as square-root.
Maximum likelihood Conditional distribution and likelihood Maximum likelihood estimations Information in the data and likelihood Observed and Fisher’s.
Probability theory Much inspired by the presentation of Kren and Samuelsson.
Simulation Modeling and Analysis
Descriptive statistics Experiment  Data  Sample Statistics Experiment  Data  Sample Statistics Sample mean Sample mean Sample variance Sample variance.
CHAPTER 6 Statistical Analysis of Experimental Data
Simulation and Probability
Statistical inference Population - collection of all subjects or objects of interest (not necessarily people) Sample - subset of the population used to.
Chapter 21 Random Variables Discrete: Bernoulli, Binomial, Geometric, Poisson Continuous: Uniform, Exponential, Gamma, Normal Expectation & Variance, Joint.
Stevenson and Ozgur First Edition Introduction to Management Science with Spreadsheets McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Hydrologic Statistics
Chapter 9 Introducing Probability - A bridge from Descriptive Statistics to Inferential Statistics.
Chapter 1: Introduction to Statistics
1 9/8/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
Introduction to Discrete Event Simulation Customer population Service system Served customers Waiting line Priority rule Service facilities Figure C.1.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
 1  Outline  stages and topics in simulation  generation of random variates.
1 9/23/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
Lecture 17 Nov 7, 2012 Discrete event simulation discrete time systems system changes with time, in discrete steps uncertainty (modeled by probability)
Dept of Bioenvironmental Systems Engineering National Taiwan University Lab for Remote Sensing Hydrology and Spatial Modeling STATISTICS Random Variables.
Statistics for Engineer Week II and Week III: Random Variables and Probability Distribution.
Monte Carlo Simulation and Personal Finance Jacob Foley.
Monte Carlo Simulation CWR 6536 Stochastic Subsurface Hydrology.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics Michael Baron. Probability and Statistics for Computer Scientists,
BINOMIALDISTRIBUTION AND ITS APPLICATION. Binomial Distribution  The binomial probability density function –f(x) = n C x p x q n-x for x=0,1,2,3…,n for.
Lecture 19 Nov10, 2010 Discrete event simulation (Ross) discrete and continuous distributions computationally generating random variable following various.
Delivering Integrated, Sustainable, Water Resources Solutions Monte Carlo Simulation Robert C. Patev North Atlantic Division – Regional Technical Specialist.
Outline of Chapter 9: Using Simulation to Solve Decision Problems Real world decisions are often too complex to be analyzed effectively using influence.
Simulation is the process of studying the behavior of a real system by using a model that replicates the behavior of the system under different scenarios.
Discrete Event (time) Simulation. What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with.
Monte Carlo Process Risk Analysis for Water Resources Planning and Management Institute for Water Resources 2008.
Reid & Sanders, Operations Management © Wiley 2002 Simulation Analysis D SUPPLEMENT.
Probability Refresher COMP5416 Advanced Network Technologies.
Computer Simulation. The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions.
Random Variable The outcome of an experiment need not be a number, for example, the outcome when a coin is tossed can be 'heads' or 'tails'. However, we.
Computer simulation Sep. 9, QUIZ 2 Determine whether the following experiments have discrete or continuous out comes A fair die is tossed and the.
Sampling and estimation Petter Mostad
Psychology 202a Advanced Psychological Statistics September 22, 2015.
Statistics What is the probability that 7 heads will be observed in 10 tosses of a fair coin? This is a ________ problem. Have probabilities on a fundamental.
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Analysis of Experimental Data; Introduction
Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
1 Simulation Scenarios. 2 Computer Based Experiments Systematically planning and conducting scientific studies that change experimental variables together.
Csci 418/618 Simulation Models Dr. Ken Nygard, IACC 262B
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005 Dr. John Lipp Copyright © 2005 Dr. John Lipp.
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics B: Michael Baron. Probability and Statistics for Computer Scientists,
Computer Simulation Henry C. Co Technology and Operations Management,
MECH 373 Instrumentation and Measurements
OPERATING SYSTEMS CS 3502 Fall 2017
Random variables (r.v.) Random variable
Psychology 202a Advanced Psychological Statistics
Review of Probability and Estimators Arun Das, Jason Rebello
Discrete event simulation discrete time systems
Sampling Distribution Models
Probability & Statistics Probability Theory Mathematical Probability Models Event Relationships Distributions of Random Variables Continuous Random.
Discrete Event Simulation - 4
Lecture 2 – Monte Carlo method in finance
Presentation transcript:

Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem

Outline What is discrete event simulation? Events Probability Probability distributions Sample application

What is discrete event simulation? “ Simulation is the process of designing a model of a real system and conducting experiments with this model for the purpose either of understanding the behavior of the system or of evaluating various strategies (within the limits imposed by a criterion or set of criteria) for the operation of a system.” -Robert E Shannon 1975 “Simulation is the process of designing a dynamic model of an actual dynamic system for the purpose either of understanding the behavior of the system or of evaluating various strategies (within the limits imposed by a criterion or set of criteria) for the operation of a system.” -Ricki G Ingalls 2002 Definitions from

What is discrete event simulation? A simulation is a dynamic model that replicates the behavior a real system. Simulations may be deterministic or stochastic, static or dynamic, continuous or discrete. Discrete event simulation (DEVS) is stochastic, dynamic, and discrete. DEVS is not necessarily spatial – it usually isn’t, but the ideas are applicable to many spatial simulations

What is discrete event simulation? DEVS has been around for decades, and is supported by a large set of supporting tools, programming languages, conventional practices, etc. Like other kinds of simulation, offers an alternative, often simple way of solving a problem – simulate system and observe results, instead of coming up with analytical model. Many other benefits like repeatability, ability to use multiple parameter sets, experimental treatment of what may be unique system, cheap compared to physical experiment, etc. Usually involves posing a question. The simulation estimates an answer.

What is discrete event simulation? Stochastic = probabilistic Dynamic = changes over time Discrete = instantaneous events are separated by intervals of time Time may be modeled in a variety of ways within the simulation.

Alternate treatments of time Time divided into equal increments: Unequal increments: Cyclical:

Termination Simulation may terminate when a terminating condition is met. May also be periodic. Can also be conceptually endless, like weather, terminated at some arbitrary time. Usually converges or stabilizes on particular result.

Events May change the state of the system. Have no duration. If time is event-based, events happen when time advances. Canonical example: flipping a coin. Events usually have a value associated with them (e.g. coin: true/false). The definition of an event depends on the subject of the model.

Random Variables A random variable (“X”) is numerical value associated with a random event. X can have different values: X 1, X 2, X 3 …X n In a stochastic DEVS, the value associated with event is probablistic, that is it occurs with a given probability. That probability is what allows us to use DEVS to estimate results when we don’t know the precise value of input parameters to our model.

Pseudorandom Number Generators A stochastic simulation depends on a pseudorandom number generator to generate usable random numbers. These generators can vary significantly in quality. For practical purposes, it may be important to check the random number generator you are using to make sure it behaves as expected. Example: Using matlab’s rand(), let us simulate a coin toss and test how good the random number generator is.

Probability distributions In a DEVS, you need to decide what probability distribution functions best model the events. Pseudorandom number generators generate numbers in a uniform distribution One basic trick is to transform that uniform distribution into other distributions. There are many basic probability distributions are convenient to represent mathematically. They may or may not represent reality, but can be useful simplifications.

Normal or Gaussian distribution oUbiquitous in statistics oMany phenomena follow this distribution oWhen an experiment is repeated, the results tend to be normally distributed.

Simulating a Probability distribution Sampling values from an observational distribution with a given set of probabilities (“discrete inverse transform method”). Generate a random number U If U < p 0 return X 1 If U < p 0 + p 1 return X 2 If U < p 0 + p 1 + p 2 return X 3 etc. This can be speeded up by sorting p so that the larger intervals are processed first, reducing the number of steps.

Poisson distribution Example of algorithm to sample from a distribution. X follows a Poisson distribution if: An algorithm for sampling from a Poisson distribution: 1. Generate a random number U 2. If i=0, p=e -l, F=p 3. If U < F, return I 4. P = l * p / (i + 1), F = F + p, i = i Go to 3 There are similar tricks to sampling from other probability distributions. Some tools like Matlab have these built in.

A repair problem n machines are needed to keep an operation. There are s spare machines. The machines in operation fail according to some known distribution (e.g. exponential, Poisson, uniform etc. with a known mean). When a machine fails, it is sent to repair shop and the time to fix is a random variable that follows a known distribution. Question: What is the expected time for the system to crash? System crashes when fewer than n machines are available.

Plotting outcome of experiments The expected value (mean) will converge after a number of repetitions. We can demonstrate the process of flipping coins…with a simulation. Here are two runs of a simulated sequences of 1000 coin flips (see code), displaying the average result (sum of Xi / n): Note that the variance is high initially and diminishes with time.