Chapter 7 Random-Number Generation

Similar documents
NPAR TESTS. One-Sample Chi-Square Test. Cell Specification. Observed Frequencies 1O i 6. Expected Frequencies 1EXP i 6

PSYCHOLOGICAL RESEARCH (PYC 304-C) Lecture 12

benefit is 2, paid if the policyholder dies within the year, and probability of death within the year is ).

Quantization Effects in Digital Filters

Can Auto Liability Insurance Purchases Signal Risk Attitude?

CS 2750 Machine Learning. Lecture 3. Density estimation. CS 2750 Machine Learning. Announcements

SIMPLE LINEAR CORRELATION

1 Example 1: Axis-aligned rectangles

STATISTICAL DATA ANALYSIS IN EXCEL

What is Candidate Sampling

Exhaustive Regression. An Exploration of Regression-Based Data Mining Techniques Using Super Computation

An Interest-Oriented Network Evolution Mechanism for Online Communities

1. Measuring association using correlation and regression

Binomial Link Functions. Lori Murray, Phil Munz

Economic Interpretation of Regression. Theory and Applications

CHOLESTEROL REFERENCE METHOD LABORATORY NETWORK. Sample Stability Protocol

Latent Class Regression. Statistics for Psychosocial Research II: Structural Models December 4 and 6, 2006

8 Algorithm for Binary Searching in Trees

Module 2 LOSSLESS IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Statistical Methods to Develop Rating Models

Forecasting the Direction and Strength of Stock Market Movement

Calculating the high frequency transmission line parameters of power cables

Evaluating credit risk models: A critique and a new proposal

CHAPTER 14 MORE ABOUT REGRESSION

How To Understand The Results Of The German Meris Cloud And Water Vapour Product

Abstract. 260 Business Intelligence Journal July IDENTIFICATION OF DEMAND THROUGH STATISTICAL DISTRIBUTION MODELING FOR IMPROVED DEMAND FORECASTING

How To Calculate The Accountng Perod Of Nequalty

Analysis of Premium Liabilities for Australian Lines of Business

Realistic Image Synthesis

A hybrid global optimization algorithm based on parallel chaos optimization and outlook algorithm

RESEARCH ON DUAL-SHAKER SINE VIBRATION CONTROL. Yaoqi FENG 1, Hanping QIU 1. China Academy of Space Technology (CAST)

The OC Curve of Attribute Acceptance Plans

Recurrence. 1 Definitions and main statements

An Alternative Way to Measure Private Equity Performance

Covariate-based pricing of automobile insurance

IMPACT ANALYSIS OF A CELLULAR PHONE

Credit Limit Optimization (CLO) for Credit Cards

Rate-Based Daily Arrival Process Models with Application to Call Centers

THE METHOD OF LEAST SQUARES THE METHOD OF LEAST SQUARES

Extending Probabilistic Dynamic Epistemic Logic

Diagnostic Tests of Cross Section Independence for Nonlinear Panel Data Models

Marginal Returns to Education For Teachers

Social Nfluence and Its Models

8.5 UNITARY AND HERMITIAN MATRICES. The conjugate transpose of a complex matrix A, denoted by A*, is given by

HOUSEHOLDS DEBT BURDEN: AN ANALYSIS BASED ON MICROECONOMIC DATA*

Luby s Alg. for Maximal Independent Sets using Pairwise Independence

Production. 2. Y is closed A set is closed if it contains its boundary. We need this for the solution existence in the profit maximization problem.

Sketching Sampled Data Streams

Risk Model of Long-Term Production Scheduling in Open Pit Gold Mining

Improving Resource Allocation Strategy Against Human Adversaries in Security Games

Feature selection for intrusion detection. Slobodan Petrović NISlab, Gjøvik University College

Usage of LCG/CLCG numbers for electronic gambling applications

Causal, Explanatory Forecasting. Analysis. Regression Analysis. Simple Linear Regression. Which is Independent? Forecasting

Secure Network Coding Over the Integers

Frequency Selective IQ Phase and IQ Amplitude Imbalance Adjustments for OFDM Direct Conversion Transmitters

Inter-Ing INTERDISCIPLINARITY IN ENGINEERING SCIENTIFIC INTERNATIONAL CONFERENCE, TG. MUREŞ ROMÂNIA, November 2007.

Risk-based Fatigue Estimate of Deep Water Risers -- Course Project for EM388F: Fracture Mechanics, Spring 2008

Portfolio Loss Distribution

