<< Chapter < Page Chapter >> Page >
idemo1                           % Joint matrix in datafile idemo1 P =  0.0091  0.0147  0.0035  0.0049  0.0105  0.0161  0.0112     0.0117  0.0189  0.0045  0.0063  0.0135  0.0207  0.0144      0.0104  0.0168  0.0040  0.0056  0.0120  0.0184  0.0128     0.0169  0.0273  0.0065  0.0091  0.0095  0.0299  0.0208      0.0052  0.0084  0.0020  0.0028  0.0060  0.0092  0.0064     0.0169  0.0273  0.0065  0.0091  0.0195  0.0299  0.0208      0.0104  0.0168  0.0040  0.0056  0.0120  0.0184  0.0128     0.0078  0.0126  0.0030  0.0042  0.0190  0.0138  0.0096      0.0117  0.0189  0.0045  0.0063  0.0135  0.0207  0.0144     0.0091  0.0147  0.0035  0.0049  0.0105  0.0161  0.0112      0.0065  0.0105  0.0025  0.0035  0.0075  0.0115  0.0080     0.0143  0.0231  0.0055  0.0077  0.0165  0.0253  0.0176 itestEnter matrix of joint probabilities  P The pair {X,Y} is NOT independent   % Result of test To see where the product rule fails, call for D disp(D)                          % Optional call for D     0     0     0     0     0     0     0      0     0     0     0     0     0     0     0     0     0     0     0     0     0      1     1     1     1     1     1     1     0     0     0     0     0     0     0      0     0     0     0     0     0     0     0     0     0     0     0     0     0      1     1     1     1     1     1     1     0     0     0     0     0     0     0      0     0     0     0     0     0     0     0     0     0     0     0     0     0      0     0     0     0     0     0     0

Next, we consider an example in which the pair is known to be independent.

Got questions? Get instant answers now!
jdemo3      % call for data in m-file disp(P)     % call to display P     0.0132    0.0198    0.0297    0.0209    0.0264      0.0372    0.0558    0.0837    0.0589    0.0744     0.0516    0.0774    0.1161    0.0817    0.1032      0.0180    0.0270    0.0405    0.0285    0.0360  itestEnter matrix of joint probabilities  P The pair {X,Y} is independent       % Result of test
Got questions? Get instant answers now!

The procedure icalc can be extended to deal with an independent class of three random variables. We call the m-procedure icalc3 . The following is a simple example of its use.

Calculations for three independent random variables

X = 0:4; Y = 1:2:7;Z = 0:3:12; PX = 0.1*[1 3 2 3 1]; PY = 0.1*[2 2 3 3]; PZ = 0.1*[2 2 1 3 2]; icalc3Enter row matrix of X-values  X Enter row matrix of Y-values  YEnter row matrix of Z-values  Z Enter X probabilities  PXEnter Y probabilities  PY Enter Z probabilities  PZUse array operations on matrices X, Y, Z, PX, PY, PZ, t, u, v, and PG = 3*t + 2*u - 4*v;        % W = 3X + 2Y -4Z [W,PW] = csort(G,P);        % Distribution for W PG = total((G>0).*P)        % P(g(X,Y,Z) > 0) PG =  0.3370Pg = (W>0)*PW'            % P(Z > 0) Pg =  0.3370
Got questions? Get instant answers now!

An m-procedure icalc4 to handle an independent class of four variables is also available. Also several variations of the m-function mgsum and the m-function diidsum are used for obtaining distributions for sums of independent random variables. We consider them in various contexts inother units.

Approximation for the absolutely continuous case

In the study of functions of random variables, we show that an approximating simple random variable X s of the type we use is a function of the random variable X which is approximated. Also, we show that if { X , Y } is an independent pair, so is { g ( X ) , h ( Y ) } for any reasonable functions g and h . Thus if { X , Y } is an independent pair, so is any pair of approximating simple functions { X s , Y s } of the type considered. Now it is theoretically possible for the approximating pair { X s , Y s } to be independent, yet have the approximated pair { X , Y } not independent. But this is highly unlikely . For all practical purposes, we may consider { X , Y } to be independent iff { X s , Y s } is independent. When in doubt, consider a second pair of approximating simple functions with more subdivision points. This decreases even further the likelihood of a falseindication of independence by the approximating random variables.

An independent pair

Suppose X exponential (3) and Y exponential (2) with

f X Y ( t , u ) = 6 e - 3 t e - 2 u = 6 e - ( 3 t + 2 u ) t 0 , u 0

Since e - 12 6 × 10 - 6 , we approximate X for values up to 4 and Y for values up to 6.

tuappr Enter matrix [a b] of X-range endpoints  [0 4] Enter matrix [c d] of Y-range endpoints  [0 6] Enter number of X approximation points  200Enter number of Y approximation points  300 Enter expression for joint density  6*exp(-(3*t + 2*u))Use array operations on X, Y, PX, PY, t, u, and P itestEnter matrix of joint probabilities  PThe pair {X,Y} is independent
Got questions? Get instant answers now!

Test for independence

The pair { X , Y } has joint density f X Y ( t , u ) = 4 t u 0 t 1 , 0 u 1 . It is easy enough to determine the marginals in this case. By symmetry, they are the same.

f X ( t ) = 4 t 0 1 u d u = 2 t , 0 t 1

so that f X Y = f X f Y which ensures the pair is independent. Consider the solution using tuappr and itest.

tuappr Enter matrix [a b] of X-range endpoints  [0 1] Enter matrix [c d] of Y-range endpoints  [0 1] Enter number of X approximation points  100Enter number of Y approximation points  100 Enter expression for joint density  4*t.*uUse array operations on X, Y, PX, PY, t, u, and P itestEnter matrix of joint probabilities  P The pair {X,Y} is independent
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask