Notes prepared by Prof Mrs) M.J. Gholba Class M.Sc Part(I) Information Technology

Similar documents
3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

CS-433: Simulation and Modeling Modeling and Probability Review

Probability and Random Variable Primer

Simulation and Random Number Generation

AS-Level Maths: Statistics 1 for Edexcel

Statistical analysis using matlab. HY 439 Presented by: George Fortetsanakis

Suites of Tests. DIEHARD TESTS (Marsaglia, 1985) See

Applied Stochastic Processes

Sampling Theory MODULE VII LECTURE - 23 VARYING PROBABILITY SAMPLING

Lecture 3: Probability Distributions

More metrics on cartesian products

Distributions /06. G.Serazzi 05/06 Dimensionamento degli Impianti Informatici distrib - 1

A be a probability space. A random vector

Chapter 2 Transformations and Expectations. , and define f

Linear Approximation with Regularization and Moving Least Squares

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Random Variate Generation ENM 307 SIMULATION. Anadolu Üniversitesi, Endüstri Mühendisliği Bölümü. Yrd. Doç. Dr. Gürkan ÖZTÜRK.

Section 8.3 Polar Form of Complex Numbers

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U)

Canonical transformations

Econ107 Applied Econometrics Topic 3: Classical Model (Studenmund, Chapter 4)

Maximum Likelihood Estimation of Binary Dependent Variables Models: Probit and Logit. 1. General Formulation of Binary Dependent Variables Models

j) = 1 (note sigma notation) ii. Continuous random variable (e.g. Normal distribution) 1. density function: f ( x) 0 and f ( x) dx = 1

Module 9. Lecture 6. Duality in Assignment Problems

Chapter 1. Probability

Simulated Power of the Discrete Cramér-von Mises Goodness-of-Fit Tests

APPENDIX A Some Linear Algebra

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

Maximum Likelihood Estimation of Binary Dependent Variables Models: Probit and Logit. 1. General Formulation of Binary Dependent Variables Models

Limited Dependent Variables

Statistical Inference. 2.3 Summary Statistics Measures of Center and Spread. parameters ( population characteristics )

Lecture 3 Stat102, Spring 2007

Modeling and Simulation NETW 707

Using T.O.M to Estimate Parameter of distributions that have not Single Exponential Family

Chapter 11: Simple Linear Regression and Correlation

Feb 14: Spatial analysis of data fields

Finding Dense Subgraphs in G(n, 1/2)

Stanford University CS254: Computational Complexity Notes 7 Luca Trevisan January 29, Notes for Lecture 7

Lecture Space-Bounded Derandomization

4 Analysis of Variance (ANOVA) 5 ANOVA. 5.1 Introduction. 5.2 Fixed Effects ANOVA

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

χ x B E (c) Figure 2.1.1: (a) a material particle in a body, (b) a place in space, (c) a configuration of the body

An (almost) unbiased estimator for the S-Gini index

Chapter 3 Describing Data Using Numerical Measures

The Multiple Classical Linear Regression Model (CLRM): Specification and Assumptions. 1. Introduction

x = , so that calculated

Section 3.6 Complex Zeros

CS 798: Homework Assignment 2 (Probability)

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

CHAPTER 14 GENERAL PERTURBATION THEORY

Lecture 5 Decoding Binary BCH Codes

Report on Image warping

The written Master s Examination

12. The Hamilton-Jacobi Equation Michael Fowler

Engineering Risk Benefit Analysis

= z 20 z n. (k 20) + 4 z k = 4

1 GSW Iterative Techniques for y = Ax

Lecture 12: Discrete Laplacian

Composite Hypotheses testing

Simulation and Probability Distribution

1. Inference on Regression Parameters a. Finding Mean, s.d and covariance amongst estimates. 2. Confidence Intervals and Working Hotelling Bands

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 12 10/21/2013. Martingale Concentration Inequalities and Applications

See Book Chapter 11 2 nd Edition (Chapter 10 1 st Edition)

FUZZY FINITE ELEMENT METHOD

Primer on High-Order Moment Estimators

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Foundations of Arithmetic

Difference Equations

A new Approach for Solving Linear Ordinary Differential Equations

Correlation and Regression. Correlation 9.1. Correlation. Chapter 9

The Geometry of Logit and Probit

Affine transformations and convexity

Lecture 4: November 17, Part 1 Single Buffer Management

Numerical Heat and Mass Transfer

Differentiating Gaussian Processes

What would be a reasonable choice of the quantization step Δ?

Analysis of Discrete Time Queues (Section 4.6)

EEL 6266 Power System Operation and Control. Chapter 3 Economic Dispatch Using Dynamic Programming