Characterization of Assembly. Variation Analysis Methods. A Thesis. Presented to the. Department of Mechanical Engineering. Brigham Young University

SPEE Recommended Evaluation Practice #6 Definition of Decline Curve Parameters Background:

Single and multiple stage classifiers implementing logistic discrimination

14.74 Lecture 5: Health (2)

1 De nitions and Censoring

THE DISTRIBUTION OF LOAN PORTFOLIO VALUE * Oldrich Alfons Vasicek

PRIVATE SCHOOL CHOICE: THE EFFECTS OF RELIGIOUS AFFILIATION AND PARTICIPATION

Fragility Based Rehabilitation Decision Analysis

How To Know The Components Of Mean Squared Error Of Herarchcal Estmator S

Estimation of Dispersion Parameters in GLMs with and without Random Effects

Gender differences in revealed risk taking: evidence from mutual fund investors

Traffic State Estimation in the Traffic Management Center of Berlin

Application of Quasi Monte Carlo methods and Global Sensitivity Analysis in finance

Effective wavelet-based compression method with adaptive quantization threshold and zerotree coding

A DYNAMIC CRASHING METHOD FOR PROJECT MANAGEMENT USING SIMULATION-BASED OPTIMIZATION. Michael E. Kuhl Radhamés A. Tolentino-Peña

The Greedy Method. Introduction. 0/1 Knapsack Problem

Kiel Institute for World Economics Duesternbrooker Weg Kiel (Germany) Kiel Working Paper No. 1120

NONLINEAR OPTIMIZATION FOR PROJECT SCHEDULING AND RESOURCE ALLOCATION UNDER UNCERTAINTY

Chapter 4 ECONOMIC DISPATCH AND UNIT COMMITMENT

Chapter XX More advanced approaches to the analysis of survey data. Gad Nathan Hebrew University Jerusalem, Israel. Abstract

Estimating the Number of Clusters in Genetics of Acute Lymphoblastic Leukemia Data

VoIP Playout Buffer Adjustment using Adaptive Estimation of Network Delays

Estimating the Effect of Electric Generation Technology Mix on Retail Electric Rates

Design and Analysis of Benchmarking Experiments for Distributed Internet Services

When Network Effect Meets Congestion Effect: Leveraging Social Services for Wireless Services

On-Line Fault Detection in Wind Turbine Transmission System using Adaptive Filter and Robust Statistical Features

Calculation of Sampling Weights

Properties of Indoor Received Signal Strength for WLAN Location Fingerprinting

A COPMARISON OF PARTICLE SWARM OPTIMIZATION AND THE GENETIC ALGORITHM

Proceedings of the Annual Meeting of the American Statistical Association, August 5-9, 2001

5 Multiple regression analysis with qualitative information

This circuit than can be reduced to a planar circuit

Psicológica Universidad de Valencia ISSN (Versión impresa): ISSN (Versión en línea): ESPAÑA

Regression Models for a Binary Response Using EXCEL and JMP

An Evaluation of the Extended Logistic, Simple Logistic, and Gompertz Models for Forecasting Short Lifecycle Products and Services

IDENTIFICATION AND CORRECTION OF A COMMON ERROR IN GENERAL ANNUITY CALCULATIONS

Heuristic Static Load-Balancing Algorithm Applied to CESM

An Investigation of the Performance of the Generalized S-X 2 Item-Fit Index for Polytomous IRT Models. Taehoon Kang Troy T. Chen

ECONOMICS OF PLANT ENERGY SAVINGS PROJECTS IN A CHANGING MARKET Douglas C White Emerson Process Management

Is There A Tradeoff between Employer-Provided Health Insurance and Wages?

How To Evaluate A Dia Fund Suffcency

Research on Engineering Software Data Formats Conversion Network

Transcription:

Chapter 7 Random-Number Generaton Banks, Carson, Nelson & Ncol Dscrete-Event System Smulaton Purpose & Overvew Dscuss the generaton of random numbers. Introduce the subsequent testng for randomness: Frequency test Autocorrelaton test.

Propertes of Random Numbers Two mportant statstcal propertes: Unformty Independence. Random Number, R, must be ndependently drawn from a unform dstrbuton wth pdf:, f ( x) 0, E( R) xdx 0 0 x otherwse x 0 Fgure: pdf for random numbers 3 Generaton of Pseudo-Random Numbers Pseudo, because generatng numbers usng a known method removes the potental for true randomness. Goal: To produce a sequence of numbers n [0,] that smulates, or mtates, the deal propertes of random numbers (RN). Important consderatons n RN routnes: Fast Portable to dfferent computers Have suffcently long cycle Replcable Closely approxmate the deal statstcal propertes of unformty and ndependence. 4

