You are on page 1of 18

GL-5001 Pemodelan Geologi

3 SKS

18 Oktober 2008
Dosen:
Prihadi Sumintadireja
Asep Kesumajana
GENERATING RANDOM VARIABLES
TABLE 3-1 General Classification of Types of Exogenous Inputs to Dynamic
Simulation Models, with Hypothetical Variables That could Be Used as Examples

General    
Category Form Example
     
Number of eruptions per century of active
Discrete empiral distribution volcano

Discrete theoretical distribution Poisson frequency distribution of sizes of marine


invertrebrate skeletons in a"death"population
Stochastic
Continuous theoretical Lognormal frequency distribution of bed
distribution thicknesses
in a stratigraphic section

Markov transition probabiliti Succession of fixed bottom-welling marine


matrix organisms
through time in a local area on the sea floor
   
Constant average salinity of the ocean
Deterministic
Deterministic function of time Variations in length of day thoughout the year
     
Figure 3-1 Diagram to illustrate combination of variables to create”hybrid”variable: (a)
purely deterministic variable (sine wave); (b) random variable (“noise”); (c) algebraic
addition, combining sine wave and random noise
DIGITAL GENERATION OF
PSEUDORANDOM NUMBERS

• Congruential Methods
TABLES 3-2 Calculation of Pseudorandom-
Numbers when a

x0=2, a=3, m=16, and c=1


i axi -1+c xi xi/m

0 2 0.125
1 7 7 10437
2 22 6 1.375
3 19 3 0.187
4 10 10 0.625
5 31 15 0.937
6 46 14 0.875
7 43 11 0.687
8 34 2 10.125
9 7 7 0.437
10 22 6 0.375
11 19 3 0.187
. . . .
. . . .
Number in column labeled xi are
pseudorandom integers; number in column
labeled xi/m are pseudorandom numbers in
the range 0.0 to 1.0
TABLE 3-3 FORTRAN Subroutine RANDOM for Generating
Pseudorandom Number by Mixed congruential Method

           

SUBROUTINE RANDOM (1X,


1A, 1C, M, FM,R)

LX=1A*IX+IC

1X=MOD(LX, M)
X=IX

R=X/FM

RETURN
END         
TABLE 3-4 FORTYRAN Subroutine RANDU for Generating Random
Numbers with a Uniform Distribution in the Range
a
0.0 to 1.0

          
SUBROUTINE RANDU (IX, IY, R)
IY=IX*65539
IF (IY) 5, 6, 6
5IY=IY+2147483647+1
6R=IY
R=R*.4656613E-9
RETURN
  END        
Figure 3-7 Histogram showing result of 1000 draw of uniform random distribution in
the range 20.0 to 130.0.
Figure 3-3 Three-dimensional histogram graphically displaying frequencies wiyh
which numbers in the ith frequency class are succeeded by those of the jth frequency
class, in a5x5 matrix containing five subintervals or frequency classes.
Figure 3-4 Histograms of hypothetical ash-fall frequency in inches per 50 years.
(a) Conventional frequency distribution; (b) cumulative frequency distribution based
on data in conventional distribution above. Left side of figure illustrates how random
numbers with uniform distribution in the range 0.0 to 1.0 are used to sample
cumulative distribution.
TABLE 3-5 Frequency of Occurrence of 1000 Ash-Fall-Thickness Values
Pertaining t a Hypothetical Ash-Fall Model, Illustrating the Preparation of a
Cumulative Frequency Distribution

  Range of       Cumulative
Frequency Frequency on
Class in Midrange Frequency Transformed
Interval Inches per Value of Transformed Scale
J 50 Years X(J) Occurrence Frequency FX(J)

1 0-10 5 150 0.150 0.150


2 10-20 15 225 0.225 0.375
3 20-30 25 50 0.050 0.425
4 30-40 35 240 0.240 0.665
5 40-50 45 60 0.060 0.725
6 50-60 55 275 0.275 1.000
           
TABLE 3-6 Subroutine RANEMP for Obtaining Random Samples From Any
Empirical Distribution, Used in Conjuntion With Subroutine RANDU, Which
Generates Uniformly Distributed Pseudorandom Number in the Range 0.0 to1.0

  SUBROUTINE RANEMP (X, FX, NCLASS, RANDOM, IX)  

DIMENSION X (NCLASS), FX(NCLASS)


CALL RANDU (IX, IY, R)
DO 10 J=1,NCLASS
10 IF (R.LE.FX(J) GO TO 20
20 RANDOM=X(J)
RETURN
  END        
Figure 3.5 Continuous cumulative frequency distribution used to tramform
given random variable r0 from continuous uniform distribution to
corresponding random variable x0.
Figure 3-6 Uniform frequency distribution between limits a and b
Figure 3-7 Histogram showing result of 1000 draws of uniform random
distribution in the range 20.0 to 130.0
Figure 3-8 Histogram of discrete distribution obtained in test involving 1000
draws of exponentially distributed random variable, whose distribution has an
expected value of 30.0. Curve of theoretical continuous distributin is
superimposed
Figure 3-9 Graph of continuous normal, or Gausian, distribution, in which
density is represented on the vertical axis and values of x on the horizontal
axis. Mean or expected value is denoted by µx

You might also like