Lossy Compression. Compromise accuracy of reconstruction for increased compression.

NUMERICAL DIFFERENTIATION

As is less than , there is insufficient evidence to reject H 0 at the 5% level. The data may be modelled by Po(2).

Markov chains. Definition of a CTMC: [2, page 381] is a continuous time, discrete value random process such that for an infinitesimal

Expected Value and Variance

CSci 6974 and ECSE 6966 Math. Tech. for Vision, Graphics and Robotics Lecture 21, April 17, 2006 Estimating A Plane Homography

Additional Codes using Finite Difference Method. 1 HJB Equation for Consumption-Saving Problem Without Uncertainty

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

XII.3 The EM (Expectation-Maximization) Algorithm

Probability Theory. The nth coefficient of the Taylor series of f(k), expanded around k = 0, gives the nth moment of x as ( ik) n n!

Linear Regression Analysis: Terminology and Notation

e i is a random error

Why Monte Carlo Integration? Introduction to Monte Carlo Method. Continuous Probability. Continuous Probability

Chapter 2 - The Simple Linear Regression Model S =0. e i is a random error. S β2 β. This is a minimization problem. Solution is a calculus exercise.

Convergence of random processes

Lecture 17 : Stochastic Processes II

THE ROYAL STATISTICAL SOCIETY 2006 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE

CHAPTER 4. Vector Spaces

System in Weibull Distribution

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Transcription:

Inverse transformatons Generaton of random observatons from gven dstrbutons Assume that random numbers,,, are readly avalable, where each tself s a random varable whch s unformly dstrbuted over the range(,). In other words has pdf, f ( ), otherwse and cdf F ( ),,, Throughout ths chapter and,, represent random numbers unformly dstrbuted on (, ) and generated by one of the technques or taen from a random-number table. Inverse Transform Technque The nverse transform technque can be used to sample from the unform, the eponental, the Webull, and the trangular dstrbutons and emprcal dstrbutons. Addtonally, t s the underlyng prncple for samplng from a wde varety of dscrete dstrbutons. The technque wll be eplaned n detal for the eponental dstrbuton and then appled to other dstrbutons. It s the most straghtforward, but not always the most effcent, technque computatonally. Let the p.d.f.of a random varate be denoted f() and the c.d.f. be denoted F(). It can be shown that F() = ~ U(,),Snce cdf les between, t s u(o,) Sample space of a random varate Probablty space of a random number X F()= X=F - () ) Unform Dstrbuton

Consder a random varable X that s unformly dstrbuted on the nterval [a, b]. A reasonable guess for generatng X s gven by The pdf of X s gven by X = a + (b a) (.) f () =, a b a, otherwse The nverse transform technque can be utlzed, at least n prncple, for any dstrbuton, but t s most useful when the cdf, F (),s of such smple form that ts nverse, F -, can be easly computed. A stepby-step procedure for the nverse transform technque, The dervaton of Equaton (.) follows steps through 3 Step. The cdf s gven by b F () =, a a, a b a, b b Step. Set F (X) = (X a) / (b a) =. Step 3. Solvng for X n terms of yelds X = a + (b- a), whch agrees wth Equaton (.). Eample Gven a= and b= 4 generate s random observatons usng random numbers,.3,.48,.36,.,.54,.34 Sr. no andom number andom observaton X = a + (b- a) =+.3.6.48.96 3.36.7 4.. 5.54 3.8 6.34.68 ) Eponental Dstrbuton The eponental dstrbuton, has probablty densty functon (pdf)

f ( ) e,, and cumulatve dstrbuton functon (cdf) gven by F( ) f ( t) dt e,, The parameter can be nterpreted as the mean number of occurrences per tme unt. For eample, f nterarrval tmes X, X, X 3, had an eponental dstrbuton wth rate, then could be nterpreted as the mean number of arrvals per tme unt, or the arrval rate. Notce that for any E ( X ) So that / s the mean nterarrval tme. The goal here s to develop a procedure for generatng values X, X, X 3, whch have an eponental dstrbuton. Step. Compute the cdf of the desred random varable X. For the eponental dstrbuton, the cdf s F () = e,. Step. Set F (X) = on the range of X. For the eponental dstrbuton, t becomes e X = on the range. Snce X s a random varable (wth the eponental dstrbuton n ths case), t follows that e X s also a random varable, here called. As wll be shown later, has a unform dstrbuton over the nterval (, ). Step 3. Solve the equaton F (X) = for X n terms of. For the eponental dstrbuton, the soluton proceeds as follows: e X = e X = - X = ln (- ) X = - n( ) (.)