Technques for Generatng Random Numbers Lnear Congruental Method (LCM). Combned Lnear Congruental Generators (CLCG). Random-Number Streams. 5 Lnear Congruental Method [Technques] To produce a sequence of ntegers, X, X, between 0 and m- by followng a recursve relatonshp: X ( ax + c) mod m, 0,,,... + The multpler The ncrement The modulus The selecton of the values for a, c, m, and X 0 drastcally affects the statstcal propertes and the cycle length. The random ntegers are beng generated [0,m-], and to convert the ntegers to random numbers: X R,,,... m 6 3

Example [LCM] Use X 0 7, a 7, c 43, and m 00. The X and R values are: X (7*7+43) mod 00 50 mod 00, R 0.0; X (7*+3) mod 00 77, R 0.77; X 3 (7*77+3) mod 00 5, R 3 0.5; 7 Characterstcs of a Good Generator [LCM] Maxmum Densty Such that he values assumed by R,,,, leave no large gaps on [0,] Problem: Instead of contnuous, each R s dscrete Soluton: a very large nteger for modulus m Approxmaton appears to be of lttle consequence Maxmum Perod To acheve maxmum densty and avod cyclng. Acheve by: proper choce of a, c, m, and X 0. Most dgtal computers use a bnary representaton of numbers Speed and effcency are aded by a modulus, m, to be (or close to) a power of. 8 4

Combned Lnear Congruental Generators [Technques] Reason: Longer perod generator s needed because of the ncreasng complexty of stmulated systems. Approach: Combne two or more multplcatve congruental generators. Let X,, X,,, X,k, be the th output from k dfferent multplcatve congruental generators. The j th generator: Has prme modulus m j and multpler a j and perod s m j- Produces ntegers X,j s approx ~ Unform on ntegers n [, m-] W,j X,j - s approx ~ Unform on ntegers n [, m-] 9 Combned Lnear Congruental Generators [Technques] Suggested form: X k j ( ) X, j mod m j The coeffcent: Performs the subtracton X,- Hence, X, m R m, m X f 0 X 0 The maxmum possble perod s: P ( m )( m )...( k m k ) 0 5

Combned Lnear Congruental Generators [Technques] Example: For 3-bt computers, L Ecuyer [988] suggests combnng k generators wth m,47,483,563, a 40,04, m,47,483,399 and a 0,69. The algorthm becomes: Step : Select seeds X,0 n the range [,,47,483,56] for the st generator X,0 n the range [,,47,483,398] for the nd generator. Step : For each ndvdual generator, X,j+ 40,04 X,j mod,47,483,563 X,j+ 40,69 X,j mod,47,483,399. Step 3: X j+ (X,j+ - X,j+ ) mod,47,483,56. Step 4: Return X j+, X j+ > 0 R,47,483,563 j+,47,483,56, X j+ 0,47,483,563 Step 5: Set j j+, go back to step. Combned generator has perod: (m )(m )/ ~ x 0 8 Random-Numbers Streams [Technques] The seed for a lnear congruental random-number generator: Is the nteger value X 0 that ntalzes the random-number sequence. Any value n the sequence can be used to seed the generator. A random-number stream: Refers to a startng seed taken from the sequence X 0, X,, X P. If the streams are b values apart, then stream could defned by startng seed: S X b ( ) Older generators: b 0 5 ; Newer generators: b 0 37. A sngle random-number generator wth k streams can act lke k dstnct vrtual random-number generators To compare two or more alternatve systems. Advantageous to dedcate portons of the pseudo-random number sequence to the same purpose n each of the smulated systems. 6

Tests for Random Numbers Two categores: Testng for unformty: H 0 : R ~ U[0,] H : R ~ / U[0,] Falure to reject the null hypothess, H 0, means that evdence of non-unformty has not been detected. Testng for ndependence: H 0 : R ~ ndependently H : R ~ / ndependently Falure to reject the null hypothess, H 0, means that evdence of dependence has not been detected. Level of sgnfcance α, the probablty of rejectng H 0 when t s true: α P(reject H 0 H 0 s true) 3 Tests for Random Numbers When to use these tests: If a well-known smulaton languages or random-number generators s used, t s probably unnecessary to test If the generator s not explctly known or documented, e.g., spreadsheet programs, symbolc/numercal calculators, tests should be appled to many sample numbers. Types of tests: Theoretcal tests: evaluate the choces of m, a, and c wthout actually generatng any numbers Emprcal tests: appled to actual sequences of numbers produced. Our emphass. 4 7

Frequency Tests [Tests for RN] Test of unformty Two dfferent methods: Kolmogorov-Smrnov test Ch-square test 5 Kolmogorov-Smrnov Test [Frequency Test] Compares the contnuous cdf, F(x), of the unform dstrbuton wth the emprcal cdf, S N (x), of the N sample observatons. We know: F( x) x, 0 x If the sample from the RN generator s R, R,, R N, then the emprcal cdf, S N (x) s: number of R, R,..., R x) N Based on the statstc: D max F(x) - S N (x) S N ( whch are x Samplng dstrbuton of D s known (a functon of N, tabulated n Table A.8.) A more powerful test, recommended. n 6 8

Kolmogorov-Smrnov Test [Frequency Test] Example: Suppose 5 generated numbers are 0.44, 0.8, 0.4, 0.05, 0.93. Step : Step : R () /N 0.0 0.40 0.60 0.80.00 /N R () 0.5 0.6 0.6-0.07 R () (-)/N 0.05 0.05 Step 3: D max(d +, D - ) 0.6 Step 4: For α 0.05, D α 0.565 > D 0.4-0.44 0.04 0.8 0. 0.93 0.3 Arrange R () from smallest to largest D + max {/N R () } D - max {R () -(-)/N} Hence, H 0 s not rejected. 7 Ch-square test [Frequency Test] Ch-square test uses the sample statstc: n s the # of classes Χ 0 n ( O E ) E E s the expected # n the th class O s the observed # n the th class Approxmately the ch-square dstrbuton wth n- degrees of freedom (where the crtcal values are tabulated n Table A.6) For the unform dstrbuton, E, the expected number n the each class s: N E, where N s the total # of observaton n Vald only for large samples, e.g. N > 50 8 9

Tests for Autocorrelaton [Tests for RN] Testng the autocorrelaton between every m numbers (m s a.k.a. the lag), startng wth the th number The autocorrelaton ρ m between numbers: R, R +m, R +m, R +(M+)m M s the largest nteger such that + (M + )m N Hypothess: H : H 0 : If the values are uncorrelated: For large values of M, the dstrbuton of the estmator of ρ m, denoted s approxmately normal. ρˆm ρ 0, m ρ 0, m f numbers are ndependent f numbers are dependent 9 Tests for Autocorrelaton [Tests for RN] Test statstcs s: Z 0 ˆ ρm ˆ σ ˆ ρ m Z 0 s dstrbuted normally wth mean 0 and varance, and: M ρˆ m R kmr (k )m 0. 5 M + + + + k 0 σˆ ρ m 3M + 7 (M + ) If ρ m > 0, the subsequence has postve autocorrelaton Hgh random numbers tend to be followed by hgh ones, and vce versa. If ρ m < 0, the subsequence has negatve autocorrelaton Low random numbers tend to be followed by hgh ones, and vce versa. 0 0

Example [Test for Autocorrelaton] Test whether the 3 rd, 8 th, 3 th, and so on, for the followng output on P. 65. Hence, α 0.05, 3, m 5, N 30, and M 4 ρˆ σˆ 35 ρ35 Z 0 (0.3)(0.8) + (0.5)(0.33) + (0.33)(0.7) 0 5 4 (0.8)(0.05) (0.05)(0.36). + + + 0.945 3(4) + 7 0.8 ( 4 + ) 0.945.56 0.80 From Table A.3, z 0.05.96. Hence, the hypothess s not rejected. Shortcomngs [Test for Autocorrelaton] The test s not very senstve for small values of M, partcularly when the numbers beng tests are on the low sde. Problem when fshng for autocorrelaton by performng numerous tests: If α 0.05, there s a probablty of 0.05 of rejectng a true hypothess. If 0 ndependence sequences are examned, The probablty of fndng no sgnfcant autocorrelaton, by chance alone, s 0.95 0 0.60. Hence, the probablty of detectng sgnfcant autocorrelaton when t does not exst 40%

Summary In ths chapter, we descrbed: Generaton of random numbers Testng for unformty and ndependence Cauton: Even wth generators that have been used for years, some of whch stll n used, are found to be nadequate. Ths chapter provdes only the basc Also, even f generated numbers pass all the tests, some underlyng pattern mght have gone undetected. 3