<< Chapter < Page | Chapter >> Page > |
We examine, first, calculations on a pair of simple random variables , considered jointly. These are, in effect, two components of a random vector , which maps from the basic space Ω to the plane. The induced distribution is on the -plane. Values on the horizontal axis ( t -axis) correspond to values of the first coordinate random variable X and values on the vertical axis ( u -axis) correspond to values of Y . We extend the computational strategy used for a single random variable.
First, let us review the one-variable strategy. In this case, data consist of values t i and corresponding probabilities arranged in matrices
To perform calculations on , we we use array operations on X to form a matrix
which has in a position corresponding to in matrix .
Basic problem . Determine , where M is some prescribed set of values.
We extend these techniques and strategies to a pair of simple random variables, considered jointly.
>>jdemo4 % Call for data in file jdemo4.m>>jcalc % Call for setup procedure
Enter JOINT PROBABILITIES (as on the plane) PEnter row matrix of VALUES of X X
Enter row matrix of VALUES of Y YUse array operations on matrices X, Y, PX, PY, t, u, and P>>disp(P) % Optional call for display of P
0.0360 0.0198 0.0297 0.0209 0.01800.0372 0.0558 0.0837 0.0589 0.0744
0.0516 0.0774 0.1161 0.0817 0.10320.0264 0.0270 0.0405 0.0285 0.0132>>PX % Optional call for display of PX
PX = 0.1512 0.1800 0.2700 0.1900 0.2088>>PY % Optional call for display of PY
PY = 0.1356 0.4300 0.3100 0.1244- - - - - - - - - - % Steps performed by jcalc>>PX = sum(P) % Calculation of PX as performed by jcalc
PX = 0.1512 0.1800 0.2700 0.1900 0.2088>>PY = fliplr(sum(P')) % Calculation of PY (note reversal)
PY = 0.1356 0.4300 0.3100 0.1244>>[t,u] = meshgrid(X,fliplr(Y)); % Formation of t, u matrices (note reversal)>>disp(t) % Display of calculating matrix t
-3 0 1 3 5 % A row of X-values for each value of Y-3 0 1 3 5
-3 0 1 3 5-3 0 1 3 5>>disp(u) % Display of calculating matrix u
2 2 2 2 2 % A column of Y-values (increasing1 1 1 1 1 % upward) for each value of X
0 0 0 0 0-2 -2 -2 -2 -2
Suppose we wish to determine the probability
.
Using array operations on
t and
u , we obtain the matrix
.
>>G = t.^2 - 3*u % Formation of G = [g(t_i,u_j)] matrixG = 3 -6 -5 3 19
6 -3 -2 6 229 0 1 9 25
15 6 7 15 31>>M = G>= 1 % Positions where G>= 1
M = 1 0 0 1 11 0 0 1 1
1 0 1 1 11 1 1 1 1>>pM = M.*P % Selection of probabilities
pM =0.0360 0 0 0.0209 0.0180
0.0372 0 0 0.0589 0.07440.0516 0 0.1161 0.0817 0.1032
0.0264 0.0270 0.0405 0.0285 0.0132>>PM = total(pM) % Total of selected probabilities
PM = 0.7336 % P(g(X,Y)>= 1)
>>P = 0.1*[3 0 0; 0 6 0; 0 0 1];>>FXY = flipud(cumsum(flipud(P))) % Cumulative column sums upward
FXY =0.3000 0.6000 0.1000
0 0.6000 0.10000 0 0.1000>>FXY = cumsum(FXY')' % Cumulative row sums
FXY =0.3000 0.9000 1.0000
0 0.6000 0.70000 0 0.1000
>>jddbn
Enter joint probability matrix (as on the plane) PTo view joint distribution function, call for FXY>>disp(FXY)
0.1512 0.3312 0.6012 0.7912 1.00000.1152 0.2754 0.5157 0.6848 0.8756
0.0780 0.1824 0.3390 0.4492 0.56560.0264 0.0534 0.0939 0.1224 0.1356
These values may be put on a grid, in the same manner as in Figure 2 for Example 3 in "Random Vectors and Joint Distributions".
[x,y,t,u,px,py,p] = jcalcf(X,Y,P)
The quantities
and
p may be given any desired names.Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?