Salta al contenuto
Note per Studenti Discrete Random Vectors Report

Discrete Random Vectors

In questa pagina 8

Definition

Definition (discrete random vector VV). It is a map

V:Ω→Rn,ω↦V(ω)=(X1(ω)⋮Xn(ω))∈Rn,V:\Omega\to\mathbb{R}^n,\qquad \omega\mapsto V(\omega)=\begin{pmatrix}X_1(\omega)\\ \vdots\\ X_n(\omega)\end{pmatrix}\in\mathbb{R}^n,

where the set of values V=V(Ω)\mathcal{V}=V(\Omega) is discrete.

Remarks.

  1. The components of VV are discrete random variables.
  2. The case n=2n=2 is treated to keep the notation simple; in this case V=(X,Y)TV=(X,Y)^T is often written.
  3. For the time being it is not specified whether VV is a row or a column vector (later: column).
  4. The alphabet of VV is V={(xy)∈R2 : (xy)=(X(ω)Y(ω)) for some ω∈Ω}\mathcal{V}=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\mathbb{R}^2\ :\ \begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}X(\omega)\\Y(\omega)\end{pmatrix}\text{ for some }\omega\in\Omega\right\}. In general V⊂X×Y\mathcal{V}\subset\mathcal{X}\times\mathcal{Y}, with strict inclusion occurring often (see the example).

Example (two 4-face dice). Ω={1,2,3,4}2\Omega=\{1,2,3,4\}^2, ω=(i,j)\omega=(i,j) with ii the face of die 1 and jj the face of die 2. Let

V(ω)=(X(ω),Y(ω))=(min⁡(i,j), j).V(\omega)=(X(\omega),Y(\omega))=(\min(i,j),\ j).

The alphabet of VV in the (X,Y)(X,Y) plane (figure: dots) consists of the points with X≤YX\le Y: for Y=1Y=1 only X=1X=1; for Y=2Y=2, X=1,2X=1,2; for Y=3Y=3, X=1,2,3X=1,2,3; for Y=4Y=4, X=1,2,3,4X=1,2,3,4. It is strictly contained in X×Y={1,2,3,4}2\mathcal{X}\times\mathcal{Y}=\{1,2,3,4\}^2.

Probabilistic characterization

As for random variables, giving the complete probabilistic description of the vector is equivalent to giving the probabilities of all elements of its alphabet. For notational convenience one always considers V=X×Y\mathcal{V}=\mathcal{X}\times\mathcal{Y} and assigns probability zero to the elements of X×Y\mathcal{X}\times\mathcal{Y} that do not belong to V\mathcal{V}. The measure on X×Y\mathcal{X}\times\mathcal{Y} induced by VV is

PV({(xi,yj)})≜P({ω∈Ω: X(ω)=xi, Y(ω)=yj})=P(X−1({xi})∩Y−1({yj}))=P([X=xi]∩[Y=yj])=P(X=xi,Y=yj),P^V(\{(x_i,y_j)\})\triangleq P\big(\{\omega\in\Omega:\ X(\omega)=x_i,\ Y(\omega)=y_j\}\big)=P\big(X^{-1}(\{x_i\})\cap Y^{-1}(\{y_j\})\big)=P([X=x_i]\cap[Y=y_j])=P(X=x_i,Y=y_j),

where the comma is shorthand for ∩\cap. These probabilities connect the measure on X×Y\mathcal{X}\times\mathcal{Y} to the measure on Ω\Omega, but only in special cases one has access to the space Ω\Omega. In applications all the available probabilistic information will be the joint discrete density.

Definition (joint discrete density). The random vector V=(X,Y)V=(X,Y) has joint discrete density

(xi,yj)↦pV(xi,yj)=pXY(xi,yj)=P(X=xi,Y=yj)(x_i,y_j)\mapsto p_V(x_i,y_j)=p_{XY}(x_i,y_j)=P(X=x_i,Y=y_j)

(pXYp_{XY} is the alternative, preferred, notation). To completely specify (X,Y)(X,Y) from the probabilistic point of view it is enough to assign the numbers {pV(xi,yj): xi∈X, yj∈Y}\{p_V(x_i,y_j):\ x_i\in\mathcal{X},\ y_j\in\mathcal{Y}\}.