Equaton (.) s called a random-varate generator for the eponental dstrbuton. In general, Equaton (.) s wrtten as X = F - (). Generatng a sequence of values s accomplshed through step 4. Step 4. Generate (as needed) unform random numbers,, 3, and compute the desred random varates by X = F - ( ) For the eponental case, F - () = (-/ ) ln (- ) by Equaton (.), so that X = l n( ) (.) for =,, 3,.One smplfcaton that s usually employed n Equaton (.) s to replace - by to yeld X = ln (.3) Whch s justfed snce both and - are unformly dstrbuted on (, ). Eample : Generaton of fve Eponental Varates X wth Mean, /λ=.e. λ=, F () =- e - X = -Ln Gven andom Numbers 3 4 5.36.4.6597.7965.7696 X.4.43.78.59.468 3)Webull Dstrbuton The Webull dstrbuton when the locaton parameter s set to, ts pdf s gven by Equaton as f () = e ( /, otherwse ),

Where > and β > are the scale and shape parameters of the dstrbuton. To generate a Webull varate, follow steps through 3 Step. The cdf s gven by >ν > Step. Let =. Step 3. Solvng for X n terms of yelds X = [-ln (- )] /β (3.) t can be seen that f X s a Webull varate, then X β s an eponental varate wth mean β. Conversely, f Y s an eponental varate wth mean, then Y /β s a Webull varate wth shape parameter β and scale parameter = /β. 4)Trangular Dstrbuton Consder a random varable X whch has pdf X f () =, X otherwse Ths dstrbuton s called a trangular dstrbuton wth endponts (, ) and mode at. Its cdf s gven by

, F () =,, ( ), X X otherwse For X, and for X, X ( X ) X mples that, n whch case X =. X mples that, n whch case X = - ( ). Thus, X s generated by X =, ( ), Eample Generate four random observatons from trangular dstrbuton over(,,). =.3 <.5 X= =.599. =.4 <.5 X= =.88 3. =.65 >.5 X= - ( ) =.63 4. =.79 >.5 X= - ( ) =.359 Normal dstrbuton: consder random varable X whch s normally dstrbuted wth mean µ and varance σ. F() =P(X< )=.e. P(Z< (-µ)/σ)= correspondng to as area by usng normal table we can read the value of the ordnate as z.

z=ф - ( ) z=(-µ)/σ =µ+σz Eample Servce tme of a ban teller s found to follow normal dstrbuton wth mean 5 and s.d.. Generate fve servce tmes. 3 4 5.36.4.6597.7965.7696 z -. -.76.4.83.74 X 3.9 3.4 5.4 5.83 5.74 Emprcal Contnuous Dstrbutons If the modeler has been unable to fnd a theoretcal dstrbuton that provdes a good model for the nput data, then t may be necessary to use the emprcal dstrbuton of the data. One possblty s to smply resample the observed data tself. Ths s nown as usng the emprcal dstrbuton, and t maes partcularly good sense when the nput process s nown to tae on a fnte number of values. On the other hand, f the data are drawn from what s beleved to be a contnuous-valued nput process, then t maes sense to nterpolate between the observed data ponts to fll n the gaps. Ths secton descrbes a method for defnng and generatng data from a contnuous emprcal dstrbuton. Eample Fve observatons of fre crew response tmes (n mnutes) to ncomng alarms have been collected to be used n a smulaton nvestgaton possble alternatve staffng and crew schedulng polces. The data are.76.83.8.45.4 Before collectng more data, t s desred to develop a prelmnary smulaton model whch uses a response-tme dstrbuton based on these fve observatons. Thus, a method for generatng random varates from the response-tme dstrbuton s needed. Intally, t wll be assumed that response tmes X have a range X c, where c s unnown, but wll be estmated by ĉ = ma {X : =,, n} =.76, where {X, =,, n} are the raw data and n = 5 s the number of observatons. Table 8.. Summary of Fre Crew esponse-tme Data Interval (-) () Probablty, /n Cumulatve Probablty=/n..8.. 4..8.4..4. 3.4.45..6.5 4.45.83..8.9 5.83.76.. 4.65 Slope X ( ) X ( a / n )

