Summary: Frequently, we observe a value of some random variable, but are really interested in a value derived from this by a function rule. If X is a random variable and g is a reasonable function (technically, a Borel function), then Z=g(X)is a new random variable which has the value g(t) for any ω such that X(ω)=t. Thus Z(ω)=g(X(ω)). Suppose we have the distribution for X. How can we determine P(Z∈M), the probability Z takes a value in the set M? Mapping approach. Simply find the amount of probability mass mapped into the set M by the random variable X. In the absolutely continuous case, integrate the density function for X over the set M. In the discrete case, as an alternative, select those possible values for X which are in the set M and add their probabilities. For a Borel function g and set M, determine the set N of all those t which are mapped into M, then determine the probability X is in N as in the previous case.
Introduction
Frequently, we observe a value of some random variable, but are really interested in a value derived from this by a function rule. If X is a random variable and gis a reasonable function (technically, a Borel function), then Z=g(X) is a new random variable which has the value g(t) for any ω such that X(ω)=t. Thus Z(ω)=g(X(ω)).
The problem; an approach
We consider, first, functions of a single random variable. A wide variety of functions are utilized in practice.
EXAMPLE 1: A quality control problem
In a quality control check on a production line for ball bearings it may be easier to weigh the balls than measure the diameters. If we can assume true spherical shape and w is the weight, then diameter is kw1/3, where k is a factor depending upon the formula for the volume of a sphere, the units of measurement, and the density of the steel. Thus, if X is the weight of the sampled ball, the desired random variable is D=kX1/3.
EXAMPLE 2: Price breaks
The cultural committee of a student organization has arranged a special deal for tickets to a concert. The agreement is that the organization will purchase ten tickets at $20 each (regardless of the number of individual buyers). Additional tickets are available according to the following schedule:
- 11-20, $18 each
- 21-30, $16 each
- 31-50, $15 each
- 51-100, $13 each
If the number of purchasers is a random variable X, the total cost (in dollars) is a random quantity Z=g(X) described by
g(X)=200+18IM1(X)(X−10)+(16−18)IM2(X)(X−20)(1)
+(15−16)IM3(X)(X−30)+(13−15)IM4(X)(X−50)(2)
whereM1=[10,∞),M2=[20,∞),M3=[30,∞),M4=[50,∞)(3)
The function rule is more complicated than in Example 1, but the essential problem is the same.
The problem
If X is a random variable, then Z=g(X) is a new random variable. Suppose we have the distribution for X. How can we determine P(Z∈M), the probability Z takes a value in the set M?
An approach to a solution
We consider two equivalent approaches
- To find P(X∈M).
- Mapping approach. Simply find the amount of probability mass mapped into the set M by the random variable X.
- In the absolutely continuous case, calculate ∫MfX.
- In the discrete case, identify those values ti of X which are in the set M and add the associated probabilities.
- Discrete alternative. Consider each value ti of X. Select those which meet the defining conditions for M and add the associated probabilities. This is the approach we use in the MATLAB calculations. Note that it is not necessary to describe geometrically the set M; merely use the defining conditions.
- Mapping approach. Simply find the amount of probability mass mapped into the set M by the random variable X.
- To find P(g(X)∈M).
- Mapping approach. Determine the set N of all those t which are mapped into M by the function g. Now if X(ω)∈N, then g(X(ω))∈M, and if g(X(ω))∈M, thenX(ω)∈N. Hence{ω:g(X(ω))∈M{={ω:X(ω)∈N{(4)Since these are the same event, they must have the same probability. Once N is identified, determine P(X∈N) in the usual manner (see part a, above).
- Discrete alternative. For each possible value ti of X, determine whether g(ti) meets the defining condition for M. Select those ti which do and add the associated probabilities.
- Mapping approach. Determine the set N of all those t which are mapped into M by the function g. Now if X(ω)∈N, then g(X(ω))∈M, and if g(X(ω))∈M, thenX(ω)∈N. Hence
— □
Remark. The set N in the mapping approach is called the inverse image N=g−1(M).
EXAMPLE 3: A discrete example
Suppose X has values -2, 0, 1, 3, 6, with respective probabilities 0.2, 0.1, 0.2, 0.3 0.2.
Consider Z=g(X)=(X+1)(X−4). Determine P(Z>0).
SOLUTION
First solution. The mapping approach
g(t)=(t+1)(t−4). N={t:g(t)>0{ is the set of points to the left of −1 or to the right of 4. The X-values −2 and 6 lie in this set. Hence
P(g(X)>0)=P(X=−2)+P(X=6)=0.2+0.2=0.4(5)
Second solution. The discrete alternative
X= | -2 | 0 | 1 | 3 | 6 |
PX= | 0.2 | 0.1 | 0.2 | 0.3 | 0.2 |
Z= | 6 | -4 | -6 | -4 | 14 |
Z>0 | 1 | 0 | 0 | 0 | 1 |
Picking out and adding the indicated probabilities, we have
P(Z>0)=0.2+0.2=0.4(6)
In this case (and often for “hand calculations”) the mapping approach requires less calculation. However, for MATLAB calculations (as we show below), the discrete alternative is more readily implemented.
EXAMPLE 4: An absolutely continuous example
Suppose X∼ uniform [−3,7]. Then fX(t)=0.1,−3≤t≤7 (and zero elsewhere). Let
Z=g(X)=(X+1)(X−4)(7)
Determine P(Z>0).
SOLUTION
First we determine N={t:g(t)>0{. As in Example 3, g(t)=(t+1)(t−4)>0 for t<−1 or t>4. Because of the uniform distribution, the integral of the density over any subinterval of [−3,7] is 0.1 times the length of that subinterval. Thus, the desired probability is
P(g(X)>0)=0.1[(−1−(−3))+(7−4)]=0.5(8)
We consider, next, some important examples.
EXAMPLE 5: The normal distribution and standardized normal distribution
To show that if X∼N(μ,σ2) then
Z=g(X)=
∼N(0,1)(9)
X−μ |
σ |
VERIFICATION
We wish to show the denity function for Z is
φ(t)=
e−t2/2(10)
1 |
\2π |
Now
g(t)=
≤vifft≤σv+μ(11)
t−μ |
σ |
Hence, for given M=(−∞,v] the inverse image is N=(−∞,σv+μ], so that
FZ(v)=P(Z≤v)=P(Z∈M)=P(X∈N)=P(X≤σv+μ)=FX(σv+μ)(12)
Since the density is the derivative of the distribution function,
fZ(v)=FZ'(v)=FX'(σv+μ)σ=σfX(σv+μ)(13)
Thus
fZ(v)=
exp[−
(
)2=
e−v2/2=φ(v)(14)
σ |
σ\2π |
1 |
2 |
σv+μ−μ |
σ |
1 |
\2π |
We conclude that Z∼N(0,1)
EXAMPLE 6: Affine functions
Suppose X has distribution function FX. If it is absolutely continuous, the corresponding density is fX. Consider Z=aX+b(a≠0). Here g(t)=at+b, an affine function (linear plus a constant). Determine the distribution function for Z (and the density in the absolutely continuous case).
SOLUTION
FZ(v)=P(Z≤v)=P(aX+b≤v)(15)
There are two cases
- a>0:FZ(v)=P(X,≤,
v−b a v−b a - a<0FZ(v)=P(X,≥,So that
v−b a v−b a v−b a FZ(v)=1−FX(v−b a v−b a
For the absolutely continuous case, P(X,=,
v−b |
a |
- for a>0fZ(v)=
1 a v−b a - for a<0fZ(v)=−
1 a v−b a
Since for a<0, −a=|a|, the two cases may be combined into one formula.
fZ(v)=
fX(
)(19)
1 |
|a| |
v−b |
a |
EXAMPLE 7: Completion of normal and standardized normal relationship
Suppose Z∼N(0,1). Show that X=σZ+μ(σ>0) is N(μ,σ2).
VERIFICATION
Use of the result of Example 6 on affine functions shows that
fX(t)=
φ(
)=
exp[−,
,(
)2](20)
1 |
σ |
t−μ |
σ |
1 |
σ\2π |
1 |
2 |
t−μ |
σ |
EXAMPLE 8: Fractional power of a nonnegative random variable
Suppose X≥0 and Z=g(X)=X1/a for a>1. Since for t≥0, t1/a is increasing, we have 0≤t1/a≤v iff 0≤t≤va. Thus
FZ(v)=P(Z≤v)=P(X≤va)=FX(va)(21)
In the absolutely continuous case
fZ(v)=FZ'(v)=fX(va)ava−1(22)
EXAMPLE 9: Fractional power of an exponentially distributed random variable
Suppose X∼ exponential (λ). Then Z=X1/a∼ Weibull (a,λ,0).
According to the result of Example 8,
FZ(t)=FX(ta)=1−e−λta(23)
which is the distribution function for Z∼ Weibull (a,λ,0).
EXAMPLE 10: A simple approximation as a function of X
If X is a random variable, a simple function approximation may be constructed (see Distribution Approximations). We limit our discussion to the bounded case, in which the range of X is limited to a bounded interval I=[a,b]. Suppose I is partitioned into n subintervals by points ti, 1≤i≤n−1, with a=t0 and b=tn. Let Mi=[ti−1,ti) be the ith subinterval, 1≤i≤n−1 and Mn=[tn−1,tn]. Let Ei=X−1(Mi) be the set of points mapped into Mi by X. Then the Ei form a partition of the basic space Ω. For the given subdivision, we form a simple random variable Xs as follows. In each subinterval, pick a point si,ti−1≤si<ti. The simple random variable
Xs=
siIEi(24)
n |
∑ |
i=1 |
approximates X to within the length of the largest subinterval Mi. Now IEi=IMi(X), since IEi(ω)=1 iff X(ω)∈Mi iff IMi(X(ω))=1. We may thus write
Xs=
siIMi(X),afunctionofX(25)
n |
∑ |
i=1 |
Use of MATLAB on simple random variables
For simple random variables, we use the discrete alternative approach, since this may be implemented easily with MATLAB. Suppose the distribution for X is expressed in the row vectors X andPX.
- We perform array operations on vector X to obtainG=[g(t1)g(t2)⋯g(tn)](26)
- We use relational and logical operations on G to obtain a matrix M which has ones for those ti (values of X) such that g(ti) satisfies the desired condition (and zeros elsewhere).
- The zero-one matrix M is used to select the the corresponding pi=P(X=ti) and sum them by the taking the dot product of M and PX.
EXAMPLE 11: Basic calculations for a function of a simple random variable
X = -5:10; % Values of X
PX = ibinom(15,0.6,0:15); % Probabilities for X
G = (X + 6).*(X - 1).*(X - 8); % Array operations on X matrix to get G = g(X)
M = (G > - 100)&(G < 130); % Relational and logical operations on G
PM = M*PX' % Sum of probabilities for selected values
PM = 0.4800
disp([X;G;M;PX]') % Display of various matrices (as columns)
-5.0000 78.0000 1.0000 0.0000
-4.0000 120.0000 1.0000 0.0000
-3.0000 132.0000 0 0.0003
-2.0000 120.0000 1.0000 0.0016
-1.0000 90.0000 1.0000 0.0074
0 48.0000 1.0000 0.0245
1.0000 0 1.0000 0.0612
2.0000 -48.0000 1.0000 0.1181
3.0000 -90.0000 1.0000 0.1771
4.0000 -120.0000 0 0.2066
5.0000 -132.0000 0 0.1859
6.0000 -120.0000 0 0.1268
7.0000 -78.0000 1.0000 0.0634
8.0000 0 1.0000 0.0219
9.0000 120.0000 1.0000 0.0047
10.0000 288.0000 0 0.0005
[Z,PZ] = csort(G,PX); % Sorting and consolidating to obtain
disp([Z;PZ]') % the distribution for Z = g(X)
-132.0000 0.1859
-120.0000 0.3334
-90.0000 0.1771
-78.0000 0.0634
-48.0000 0.1181
0 0.0832
48.0000 0.0245
78.0000 0.0000
90.0000 0.0074
120.0000 0.0064
132.0000 0.0003
288.0000 0.0005
P1 = (G<-120)*PX ' % Further calculation using G, PX
P1 = 0.1859
p1 = (Z<-120)*PZ' % Alternate using Z, PZ
p1 = 0.1859
EXAMPLE 12
X=10IA+18IB+10IC with {A,B,C{ independent and P=[0.60.30.5].
We calculate the distribution for X, then determine the distribution for
Z=X1/2−X+50(27)
c = [10 18 10 0];
pm = minprob(0.1*[6 3 5]);
canonic
Enter row vector of coefficients c
Enter row vector of minterm probabilities pm
Use row matrices X and PX for calculations
Call for XDBN to view the distribution
disp(XDBN)
0 0.1400
10.0000 0.3500
18.0000 0.0600
20.0000 0.2100
28.0000 0.1500
38.0000 0.0900
G = sqrt(X) - X + 50; % Formation of G matrix
[Z,PZ] = csort(G,PX); % Sorts distinct values of g(X)
disp([Z;PZ]') % consolidates probabilities
18.1644 0.0900
27.2915 0.1500
34.4721 0.2100
36.2426 0.0600
43.1623 0.3500
50.0000 0.1400
M = (Z < 20)|(Z >= 40) % Direct use of Z distribution
M = 1 0 0 0 1 1
PZM = M*PZ'
PZM = 0.5800
Remark. Note that with the m-function csort, we may name the output as desired.
EXAMPLE 13: Continuation of Example 12, above.
H = 2*X.^2 - 3*X + 1;
[W,PW] = csort(H,PX)
W = 1 171 595 741 1485 2775
PW = 0.1400 0.3500 0.0600 0.2100 0.1500 0.0900
EXAMPLE 14: A discrete approximation
Suppose X has density function fX(t)=
1 |
2 |
1 |
2 |
P(Z≤0.8)=FX(0.64)=(0.643+0.642)/2=0.3359(28)
Using the approximation procedure, we have
tappr
Enter matrix [a b] of x-range endpoints [0 1]
Enter number of x approximation points 200
Enter density as a function of t (3*t.^2 + 2*t)/2
Use row matrices X and PX as in the simple case
G = X.^(1/2);
M = G <= 0.8;
PM = M*PX'
PM = 0.3359 % Agrees quite closely with the theoretical
0 comments:
Post a Comment