Properties of the joint discrete density

  1. pV(xi,yj)≥0p_V(x_i,y_j)\ge0 for all (xi,yj)(x_i,y_j) (trivial).
  2. ∑xi∈X∑yj∈YpV(xi,yj)=1\displaystyle\sum_{x_i\in\mathcal{X}}\sum_{y_j\in\mathcal{Y}}p_V(x_i,y_j)=1.

Indeed

∑xi∑yjP([X=xi]∩[Y=yj])=∑xiP([X=xi]∩⋃yj[Y=yj])=∑xiP([X=xi]∩Ω)=∑xiP([X=xi])=P(Ω)=1.\sum_{x_i}\sum_{y_j}P([X=x_i]\cap[Y=y_j])=\sum_{x_i}P\Big([X=x_i]\cap\bigcup_{y_j}[Y=y_j]\Big)=\sum_{x_i}P([X=x_i]\cap\Omega)=\sum_{x_i}P([X=x_i])=P(\Omega)=1.

  1. ∑yj∈YpV(xi,yj)=pX(xi)\displaystyle\sum_{y_j\in\mathcal{Y}}p_V(x_i,y_j)=p_X(x_i) (marginal probability). Indeed ∑yjP([X=xi]∩[Y=yj])=P([X=xi]∩⋃yj[Y=yj])=P([X=xi]∩Ω)=P([X=xi])=pX(xi).\sum_{y_j}P([X=x_i]\cap[Y=y_j])=P\Big([X=x_i]\cap\bigcup_{y_j}[Y=y_j]\Big)=P([X=x_i]\cap\Omega)=P([X=x_i])=p_X(x_i).
  2. ∑xi∈XpV(xi,yj)=pY(yj)\displaystyle\sum_{x_i\in\mathcal{X}}p_V(x_i,y_j)=p_Y(y_j) (marginal probability); the proof is similar to that of 3.

Joint density and marginals

To a given joint density pXY(xi,yj)p_{XY}(x_i,y_j) there correspond two marginals pX(xi)p_X(x_i) and pY(yj)p_Y(y_j) obtained by

(∗){∑j=1∣Y∣pXY(xi,yj)=pX(xi)(∣X∣ equations, one for each xi∈X)∑i=1∣X∣pXY(xi,yj)=pY(yj)(∣Y∣ equations, one for each yj∈Y)(*)\qquad\begin{cases}\displaystyle\sum_{j=1}^{|\mathcal{Y}|}p_{XY}(x_i,y_j)=p_X(x_i)&\text{($|\mathcal{X}|$ equations, one for each }x_i\in\mathcal{X})\\[3mm]\displaystyle\sum_{i=1}^{|\mathcal{X}|}p_{XY}(x_i,y_j)=p_Y(y_j)&\text{($|\mathcal{Y}|$ equations, one for each }y_j\in\mathcal{Y})\end{cases}

On the other hand, given the marginal densities pX(xi)p_X(x_i) and pY(yj)p_Y(y_j) there exist infinitely many joint distributions pXY(xi,yj)p_{XY}(x_i,y_j) compatible with the given marginals. Indeed the linear system (∗)(*) consists of ∣Y∣+∣X∣−2|\mathcal{Y}|+|\mathcal{X}|-2 equations in the ∣X∣⋅∣Y∣−1|\mathcal{X}|\cdot|\mathcal{Y}|-1 unknowns pXY(xi,yj)p_{XY}(x_i,y_j) (the notes leave both counts as "why?" questions), and since ∣X∣∣Y∣−1>∣X∣+∣Y∣−2|\mathcal{X}||\mathcal{Y}|-1>|\mathcal{X}|+|\mathcal{Y}|-2 there are in general infinitely many solutions.

Expected value of scalar functions of a random vector

Let g:R2→Rg:\mathbb{R}^2\to\mathbb{R} and consider the random variable Z=g(X,Y)Z=g(X,Y) of the vector V=(X,Y)V=(X,Y).

Lemma. E(g(X,Y))=∑(xi,yj)∈X×Yg(xi,yj) pXY(xi,yj).E\big(g(X,Y)\big)=\sum_{(x_i,y_j)\in\mathcal{X}\times\mathcal{Y}}g(x_i,y_j)\,p_{XY}(x_i,y_j).

Proof (for Ω\Omega discrete). E(g(X,Y))=∑ω∈Ωg(X(ω),Y(ω))P({ω})=∑(xi,yj) ∑ω:X(ω)=xiY(ω)=yjg(X(ω),Y(ω))P({ω})E(g(X,Y))=\sum_{\omega\in\Omega}g(X(\omega),Y(\omega))P(\{\omega\})=\sum_{(x_i,y_j)}\ \sum_{\substack{\omega:\,X(\omega)=x_i\\ Y(\omega)=y_j}}g(X(\omega),Y(\omega))P(\{\omega\}) =∑(xi,yj)g(xi,yj)∑ω:X(ω)=xiY(ω)=yjP({ω})⏟pXY(xi,yj)=∑xi,yjg(xi,yj)pXY(xi,yj).□=\sum_{(x_i,y_j)}g(x_i,y_j)\underbrace{\sum_{\substack{\omega:\,X(\omega)=x_i\\ Y(\omega)=y_j}}P(\{\omega\})}_{p_{XY}(x_i,y_j)}=\sum_{x_i,y_j}g(x_i,y_j)p_{XY}(x_i,y_j).\qquad\square

Special case 1: g(x,y)=x+yg(x,y)=x+y. E(X+Y)=∑(xi+yj)pXY(xi,yj)=∑xipXY(xi,yj)+∑yjpXY(xi,yj)=∑xixipX(xi)+∑yjyjpY(yj)=E(X)+E(Y),E(X+Y)=\sum(x_i+y_j)p_{XY}(x_i,y_j)=\sum x_i p_{XY}(x_i,y_j)+\sum y_jp_{XY}(x_i,y_j)=\sum_{x_i}x_ip_X(x_i)+\sum_{y_j}y_jp_Y(y_j)=E(X)+E(Y), using the marginals.

Special case 2: g(x,y)=xyg(x,y)=xy. E(XY)=∑xi,yjxiyj pXY(xi,yj)E(XY)=\displaystyle\sum_{x_i,y_j}x_iy_j\,p_{XY}(x_i,y_j).

Example 1: two Bernoulli variables

(X,Y)(X,Y) has the joint density in the table (rows XX, columns YY, marginals at the edge):

X\YX\backslash Y 00 11 pXp_X
00 12\frac12 110\frac1{10} 610\frac6{10}
11 110\frac1{10} 310\frac3{10} 410\frac4{10}
pYp_Y 610\frac6{10} 410\frac4{10}

Both X,Y∼b(0.4)X,Y\sim b(0.4) and E(X)=E(Y)=0.4E(X)=E(Y)=0.4 (=0×0.6+1×0.4=0\times0.6+1\times0.4). Then

E(XY)=∑i=01∑j=01ij pXY(i,j)=1⋅1⋅pXY(1,1)=310,E(XY)=\sum_{i=0}^1\sum_{j=0}^1 ij\,p_{XY}(i,j)=1\cdot1\cdot p_{XY}(1,1)=\frac3{10},

cov(X,Y)=E(XY)−E(X)E(Y)=310−(410)2=30100−16100=14100,\mathrm{cov}(X,Y)=E(XY)-E(X)E(Y)=\frac3{10}-\left(\frac4{10}\right)^2=\frac{30}{100}-\frac{16}{100}=\frac{14}{100},

var(X+Y)=var(X)+var(Y)+2cov(X,Y)=410⋅610+410⋅610+2⋅14100=24+24+28100=76100.\mathrm{var}(X+Y)=\mathrm{var}(X)+\mathrm{var}(Y)+2\mathrm{cov}(X,Y)=\frac4{10}\cdot\frac6{10}+\frac4{10}\cdot\frac6{10}+2\cdot\frac{14}{100}=\frac{24+24+28}{100}=\frac{76}{100}.

(This is the computation announced in Covariance and CorrelationThe variance of a sum X + Y equals var(X) + var(Y) + 2 cov(X,Y), where the covariance E((X - E(X))(Y - E(Y))) cannot be computed from the two marginal laws alone, which motivates the study of random vectors and joint behaviour.Covariance and Correlation →.)

Extension to Rn\mathbb{R}^n

An nn-dimensional discrete random vector V=(X1,…,Xn)V=(X_1,\dots,X_n) is characterized probabilistically by its discrete joint density, with

pX1…Xn(x1,…,xn)≥0,∑x1,…,xnpX1…Xn(x1,…,xn)=1.p_{X_1\dots X_n}(x_1,\dots,x_n)\ge0,\qquad\sum_{x_1,\dots,x_n}p_{X_1\dots X_n}(x_1,\dots,x_n)=1.

Marginals: ∑x1∈X1pX1…Xn(x1,x2,…,xn)=pX2…Xn(x2,…,xn)\displaystyle\sum_{x_1\in\mathcal{X}_1}p_{X_1\dots X_n}(x_1,x_2,\dots,x_n)=p_{X_2\dots X_n}(x_2,\dots,x_n), etc., but be careful: there are now many more possible marginals. For example, with n=3n=3, from pXYZ(xi,yj,zℓ)p_{XYZ}(x_i,y_j,z_\ell) one can find the marginals pX, pY, pZ, pXY, pXZ, pYZp_X,\ p_Y,\ p_Z,\ p_{XY},\ p_{XZ},\ p_{YZ}.

Example 2: expectation, covariance and density of Z=X+YZ=X+Y

The discrete random vector (X,Y)(X,Y) has density

X\YX\backslash Y 00 11 22
00 310\frac3{10} 00 110\frac1{10}
11 00 410\frac4{10} 00
22 110\frac1{10} 00 110\frac1{10}

a) Compute E(X)E(X), E(Y)E(Y), E(XY)E(XY), cov(X,Y)\mathrm{cov}(X,Y). b) Compute the density of Z=X+YZ=X+Y.

