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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

144 CHAPTER 7. COVARIANCE AND RANDOM VECTORS<br />

• mean: the mean vec<strong>to</strong>r<br />

• sigma: the covariance matrix<br />

• lower, upper: bounds for a multidimensional “rectangular” region <strong>of</strong> interest<br />

Since a multivariate normal distribution is characterized by its mean vec<strong>to</strong>r and covariance matrix,<br />

the first two arguments above shouldn’t suprise you. But what about the other two?<br />

The function finds the probability <strong>of</strong> our random vec<strong>to</strong>r falling in<strong>to</strong> a multidimensional rectangular<br />

region that we specify, through the arguments are lower and upper. Note that these will typically<br />

be specified via R’s c() function, but default values are recycled versions <strong>of</strong> -Inf and Inf, built-in<br />

R constants for −∞ and ∞.<br />

An important special case is that in which we specify upper but allow lower <strong>to</strong> be the default<br />

values, yielding:<br />

just what we need <strong>to</strong> find P (X ≤ 12 and Y ≤ 16).<br />

P (W1 ≤ c1, ..., Wr ≤ cr) (7.61)<br />

To account for the integer nature <strong>of</strong> X and Y, we call the function with upper limits <strong>of</strong> 12.5 and 16.5,<br />

rather than 12 and 16, which is <strong>of</strong>ten used <strong>to</strong> get a better approximation. (Recall the “correction<br />

for continuity,” Section 5.5.2.9.) Our code is<br />

1 p1

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

Saved successfully!

Ooh no, something went wrong!