Arrange the data from smallest to largest and let () () (n) denote these sorted values. Snce the smallest possble value s beleved to be, defne () =. Assgn a probablty of /n = /5 to each nterval (-) (), The slope of the th lne segment s gven by a ( ) / n ( ) The nverse cdf s calculated by X Fˆ ( ) ( ) a ( n when ( - )/n < / n. For eample, f a random number =.7 s generated, then s seen to le n the fourth nterval (between 3/5 =.6 and 4/5 =.8),, X = (4 - ) + a 4 ( (4 - ) / n) =.45 +.9 (.7.6) =.66 If a large sample of data s avalable (and sample szes from several hundred to tens of thousands are possble wth modern, automated data collecton), then t may be more convenent and computatonally effcent to frst summarze the data nto a frequency dstrbuton wth a much smaller number of ntervals and then ft a contnuous emprcal cdf to the frequency dstrbuton. Only a slght generalzaton of the above Equaton s requred to accomplsh ths. Now the slope of the th lne segment s gven by a = ( ) c c ( ) Where c s the cumulatve probablty of the frst ntervals of the frequency dstrbuton and (-) () s the th nterval. The nverse cdf s calculated by

X Fˆ ( ) ( ) a ( c ) when c - < c Eample Suppose that broen-wdget repar tmes have been collected. The data are summarzed n the followng Table n terms of the number of observatons n varous ntervals. For eample, there were 3 observatons between and.5 hour, between.5 and hour, and so on. Suppose t s nown that all repars tae at least 5 mnutes, so that X () =.5, as shown n Table..5 hour always. Then we set Table Summary of epar-tme Data Interval elatve Cumulatve Slope, (Hours) Frequency Frequency Frequency, c a.5 <.5 3.3.3.8.5 <...4 5. 3. <.5 5.5.66. 4.5. 34.34..47 For eample, suppose the frst random number generated s =.83. Then snce s between c 3 =.66 and c 4 =., X s X = (4 - ) + a 4 ( c 4 - ) =.5 +.47 (.83.66) =.75 As another llustraton, suppose that =.33. Snce c =.3<.4 = c, Dscrete Dstrbuton X = () + a ( c ) =.5 + 5. (.33.3) =.6 All dscrete dstrbutons can be generated usng the nverse transform technque, ether numercally through a table-looup procedure, or n some cases algebracally wth the fnal generaton scheme n terms of a formula. Other technques are sometmes used for certan dstrbutons, such as the convoluton technque for the bnomal dstrbuton. Some of these methods are dscussed n later

sectons. Ths subsecton gves eamples coverng both emprcal dstrbutons and two of the standard dscrete dstrbutons, the (dscrete) unform and the geometrc. Eample At the end of the day, the number of shpments on the loadng doc of the IHW Company (whose man product s the famous, ncredbly huge wdget) s ether,, or, wth observed relatve frequency of occurrence of.5,.3, and., respectvely. Internal consultants have been ased to develop a model to mprove the effcency of the loadng and haulng operatons, and as part of ths model they wll need to be able to generate values, X, to represent the number of shpments on the loadng doc at the end of each day. The consultants decde to model X as a dscrete random varable wth dstrbuton as gven below The probablty mass functon (pmf), p (), s gven by p() = P (X = ) =.5 p() = P (X = ) =.3 p() = P (X = ) =. and the cdf, F() = P (X ), s gven by F( ),.5,.8,., F() =.73.5 X =

3 The cdf of number of shpments, X. Table Table for Generatng the Dscrete Varate X Input, Output, r.5.8 3. ecall that the cdf of a dscrete random varable always conssts of horzontal lne segments wth jumps of sze p () at those ponts,, whch the random varable can assume. p() =.5 at =, of sze p() =.3 at =, and of sze p() =. at =. Let =.73 Here =.73 s transformed to X =. In general, for =, f F ( - ) = r - < r = F( ) Snce r =.5 < =.73 r =.8, set X = =. The generaton scheme s summarzed as follows: X,,,.5.8.5.8 Eample (A Dscrete Unform Dstrbuton) Consder the dscrete unform dstrbuton on {,,, } wth pmf and cdf gven by p ( ),,,...,

and F( ),,,,, 3 Let = and r = p() + + p( ) = F( ) = / for =,,,. Then by usng Inequalty (8.3) t can be seen that f the generated random number satsfes r r (A) Then X s generated by settng X =. Now, Inequalty (A) can be solved for : < < + Let [y] denote the smallest nteger y. for eample, [7.8] = 8, [5.3] = 6, and [-.3] = -. For y, [y] s a functon that rounds up. Ths notaton and Inequalty yeld a formula for generatng X, namely X = [] (B) For eample, consder generatng a random varate X, unformly dstrbuted on {,,, }. The varate, X, mght represent the number of pallets to be loaded onto a truc. Usng Table A. as a source of random numbers,, and Equaton (B) wth = yelds =.78, X = [7.8] = 8 =.3, X = [.3] = 3 =.3, X 3 = [.3] = 3 4 =.97, X 4 = [9.7] =

The procedure dscussed here can be modfed to generate a dscrete unform random varate wth any range consstng of consecutve ntegers Eample Consder the dscrete dstrbuton wth pmf gven by p ( ),,,..., ( ) For nteger values of n the range {,,, }, the cdf s gven by F( ) ( ) ( ( ( ( ) ) ) ) ( ) Generate and use Inequalty to conclude that X = whenever ( ) ( ) F( ) F( ) ( ) ( ) ( - ) ( + ) < ( + ) To solve ths nequalty for n terms of, frst fnd a value of that satsfes

or ( - ) = ( + ) - ( + ) = Then by roundng up, the soluton s X = [-]. By the quadratc formula, namely b b a 4ac wth a =, b = -, c = - ( + ), the soluton to the quadratc equaton s 4( ) The postve root of ths Equaton s the correct one to use so X s generated by X 4( ) Eample (The Geometrc Dstrbuton) Consder the geometrc dstrbuton wth pmf p() = p (, where < p <. Its cdf s gven by =,,, F( ) j pq j

p q q q For =,,, Usng the nverse transform technque geometrc random varable X wll assume the value whenever F( ) ( ( F( ) where s a generated random number assumed < <. Solvng Inequalty (8.9) for proceeds as follows: ( ( ( ) n( n( ) n( But - p < mples that ln ( - <, so that n( ) n( ) n( n( Thus, X = for that nteger value of satsfyng Inequalty or, n bref, usng the round-up functon [.] X n( n( ) Snce p s a fed parameter, let β = -/ln ( -. Then β > and, by Equaton (A), X = [-βln( ) ]. Occasonally, a geometrc varate X s needed whch can assume values {a, a +, a +, } wth pmf p () = p( -a ( = a, a +,.). Such a varate, X can be generated, usng Equaton (A), by (A) X a n( n( ) (B)

Eample Generate three values from a geometrc dstrbuton on the range {X } wth mean. Such a geometrc dstrbuton has pmf p () = p( - ( =,,.)wth mean /p =, or p = /. Thus, X can be generated by Equaton (B) wth a =, p = ½, and /ln ( - = -.443. Usng random number table A., =.93, =.5, and 3 =.687, whch yelds X = + [-.443 ln (.93) ] = + [3.878 ] = 4 X = + [-.443 ln (.5) ] = X 3 = + [-.443 ln (.687) ] = Convoluton method The probablty dstrbuton of a sum of two or more ndependent random varables s called a convoluton of the dstrbutons of the orgnal varables. Erlang dstrbuton. o An Erlang random varable X wth parameters (K,Ѳ) can be shown to be the sum of K ndependent eponental random varables X,=,,3..K each havng a mean /Ѳ o Usng equaton that can generate eponental varable, an Erlang varate can be generated by Accept eject technque Eample: Steps to generate unformly dstrbuted random numbers between /4 and.

Step. Generate a random number Step a. If, ¼ accept X =, go to Step 3 Step b. If, </4 reject, return to Step Step 3. If another unform random varate on [/4, ] s needed, repeat the procedure begnnng at Step. Otherwse stop. Posson Dstrbuton : The Pmf s P(X)= e! =,,.. where X can be nterpreted as the number of arrvals n one unt tme. o o From the orgnal Posson process defnton, we now the nter arrval tme,t, t,t 3..are eponentally dstrbuted wth a mean of λ,.e. λ arrvals n one unt tme. elaton between the two dstrbuton: X=n f and only f essentally ths means f there are n arrvals n one unt tme, the sum of nterarrval tme of the past n observatons has to be less than or equal to one, but f one more nterarrval tme s added, t s greater then one (unt tme). o The t s n the relaton can be generated from unformly dstrbuted random number t, thus that s o Now we can use the Acceptance-eject method to generate Posson dstrbuton.

Step. Set n =, P =. Step. Generate a random number n+ and replace P byp* n+. Step 3. If P < e -λ, then accept N = n, meanng at ths tme unt, there are n arrvals. Otherwse, reject the current n, ncrease n by one, return to Step. Eercses. Develop a random-varate generator for a random varable X wth the pdf f ( ) e e,,. Develop a generaton scheme for the trangular dstrbuton wth pdf f ( ) ( ), ( ),3 3, otherwse 3 6 Generate values of the random varate, compute the sample mean, and compare t to true mean of the dstrbuton. 3. Gven the followng cdf for a contnuous varable wth range -3 to 4, develop a generator for the varable., 3, 3 6 F( ), 3, 4 4 4. Gven the pdf f() = /9 on 3, develop a generator for ths dstrbuton.