a) The marginals are pX(0)=310+110=410p_X(0)=\frac3{10}+\frac1{10}=\frac4{10}, pX(1)=410p_X(1)=\frac4{10}, pX(2)=210p_X(2)=\frac2{10}, and the same for YY: pY(0)=410p_Y(0)=\frac4{10}, pY(1)=410p_Y(1)=\frac4{10}, pY(2)=210p_Y(2)=\frac2{10}.

Warning: the fact that pXp_X and pYp_Y are identical is a coincidence.

E(X)=0⋅410+1⋅410+2⋅210=810,E(Y)=810.E(X)=0\cdot\tfrac4{10}+1\cdot\tfrac4{10}+2\cdot\tfrac2{10}=\tfrac8{10},\qquad E(Y)=\tfrac8{10}.

Flag (arithmetic slip in the source page). The handwritten page writes the result of this sum as 610\frac6{10} and then uses it, obtaining cov(X,Y)=44100\mathrm{cov}(X,Y)=\frac{44}{100}. The sum 0+410+4100+\frac4{10}+\frac4{10} is 810\frac8{10}; the value used here is the corrected one. A check: E(Z)=2⋅610+4⋅110=1610=E(X)+E(Y)E(Z)=2\cdot\frac6{10}+4\cdot\frac1{10}=\frac{16}{10}=E(X)+E(Y) with 810\frac8{10} each.

E(XY)=∑xiyjpXY(xi,yj)=1⋅1⋅410+2⋅2⋅110=810E(XY)=\sum x_iy_jp_{XY}(x_i,y_j)=1\cdot1\cdot\tfrac4{10}+2\cdot2\cdot\tfrac1{10}=\tfrac8{10}

(all other terms vanish because either xiyj=0x_iy_j=0 or pXY=0p_{XY}=0), and

cov(X,Y)=E(XY)−E(X)E(Y)=810−810⋅810=16100\mathrm{cov}(X,Y)=E(XY)-E(X)E(Y)=\frac8{10}-\frac8{10}\cdot\frac8{10}=\frac{16}{100}

(with the page's value E(X)=E(Y)=610E(X)=E(Y)=\frac6{10} one would get 44100\frac{44}{100}).

b) In general, if Z=g(X,Y)Z=g(X,Y) and Z\mathcal{Z} is the alphabet of ZZ, the discrete density of ZZ is

pZ(zℓ)=∑xi,yjg(xi,yj)=zℓpXY(xi,yj).p_Z(z_\ell)=\sum_{\substack{x_i,y_j\\ g(x_i,y_j)=z_\ell}}p_{XY}(x_i,y_j).

The computation can be organized by writing, in each cell of the table, the value of Z=X+YZ=X+Y in the upper left corner:

