Module 1: Statistical Issues in Micro simulation Paul Sousa.

Slides:



Advertisements
Similar presentations
RSLAB-NTU Lab for Remote Sensing Hydrology and Spatial Modeling 1 An Introduction to R Pseudo Random Number Generation (PRNG) Prof. Ke-Sheng Cheng Dept.
Advertisements

Markov Chain Monte Carlo Convergence Diagnostics: A Comparative Review By Mary Kathryn Cowles and Bradley P. Carlin Presented by Yuting Qi 12/01/2006.
Monte Carlo Methods and Statistical Physics
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Random number generation Algorithms and Transforms to Univariate Distributions.
INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE
CHAPTER 16 MARKOV CHAIN MONTE CARLO
BAYESIAN INFERENCE Sampling techniques
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
Chapter 20 Basic Numerical Procedures
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
Probability theory 2010 Main topics in the course on probability theory  Multivariate random variables  Conditional distributions  Transforms  Order.
Machine Learning CUNY Graduate Center Lecture 7b: Sampling.
Computational statistics, course introduction Course contents  Monte Carlo Methods  Random number generation  Simulation methodology  Bootstrap  Markov.
Chapter 6 Continuous Random Variables and Probability Distributions
Probability theory 2011 Main topics in the course on probability theory  The concept of probability – Repetition of basic skills  Multivariate random.
Evaluating Hypotheses
Generating Continuous Random Variables some. Quasi-random numbers So far, we learned about pseudo-random sequences and a common method for generating.
Data Basics. Data Matrix Many datasets can be represented as a data matrix. Rows corresponding to entities Columns represents attributes. N: size of the.
Random Number Generation
Lehrstuhl für Informatik 2 Gabriella Kókai: Maschine Learning 1 Evaluating Hypotheses.
Lecture II-2: Probability Review
Chapter 9 Numerical Integration Numerical Integration Application: Normal Distributions Copyright © The McGraw-Hill Companies, Inc. Permission required.
Chapter 5: z-scores.
ETM 607 – Random Number and Random Variates
Introduction to Monte Carlo Methods D.J.C. Mackay.
Component Reliability Analysis
Zheng Zhenlong, Dept of Finance,XMU Basic Numerical Procedures Chapter 19.
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
18.1 Options, Futures, and Other Derivatives, 5th edition © 2002 by John C. Hull Numerical Procedures Chapter 18.
Short Resume of Statistical Terms Fall 2013 By Yaohang Li, Ph.D.
Chapter 3: Central Tendency. Central Tendency In general terms, central tendency is a statistical measure that determines a single value that accurately.
1 Institute of Engineering Mechanics Leopold-Franzens University Innsbruck, Austria, EU H.J. Pradlwarter and G.I. Schuëller Confidence.
Monte Carlo Simulation CWR 6536 Stochastic Subsurface Hydrology.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Elements of Financial Risk Management Second Edition © 2012 by Peter Christoffersen 1 Distributions and Copulas for Integrated Risk Management Elements.
Machine Learning Lecture 23: Statistical Estimation with Sampling Iain Murray’s MLSS lecture on videolectures.net:
Chapter 7 Random-Number Generation
1 Lesson 8: Basic Monte Carlo integration We begin the 2 nd phase of our course: Study of general mathematics of MC We begin the 2 nd phase of our course:
1 MGT 821/ECON 873 Numerical Procedures. 2 Approaches to Derivatives Valuation How to find the value of an option?  Black-Scholes partial differential.
1 Chapter 19 Monte Carlo Valuation. 2 Simulation of future stock prices and using these simulated prices to compute the discounted expected payoff of.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
Basic Numerical Procedures Chapter 19 1 Options, Futures, and Other Derivatives, 7th Edition, Copyright © John C. Hull 2008.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Expectation for multivariate distributions. Definition Let X 1, X 2, …, X n denote n jointly distributed random variable with joint density function f(x.
Lecture 4: Statistics Review II Date: 9/5/02  Hypothesis tests: power  Estimation: likelihood, moment estimation, least square  Statistical properties.
Improved Cross Entropy Method For Estimation Presented by: Alex & Yanna.
Stats Probability Theory Summary. The sample Space, S The sample space, S, for a random phenomena is the set of all possible outcomes.
Chapter 19 Monte Carlo Valuation. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Monte Carlo Valuation Simulation of future stock.
STA347 - week 91 Random Vectors and Matrices A random vector is a vector whose elements are random variables. The collective behavior of a p x 1 random.
Introduction to Sampling Methods Qi Zhao Oct.27,2004.
Stochastic Hydrology Random Field Simulation Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University.
CS Statistical Machine learning Lecture 25 Yuan (Alan) Qi Purdue CS Nov
Lecture 3 Types of Probability Distributions Dr Peter Wheale.
Gil McVean, Department of Statistics Thursday February 12 th 2009 Monte Carlo simulation.
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
Chapter 9: Introduction to the t statistic. The t Statistic The t statistic allows researchers to use sample data to test hypotheses about an unknown.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Generating Random Variates
Fundamentals of Data Analysis Lecture 11 Methods of parametric estimation.
CWR 6536 Stochastic Subsurface Hydrology Optimal Estimation of Hydrologic Parameters.
Chapter 19 Monte Carlo Valuation. © 2013 Pearson Education, Inc., publishing as Prentice Hall. All rights reserved.19-2 Monte Carlo Valuation Simulation.
Lesson 8: Basic Monte Carlo integration
Advanced Statistical Computing Fall 2016
Basic simulation methodology
Main topics in the course on probability theory
Chapter 3 Component Reliability Analysis of Structures.
Lecture 2 – Monte Carlo method in finance
Generating Random Variates
Presentation transcript:

Module 1: Statistical Issues in Micro simulation Paul Sousa

Overview Numerical Solution Numerical Solution Simulation Simulation Random number generation Random number generation Transformation Transformation Techniques: Gibbs sampling, Metropolis Hasting algorithm Techniques: Gibbs sampling, Metropolis Hasting algorithm Variance reduction techniques Variance reduction techniques Conclusion Conclusion

Numerical Solution Monte Carlo TechniqueSimulation Deterministic Simulation Stochastic Simulation Monte Carlo Simulation

Introduction Model Solution: Analytical vs Numerical Model Solution: Analytical vs Numerical Numerical solution: Substitutes Numbers for Independent Variables and Parameters Needs Iteration Technique. Numerical solution: Substitutes Numbers for Independent Variables and Parameters Needs Iteration Technique. Numerical Technique: Monte Carlo Method & Simulation Numerical Technique: Monte Carlo Method & Simulation Simulation: Deterministic Simulation & Stochastic Simulation. Simulation: Deterministic Simulation & Stochastic Simulation. Deterministic Simulation: Does not Necessarily Imply the Use of Random Number Deterministic Simulation: Does not Necessarily Imply the Use of Random Number Stochastic Simulation: Uses Random Numbers---Denoted as Monte Carlo Simulation. Stochastic Simulation: Uses Random Numbers---Denoted as Monte Carlo Simulation.

Linear Congruential Generators A sequence of integers I 1, I 2,…, each between 0 and m-1 (a large number) is generated by the recurrence relation: A sequence of integers I 1, I 2,…, each between 0 and m-1 (a large number) is generated by the recurrence relation: I j+1 = mod (a I j + c, m) where a and c are positive integers known as the multiplier and increment, and m is the modulus To calculate mod (X, m) divide X by m, then take the remainder term and multiply it by m To calculate mod (X, m) divide X by m, then take the remainder term and multiply it by m e.g. mod (12, 7) = 512/7 = x 7 =5 Finally, divide I j by m gives a uniform variable between 0 and 1 Finally, divide I j by m gives a uniform variable between 0 and 1 Linear congruential methods are very fast, but are not completely free of sequential correlation on successive calls. Linear congruential methods are very fast, but are not completely free of sequential correlation on successive calls.

Transformation to other Distributions Consider a random variable with density function f (x) and corresponding cumulative density function F (x). If the inverse of cumulative density function for X can be calculated, then X can be obtained from U. Consider a random variable with density function f (x) and corresponding cumulative density function F (x). If the inverse of cumulative density function for X can be calculated, then X can be obtained from U. By definition, F (x) = k means that the probability of obtaining a draw equal to or below x is k, where k is between 0 and 1. A draw u from the standard uniform provides a number between 0 and 1. We can set F (x) = u. By definition, F (x) = k means that the probability of obtaining a draw equal to or below x is k, where k is between 0 and 1. A draw u from the standard uniform provides a number between 0 and 1. We can set F (x) = u. thus x = F -1 (u) This procedure works only for univariate distributions. This procedure works only for univariate distributions.

Univariate Density Example Example: Extreme value distribution Example: Extreme value distribution density function, f (x) = exp (-x) * exp(-exp(-x)) CDF, F (x) = exp(-exp(-x)) A draw from this density is obtained as x = -ln (-ln u) A draw from this density is obtained as x = -ln (-ln u) Draws from more complicated densities: Draws from more complicated densities: Accepting-Reject Method Importance Sampling Gibbs Sampling Metropolis-Hasting Algorithm

Accept-Reject Method More generalized way of drawing from multivariate distributions. More generalized way of drawing from multivariate distributions. Suppose we want to draw from multivariate density g (x) within the range a ≤ x ≤ b Suppose we want to draw from multivariate density g (x) within the range a ≤ x ≤ b i.e. drawing from: i.e. drawing from: f (x) = { 1/k g (x) a ≤ x ≤ b { 0otherwise where k is a normalized constant We can obtain draws from f by simply drawing from g and retaining (“accepting”) the draws that are within the relevant range and discarding (“rejecting”) the draws that are outside the range. We can obtain draws from f by simply drawing from g and retaining (“accepting”) the draws that are within the relevant range and discarding (“rejecting”) the draws that are outside the range.

Accept-Reject Method Advantage: It can be applied whenever it is possible to draw from the untruncated density. Advantage: It can be applied whenever it is possible to draw from the untruncated density. Disadvantage: Crude method -> problems Disadvantage: Crude method -> problems However, it is a useful “last option” However, it is a useful “last option”

Importance Sampling Suppose x has a density f (x) that cannot be easily drawn from by other procedures. Suppose further that there is another density g (x) that can be easily draw from. Suppose x has a density f (x) that cannot be easily drawn from by other procedures. Suppose further that there is another density g (x) that can be easily draw from. Draws from f (x) can be obtained as follows: Draws from f (x) can be obtained as follows: 1. Take a draw from g (x) and label it x Weight the draw by f (x 1 ) /g (x 1 ) 3. Repeat this process many times. The set of weight draws is equivalent to the set of draws from f. The set of weight draws is equivalent to the set of draws from f.

Gibbs Sampling For multinomial distributions, it is sometimes difficult to draw directly from the joint density and yet easy to draw from the conditional density of each element given the values of the other elements. Gibbs sampling can be used in these situations. For multinomial distributions, it is sometimes difficult to draw directly from the joint density and yet easy to draw from the conditional density of each element given the values of the other elements. Gibbs sampling can be used in these situations. Consider two random variables x 1 and x 2. Consider two random variables x 1 and x 2. The joint density is f (x 1, x 2 ), and the conditional densities are f (x 1 |x 2 ) and f (x 2 |x 1 ). The joint density is f (x 1, x 2 ), and the conditional densities are f (x 1 |x 2 ) and f (x 2 |x 1 ). Gibbs sampling proceeds by drawing iteratively from the conditional densities: drawing x 1 conditional on a value of x 2, drawing x 2 conditional on this draw of x 1, drawing a new x 1 conditional on the new value of x 2, and so on. Gibbs sampling proceeds by drawing iteratively from the conditional densities: drawing x 1 conditional on a value of x 2, drawing x 2 conditional on this draw of x 1, drawing a new x 1 conditional on the new value of x 2, and so on. This process converges to draws from the joint density. This process converges to draws from the joint density.

Metropolis-Hastings Algorithm 1. Start with a value of the vector x, labeled x 0 2. Choose a trial value of x 1 as x 1t = x 0 + n, where n is drawn from a distribution g (η) that has zero mean. Usually a normal distribution is specified for g (η). 3. Calculate the density at the trial value x 1t, and compare it with the density at the original value x 0, i.e. compare f (x 1t ) with f(x 0 ). If f (x 1t ) > f (x 0 ), then accept x 1t, label it x 1, and move to step 4. If f (x 1t ) ≤ f (x 0 ), then accept x 1t with probability f(x 1t )/f(x 0 ), and reject it with probability 1 - f(x 1t )/f(x 0 ). To determine whether to accept or reject x 1t in this case, draw a standard uniform μ. If μ ≤ f(x 1t )/f(x 0 ), then keep x 1t. Otherwise, reject x 1t. If x 1t is accepted, then label it x 1. If x 1t is rejected, then use x 0 as x 1.

Metropolis-Hastings Algorithm 4. Choose a trial value of x 2 as x 2t = x 1 + η, where η is a new draw from g (η). 5. Apply the rule in step 3 to either accept x 2t as x 2 or reject x 2t and use x 1 as x Continue this process for many iterations. The sequence x t becomes equivalent to draws from f (x) for sufficiently large t. General but computational intensive algorithm General but computational intensive algorithm

Variance Reduction The use of independent random draws in simulation is appealing because it is conceptually straightforward and the statistical properties of the resulting simulator are easy to derive. The use of independent random draws in simulation is appealing because it is conceptually straightforward and the statistical properties of the resulting simulator are easy to derive. However, there are other ways to take draws that can provide greater accuracy for a given number of draws. However, there are other ways to take draws that can provide greater accuracy for a given number of draws. In taking a sequence of draws from the density f( ), two issues are at stake: Coverage and Covariance. In taking a sequence of draws from the density f( ), two issues are at stake: Coverage and Covariance. Coverage: If our objective is to approximate over the entire domain F (x) = ∫ f (x) Coverage: If our objective is to approximate over the entire domain F (x) = ∫ f (x) A more accurate approximation would be obtained by evaluating f (x) throughout the entire domain of f  better coverage A more accurate approximation would be obtained by evaluating f (x) throughout the entire domain of f  better coverage

Variance Reduction Covariance With independent draws, the covariance over draws is zero. The variance of a simulator based on R independent draws is therefore the variance based on one draw divided by R. With independent draws, the covariance over draws is zero. The variance of a simulator based on R independent draws is therefore the variance based on one draw divided by R. If the draws are negatively correlated instead of independent, then the variance of the simulator is lower. If the draws are negatively correlated instead of independent, then the variance of the simulator is lower. The issue of Covariance is related to Coverage By inducing a negative correlation between draws, better coverage is usually assured. By inducing a negative correlation between draws, better coverage is usually assured. E.g. With R=2, if the two draws are taken independently, then both could end up being at the low side of the distribution. If negative correlation is induced, then the second draw will tend to be high if the first draw is low, which provides better coverage. E.g. With R=2, if the two draws are taken independently, then both could end up being at the low side of the distribution. If negative correlation is induced, then the second draw will tend to be high if the first draw is low, which provides better coverage.

Variance Reduction Techniques Antithetics Antithetics draws are obtained by creating various types of mirror images of a random draw. Antithetics draws are obtained by creating various types of mirror images of a random draw. For a symmetric density that is centered on zero, the simplest antithetic variate is created by reversing the sign of all elements of a draw. E.g. x 2k = - x 2k-1 k = 1  n/2 For a symmetric density that is centered on zero, the simplest antithetic variate is created by reversing the sign of all elements of a draw. E.g. x 2k = - x 2k-1 k = 1  n/2

Variance Reduction Techniques Systematic sampling Systematic sampling creates a grid of points over the support of the density and randomly shifts the entire grid. Systematic sampling creates a grid of points over the support of the density and randomly shifts the entire grid. Consider draws from a uniform distribution between 0 and 1. The unit interval is divided into four segments and draws taken in a way that assures one draw in each segment with equal distance between the draws. Take a draw from a uniform between 0 and 0.25, as x 1 ; x 2 = x 1 ; x3 = x 1 ; Consider draws from a uniform distribution between 0 and 1. The unit interval is divided into four segments and draws taken in a way that assures one draw in each segment with equal distance between the draws. Take a draw from a uniform between 0 and 0.25, as x 1 ; x 2 = x 1 ; x3 = x 1 ; x 4 = x 1. It implies a tradeoff between the number of random variables and the coverage It implies a tradeoff between the number of random variables and the coverage

Module 1: Statistical Issues in Micro simulation Paul Sousa