Simulation Modeling and Analysis - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Simulation Modeling and Analysis

Description:

... Stat::Fit. 10. Chi-Square Frequency ... See Stat::Fit. X02 = n (Oi - Ei)2/Ei. 11. Runs Testing. Run: sequence ... is tested againts the Chi-square distribution. ... – PowerPoint PPT presentation

Number of Views:92
Avg rating:3.0/5.0
Slides: 17
Provided by: ernestogut
Category:

less

Transcript and Presenter's Notes

Title: Simulation Modeling and Analysis


1
Simulation Modeling and Analysis
  • Pseudo-Random Numbers

1
2
Outline
  • Properties of Random Numbers
  • Generating Random Numbers
  • Testing Random Numbers

2
3
Properties of Random Numbers
  • Key Properties
  • Uniformity
  • Independence
  • Density function (continuous!)
  • f(x) 1 for 0 lt x lt 1, 0 otherwise
  • Moments
  • E(R) 1/2 V(R) 1/12

3
4
Generating Random Numbers
  • Random Numbers vs Pseudo-random Numbers
  • Requirements of a RNG routine
  • Speed
  • Portable
  • Long Cycle
  • Replicable RN
  • Uniform and Independent RNs

4
5
Random Number Generation
  • Linear Congruential Method
  • X i1 (a Xi c) mod m
  • Ri Xi/m
  • Note Only values from the set
  • I 0,1/m,2/m,,(m-1)/m
  • are obtained

5
6
Random Number Generation -contd
  • Longest Possible Period (P)
  • If m 2b and c gt 0 , P m
  • If m 2b and c 0 , P m/4
  • If m prime and c 0 , P m-1
  • Example
  • X i1 (75 Xi ) mod (231-1)

6
7
Random Number Generation -contd
  • Combined Congruential Generators. Two distinct
    congruential generators can be combined to obtain
    PRNs with longer periods.
  • X i1 (?(-1)j-1 Xi,j ) mod (m1 - 1)
  • Ri Xi/m1, Xi gt 0 Ri (m1-1)/m1, Xi gt 0

7
8
Testing Random Numbers
  • Null Hypotheses
  • H0 Ri U0,1 H0 Ri independent
  • Tests
  • Frequency test
  • Runs test
  • Autocorrelation test
  • Gap test
  • Poker test

8
9
Kolmogorov-Smirnov Frequency Test
  • 1.- Arrange data in increasing value
  • 2.- Compute D, D- and D
  • 3.- Find critical Dc (Handout) for given a
  • 4.- Accept or reject the null hypothesis.
  • 5.- Example StatFit

9
10
Chi-Square Frequency Test
  • The Chi static compares observed frequencies of
    occurrence of PRNs in selected subdomains
    against expected frequencies derived from the U
    distribution function. See StatFit
  • X02 ?n (Oi - Ei)2/Ei

10
11
Runs Testing
  • Run sequence of similar events
  • Runs up and runs down (independence)
  • Maximum number of runs (N numbers) N-1
  • mean (2N-1)/3 variance (16N-29)/90
  • Test hypothesis against normal distribution.

11
12
Runs Testing -contd
  • Runs above and below the mean
  • Maximum number of runs (N numbers, n1 above and
    n2 below the mean) n1n2
  • mean 2 n1 n2/N 1/2
  • variance 2 n1 n2 (2 n1 n2 - N)/N2 (N-1)
  • Test hypothesis against normal distribution.

12
13
Runs Testing -contd
  • Runs length
  • Test hypothesis against Chi square distribution

13
14
Autocorrelation Testing
  • Seek the autocorrelation between every m numbers
    (I.e. dependence)
  • Null Hypothesis H0 ?im 0
  • Note If values are uncorrelated, ?im has normal
    distribution. So, test hypothesis against normal
    distribution.

14
15
Gap Testing
  • Gap Interval of recurrence of same digit.
  • Monitor Frequency of gaps and test
  • 1.- Specify the cdf F(x) 1-0.9 x1
  • 2.- Arrange the observed gaps into S(x)
  • 3.- Find D and Dc
  • 4.- Accept or reject the null hypothesis.

15
16
Poker Test
  • Frequency of repetition of certain digits in a
    series
  • Null hypothesis is tested againts the Chi-square
    distribution.

16
Write a Comment
User Comments (0)
About PowerShow.com