X\YX\backslash Y 00 11 22
00 z=0z=0: 310\frac3{10} z=1z=1: 00 z=2z=2: 110\frac1{10}
11 z=1z=1: 00 z=2z=2: 410\frac4{10} z=3z=3: 00
22 z=2z=2: 110\frac1{10} z=3z=3: 00 z=4z=4: 110\frac1{10}

pZ(0)=310,pZ(1)=0+0=0,pZ(2)=110+410+110=610,pZ(3)=0,pZ(4)=110.p_Z(0)=\tfrac3{10},\quad p_Z(1)=0+0=0,\quad p_Z(2)=\tfrac1{10}+\tfrac4{10}+\tfrac1{10}=\tfrac6{10},\quad p_Z(3)=0,\quad p_Z(4)=\tfrac1{10}.

Versione ripasso

Definition. V:Ω→RnV:\Omega\to\mathbb{R}^n, V=(X1,…,Xn)V=(X_1,\dots,X_n), discrete set of values V\mathcal{V}. Its alphabet is in general strictly inside X×Y\mathcal{X}\times\mathcal{Y} (e.g. (min⁡(i,j),j)(\min(i,j),j) for two 4-face dice has X≤YX\le Y).

Joint discrete density. pXY(xi,yj)=P(X=xi,Y=yj)p_{XY}(x_i,y_j)=P(X=x_i,Y=y_j), with ≥0\ge0 and ∑∑pXY=1\sum\sum p_{XY}=1; zero outside the alphabet.

Marginals. ∑yjpXY(xi,yj)=pX(xi)\sum_{y_j}p_{XY}(x_i,y_j)=p_X(x_i), ∑xipXY(xi,yj)=pY(yj)\sum_{x_i}p_{XY}(x_i,y_j)=p_Y(y_j) (proof: ⋃yj[Y=yj]=Ω\bigcup_{y_j}[Y=y_j]=\Omega). Marginals do not determine the joint: infinitely many joints share the same marginals (∣X∣+∣Y∣−2|\mathcal{X}|+|\mathcal{Y}|-2 equations, ∣X∣∣Y∣−1|\mathcal{X}||\mathcal{Y}|-1 unknowns). For nn variables there are many marginals (for n=3n=3: pX,pY,pZ,pXY,pXZ,pYZp_X,p_Y,p_Z,p_{XY},p_{XZ},p_{YZ}).

Expectation of g(X,Y)g(X,Y). E(g(X,Y))=∑g(xi,yj)pXY(xi,yj)E(g(X,Y))=\sum g(x_i,y_j)p_{XY}(x_i,y_j).

  • g=x+yg=x+y: E(X+Y)=E(X)+E(Y)E(X+Y)=E(X)+E(Y) (use marginals).
  • g=xyg=xy: E(XY)=∑xiyjpXY(xi,yj)E(XY)=\sum x_iy_jp_{XY}(x_i,y_j).

Density of Z=g(X,Y)Z=g(X,Y). pZ(zℓ)=∑g(xi,yj)=zℓpXY(xi,yj)p_Z(z_\ell)=\sum_{g(x_i,y_j)=z_\ell}p_{XY}(x_i,y_j); write zz in each cell of the table and add the probabilities with the same zz.

Worked results. X,Y∼b(0.4)X,Y\sim b(0.4) with pXY(1,1)=310p_{XY}(1,1)=\frac3{10}: E(XY)=310E(XY)=\frac3{10}, cov=14100\mathrm{cov}=\frac{14}{100}, var(X+Y)=76100\mathrm{var}(X+Y)=\frac{76}{100}. The 3×33\times3 example: E(X)=E(Y)=810E(X)=E(Y)=\frac8{10}, E(XY)=810E(XY)=\frac8{10}, cov=16100\mathrm{cov}=\frac{16}{100} (source page has 610\frac6{10} and 44100\frac{44}{100} by a slip); pZ=(310,0,610,0,110)p_Z=(\frac3{10},0,\frac6{10},0,\frac1{10}) on z=0,…,4z=0,\dots,4.

Typical mistakes. Computing E(XY)E(XY) from the marginals only; equal marginals do not mean equal joint structure (identical pX,pYp_X,p_Y is a coincidence); forgetting that cells with pXY=0p_{XY}=0 still belong to the grid; assuming the alphabet is the full product X×Y\mathcal{X}\times\mathcal{Y}.

Teoria collegata