20.03.2013 Views

From Algorithms to Z-Scores - matloff - University of California, Davis

From Algorithms to Z-Scores - matloff - University of California, Davis

From Algorithms to Z-Scores - matloff - University of California, Davis

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.3. MATRIX FORMULATIONS 143<br />

important.<br />

Suppose we roll a die 50 times. Let X denote the number <strong>of</strong> rolls in which we get one dot, and let<br />

Y be the number <strong>of</strong> times we get either two or three dots. For convenience, let’s also define Z <strong>to</strong><br />

be the number <strong>of</strong> times we get four or more dots, though our focus will be on X and Y. Suppose<br />

also that we win $5 for each roll <strong>of</strong> a one, and $2 for each roll <strong>of</strong> a two or three.<br />

Let’s find the approximate values <strong>of</strong> the following:<br />

• P (X ≤ 12 and Y ≤ 16)<br />

• P(win more than $90)<br />

• P (X > Y > Z)<br />

The exact probabilities could, in principle, be calculated. But that would be rather cumbersome.<br />

But as will be shown in Section 8.5.2, the triple (X,Y,Z) has an approximate multivariate normal<br />

distribution. The latter is a generalization <strong>of</strong> the normal distribution, again covered in that section,<br />

but all we need <strong>to</strong> know here is that:<br />

(a) If a random vec<strong>to</strong>r W has a multivariate normal distribution, and A is a constant matrix,<br />

then the new random vec<strong>to</strong>r AW is also multivariate normally distributed.<br />

(b) R provides functions that compute probabilities involving this family <strong>of</strong> distributions.<br />

Just as the univariate normal family is parameterized by the mean and variance, the multivariate<br />

normal family has as its parameters the mean vec<strong>to</strong>r and the covariance matrix.<br />

We’ll <strong>of</strong> course need <strong>to</strong> know the mean vec<strong>to</strong>r and covariance matrix <strong>of</strong> the random vec<strong>to</strong>r (X, Y, Z) ′ .<br />

Once again, this will be shown later (using (8.100) and (8.113)), but for now take them on faith:<br />

and<br />

E[(X, Y, Z)] = (50/6, 50/3, 50/2) (7.59)<br />

⎛<br />

5/36 −1/18<br />

⎞<br />

−1/12<br />

Cov[(X, Y, Z)] = 50 ⎝−1/18<br />

2/9 −1/6 ⎠ (7.60)<br />

−1/12 −1/6 1/4<br />

We use the R function pmvnorm(), which computes probabilities <strong>of</strong> “rectangular” regions for<br />

multivariate normally distributed random vec<strong>to</strong>rs W. 1 The arguments we’ll use for this function<br />

here are:<br />

1 You must first load the mvtnorm library <strong>to</strong> use this function.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!