Documente Academic
Documente Profesional
Documente Cultură
1/ 22
Example 6.3.1: The inventory demand model in program sis2 The demand per time interval is an Equilikely(10,50) random variate = 30, = 140 = 11.8, and the demand pdf is at
0.10 f (d) 0.05 0 d
10
20
30
40
50
2/ 22
= 30, =
0.10 f (d) 0.05 0
10
20
30
40
50
d
3/ 22
= 30, =
f (d) 0.05 0 d
10
20
30
40
50
= 30, = 48 = 6.9 and the pdf has heavier tails than the Poisson(30) pdf
0.10 f (d) 0.05 0 d
5/ 22
10
20
30
40
50
Example 6.3.4
The number of demand instances per time interval is Poisson(50) The demand per instance is Geometric(p) with p = 0.375 Modied GetDemand Method
long GetDemand(void) { long instances = Poisson(50.0); /* avoid 0 */ return (Pascal(instances, 0.375)); }
= 30, =
0.10 f (d) 0.05 0
10
20
30
40
50
d
6/ 22
f (d ) = Pr(D = d ) =
i =0
7/ 22
Program sis4
Based on sis3 but with a more realistic inventory demand model The inter-demand time is an Exponential(1/) random variate Whether or not a demand occurs at demand instances is random with probability p To allow for the possibility of more than 1 unit of demand, the demand amount is a Geometric(p) random variate Expected demand per time interval is p (1 p )
8/ 22
Truncation
In the previous example, no bound on number of autos purchased Can be made more realistic by truncating possible values Start with random variable X with possible values X = {0, 1, 2, . . . } and cdf F (x ) = Pr (X x ) If a > 0,
Pr(a X b ) = Pr(X b ) Pr(X < a) = F (b ) F (a 1) Essentially, always true i F (b ) = 1.0 and F (a 1) = 0.0
10/ 22
Transformation is not exact because X is discrete Pr(X < a) and Pr(X > b ) <
11/ 22
Example 6.3.6
For the Poisson(50) random variable I , determine a, b so that Pr(a I b ) = 1.0 Use = = 106 Use rvms to compute Determining a, b
a = idfPoisson(50.0,); /* = 106 */ b = idfPoisson(50.0,1.0 - ); /* = 106 */
Results: a = 20 and b = 87 Consistent with the bounds produced by the conversion: Pr(I < 20) = cdfPoisson(50.0, 19) = 0.48 106 <
Section 6.3: Discrete Random Variable Applications
Eects of Truncation
Truncating Poisson(50) to the range {20, . . . , 87} is insignicant: truncated and un-truncated random variables have (essentially) the same distribution Truncation is useful for eciency:
When idf is complex, inversion requires cdf search cdf values are typically stored in an array Small range gives improved space/time eciency
13/ 22
Incorrect Truncation
Use a Poisson(30) demand model in program sis2 Truncate the demand to the range 20 d 40 Incorrect Truncation
d = Poisson(30.0); if (d < 20) d = 20; if (d > 40) d = 40; return d;
10
20
30
40
50
d = 0, 1, 2, ...
40
d =20
f (d ) = 0.945817
Compute a new truncated random variable Dt with pdf ft (d ) ft (d ) = f (d ) F (40) F (19) d = 20, 21, ..., 40
15/ 22
Ft (d ) =
t =20
ft (t ) =
dft (d ) = 29.841
and
d =20
v u 40 uX (d t )2 ft (d ) t = t = 4.720
d =20
16/ 22
17/ 22
Illustration of pdfs
0.10 f (d) 0.05 0 0.10 f (d) 0.05 0 0.10 f (d) 0.05 0 Poisson(30) correctly truncated d
20
30
40
50
20
30
40
50
10
20
30
40
50
18/ 22
Random values of Xt can be generated using inversion and Alg.6.2.2 with cdf Ft ()
19/ 22
20/ 22
Example 6.3.9
Uses library rvms and are static variables that are computed once only
21/ 22
Truncation By Acceptance-Rejection
Acceptance-rejection is not synchronized or monotone even if the un-truncated generator has these properties Truncation by cdf modication or constrained inversion is preferable
22/ 22