[IPSUR-commits] r145 - pkg/IPSUR/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 18 14:39:24 CET 2010


Author: gkerns
Date: 2010-01-18 14:39:24 +0100 (Mon, 18 Jan 2010)
New Revision: 145

Modified:
   pkg/IPSUR/inst/doc/IPSUR.Rnw
Log:
small fixes, mostly labels


Modified: pkg/IPSUR/inst/doc/IPSUR.Rnw
===================================================================
--- pkg/IPSUR/inst/doc/IPSUR.Rnw	2010-01-17 21:02:07 UTC (rev 144)
+++ pkg/IPSUR/inst/doc/IPSUR.Rnw	2010-01-18 13:39:24 UTC (rev 145)
@@ -428,7 +428,7 @@
 I want the students to be knee-deep in data right out of the gate.
 The second part is the study of \emph{probability}, which begins at
 the basics of sets and the equally likely model, journeys past discrete/continuous
-random variables and continues through to multivariate distributions.
+random variables, and continues through to multivariate distributions.
 The chapter on sampling distributions paves the way to the third part,
 which is \emph{inferential statistics}. This last part includes point
 and interval estimation, hypothesis testing, and finishes with introductions
@@ -440,12 +440,12 @@
 a lot of time on Data Description, Probability, Discrete, and Continuous
 Distributions. I mention selected facts from Multivariate Distributions
 in passing, and discuss the meaty parts of Sampling Distributions
-before moving right along to Estimation (which is another one I dwell
-on considerably). Hypothesis Testing goes faster after all of the
-previous work, and by that time the end of the semester is in sight.
-I normally choose one or two final chapters (sometimes three) from
-the remaining to survey, and regret at the end that I did not have
-the chance to cover more.
+before moving right along to Estimation (which is another chapter
+I dwell on considerably). Hypothesis Testing goes faster after all
+of the previous work, and by that time the end of the semester is
+in sight. I normally choose one or two final chapters (sometimes three)
+from the remaining to survey, and regret at the end that I did not
+have the chance to cover more.
 
 In an attempt to be correct I have included material in this book
 which I would normally not mention during the course of a standard
@@ -459,11 +459,11 @@
 which may be useful to them for many semesters to come. It also mirrors
 my own experience as a student.
 
-This document's ultimate goal is to be a more or less self contained,
-essentially complete, correct, introductory textbook. There should
-be plenty of exercises for the student, with full solutions for some
-and no solutions for others (so that the instructor may assign them
-for grading). By \inputencoding{latin9}\lstinline[showstringspaces=false]!Sweave!\inputencoding{utf8}'s
+The vision for this document is a more or less self contained, essentially
+complete, correct, introductory textbook. There should be plenty of
+exercises for the student, with full solutions for some, and no solutions
+for others (so that the instructor may assign them for grading). By
+\inputencoding{latin9}\lstinline[showstringspaces=false]!Sweave!\inputencoding{utf8}'s
 dynamic nature it is possible to write randomly generated exercises
 and I had planned to implement this idea already throughout the book.
 Alas, there are only 24 hours in a day. Look for more in future editions.
@@ -491,7 +491,7 @@
 to Probability and Statistics Using \textsf{R}'', and not {}``Introduction
 to \textsf{R} Using Probability and Statistics'', nor even {}``Introduction
 to Probability and Statistics and \textsf{R} Using Words''. The people
-at the party are probability and statistics; the handshake is \textsf{R}.
+at the party are Probability and Statistics; the handshake is \textsf{R}.
 There are several important topics about \textsf{R} which some individuals
 will feel are underdeveloped, glossed over, or wantonly omitted. Some
 will feel the same way about the probabilistic and/or statistical
@@ -499,13 +499,13 @@
 all of the mathematics.
 
 Despite any misgivings: here it is, warts and all. I humbly invite
-said individuals to take this book, with the GNU-FDL in hand, and
-make it better. In that spirit there are at least a few ways in my
-view in which this book could be improved.
+said individuals to take this book, with the GNU Free Documentation
+License (GNU-FDL) in hand, and make it better. In that spirit there
+are at least a few ways in my view in which this book could be improved.
 \begin{description}
-\item [{Better~data:}] the data analyzed in this book are almost entirely
+\item [{Better~data.}] The data analyzed in this book are almost entirely
 from the \inputencoding{latin9}\lstinline[showstringspaces=false]!datasets!\inputencoding{utf8}
-package in base \textsf{R}, and here is why: 
+package in base \textsf{R}, and here is why:
 
 \begin{enumerate}
 \item I made a conscious effort to minimize dependence on contributed packages,
@@ -524,10 +524,11 @@
 in \emph{every} example. One day I hope to stumble over said time.
 In the meantime, I will add new data sets incrementally as time permits.
 
-\item [{More~proofs:}] for the sake of completeness (I understand that
-some people would not consider more proofs to be improvement). Many
-proofs have been skipped entirely, and am not aware of any rhyme or
-reason to the current omissions. I will add more when I get a chance. 
+\item [{More~proofs.}] I would like to include more proofs for the sake
+of completeness (I understand that some people would not consider
+more proofs to be improvement). Many proofs have been skipped entirely,
+and I am not aware of any rhyme or reason to the current omissions.
+I will add more when I get a chance. 
 \item [{More~and~better~graphics:}] I have not used the \inputencoding{latin9}\lstinline[basicstyle={\ttfamily},breaklines=true,language=R]!ggplot2!\inputencoding{utf8}
 package \cite{Wickam2009} because I do not know how to use it yet.
 It is on my to-do list.
@@ -556,9 +557,9 @@
 
 The \emph{Document} is that which you are reading right now -- \IPSUR's
 \emph{raison d'\^etre}. There are transparent copies (nonproprietary
-text files) and opaque copies (everything else). See the GNU Free
-Documentation License (GNU-FDL) in Appendix \ref{cha:GNU-Free-Documentation}
-for more precise language and details.
+text files) and opaque copies (everything else). See the GNU-FDL in
+Appendix \ref{cha:GNU-Free-Documentation} for more precise language
+and details.
 \begin{description}
 \item [{\texttt{IPSUR.tex}}] is a transparent copy of the Document to be
 typeset with a \LaTeX{} distribution such as Mik\TeX{} or \TeX{} Live.
@@ -4320,7 +4321,8 @@
 outcomes are equally likely and then use \inputencoding{latin9}\lstinline[showstringspaces=false]!probspace!\inputencoding{utf8}
 to assign the model.
 \begin{example}
-An unbalanced coin. While the \inputencoding{latin9}\lstinline[showstringspaces=false]!makespace!\inputencoding{utf8}
+\label{exa:unbalanced-coin}\textbf{An unbalanced coin.} While the
+\inputencoding{latin9}\lstinline[showstringspaces=false]!makespace!\inputencoding{utf8}
 argument to \inputencoding{latin9}\lstinline[showstringspaces=false]!tosscoin!\inputencoding{utf8}
 is useful to represent the tossing of a \emph{fair} coin, it is not
 always appropriate. For example, suppose our coin is not perfectly
@@ -4366,15 +4368,16 @@
 the probability of $A$. Any probability function $\P$ satisfies
 the following three Kolmogorov Axioms:
 \begin{ax}
-$\P(A)\geq0$ for any event $A\subset S$.
+\label{ax:prob-nonnegative}$\P(A)\geq0$ for any event $A\subset S$.
 \end{ax}
 
 \begin{ax}
-$\P(S)=1$.
+\label{ax:total-mass-one}$\P(S)=1$.
 \end{ax}
 
 \begin{ax}
-If the events $A_{1}$, $A_{2}$, $A_{3}$\ldots{} are disjoint then\begin{equation}
+\label{ax:countable-additivity}If the events $A_{1}$, $A_{2}$,
+$A_{3}$\ldots{} are disjoint then\begin{equation}
 \P\left(\bigcup_{i=1}^{n}A_{i}\right)=\sum_{i=1}^{n}\P(A_{i})\mbox{ for every }n,\end{equation}
 and furthermore,\begin{equation}
 \P\left(\bigcup_{i=1}^{\infty}A_{i}\right)=\sum_{i=1}^{\infty}\P(A_{i}).\end{equation}
@@ -4417,11 +4420,11 @@
 \item $0\leq\P(A)\leq1$.
 
 \begin{proof}
-The left inequality is immediate from Axiom 1, and the second inequality
-follows from Property 5 since $A\subset S$.
+The left inequality is immediate from Axiom \ref{ax:prob-nonnegative},
+and the second inequality follows from Property 3 since $A\subset S$.
 \end{proof}
 \item \textbf{\emph{The General Addition Rule.}}\begin{equation}
-\P(A\cup B)=\P(A)+\P(B)-\P(A\cap B).\end{equation}
+\P(A\cup B)=\P(A)+\P(B)-\P(A\cap B).\label{eq:general-addition-rule-1}\end{equation}
 
 
 
@@ -4432,7 +4435,7 @@
 
 \item \textbf{\emph{The Theorem of Total Probability.}} Let $B_{1}$, $B_{2}$,
 \ldots{}, $B_{n}$ be mutually exclusive and exhaustive. Then\begin{equation}
-\P(A)=\P(A\cap B_{1})+\P(A\cap B_{2})+\cdots+\P(A\cap B_{n}).\end{equation}
+\P(A)=\P(A\cap B_{1})+\P(A\cap B_{2})+\cdots+\P(A\cap B_{n}).\label{eq:theorem-total-probability}\end{equation}
 
 \end{enumerate}
 
@@ -4484,9 +4487,9 @@
 \end{example}
 
 \begin{example}
-Imagine a three child family, each child being either Boy ($B$) or
-Girl ($G$). An example sequence of siblings would be $BGB$. The
-sample space may be written\[
+\label{exa:three-child-family}Imagine a three child family, each
+child being either Boy ($B$) or Girl ($G$). An example sequence
+of siblings would be $BGB$. The sample space may be written\[
 S=\left\{ \begin{array}{cccc}
 BBB, & BGB, & GBB, & GGB,\\
 BBG, & BGG, & GBG, & GGG\end{array}\right\} .\]
@@ -4895,7 +4898,7 @@
 and so forth. The total number of possible birthday sequences is therefore
 $\#(S)=365^{n}$.
 
-Now we will use the complementation trick we saw in Example BLANK.
+Now we will use the complementation trick we saw in Example \ref{exa:three-child-family}.
 We realize that the only situation in which $A$ does \emph{not} occur
 is if there are \emph{no} matches among all people in the room, that
 is, only when everybody's birthday is different, so\[
@@ -5133,10 +5136,10 @@
 \item If $B\subset C$ then $\P(B|A)\leq\P(C|A)$.
 \item $\P[(B\cup C)|A]=\P(B|A)+\P(C|A)-\P[(B\cap C|A)].$
 \item \textbf{The Multiplication Rule.} For any two events $A$ and $B$,\begin{equation}
-\P(A\cap B)=\P(A)\P(B|A).\end{equation}
+\P(A\cap B)=\P(A)\P(B|A).\label{eq:multiplication-rule-short}\end{equation}
 And more generally, for events $A_{1}$, $A_{2}$, $A_{3}$,\ldots{},
 $A_{n}$,\begin{equation}
-\P(A_{1}\cap A_{2}\cap\cdots\cap A_{n})=\P(A_{1})\P(A_{2}|A_{1})\cdots\P(A_{n}|A_{1}\cap A_{2}\cap\cdots\cap A_{n-1}).\end{equation}
+\P(A_{1}\cap A_{2}\cap\cdots\cap A_{n})=\P(A_{1})\P(A_{2}|A_{1})\cdots\P(A_{n}|A_{1}\cap A_{2}\cap\cdots\cap A_{n-1}).\label{eq:multiplication-rule-long}\end{equation}
 
 \end{enumerate}
 \end{prop}
@@ -5146,16 +5149,17 @@
 find probabilities in random experiments that have a sequential structure,
 as the next example shows.
 \begin{example}
-At the beginning of the section we drew two cards from a standard
-playing deck. Now we may answer our original question, what is $\P(\mbox{both Aces})$?\[
+\label{exa:two-cards-both-aces}At the beginning of the section we
+drew two cards from a standard playing deck. Now we may answer our
+original question, what is $\P(\mbox{both Aces})$?\[
 \P(\mbox{both Aces})=\P(A\cap B)=\P(A)\P(B|A)=\frac{4}{52}\cdot\frac{3}{51}\approx0.00452.\]
 
 \end{example}
 
 \subsection{How to do it with \textsf{R\label{sub:howto-ps-objects}}}
 
-Continuing Example BLANK, we set up the probability space by way of
-a three step process. First we employ the \inputencoding{latin9}\lstinline[showstringspaces=false]!cards!\inputencoding{utf8}
+Continuing Example \ref{exa:two-cards-both-aces}, we set up the probability
+space by way of a three step process. First we employ the \inputencoding{latin9}\lstinline[showstringspaces=false]!cards!\inputencoding{utf8}
 function to get a data frame \inputencoding{latin9}\lstinline[showstringspaces=false]!L!\inputencoding{utf8}
 with two columns: \inputencoding{latin9}\lstinline[showstringspaces=false]!rank!\inputencoding{utf8}
 and \inputencoding{latin9}\lstinline[showstringspaces=false]!suit!\inputencoding{utf8}.
@@ -5209,14 +5213,15 @@
 prob(N, all(rank == "A"))
 @
 
-Note that this value matches what we found in Example BLANK, above.
-We could calculate all sorts of probabilities at this point; we are
-limited only by the complexity of the event's computer representation. 
+Note that this value matches what we found in Example \ref{exa:two-cards-both-aces},
+above. We could calculate all sorts of probabilities at this point;
+we are limited only by the complexity of the event's computer representation. 
 
 
 \begin{example}
-Consider an urn with 10 balls inside, 7 of which are red and 3 of
-which are green. Select 3 balls successively from the urn. Let $A=\left\{ 1^{\text{st}}\mbox{ ball is red}\right\} $,
+\label{exa:urn-7-red-3-green}Consider an urn with 10 balls inside,
+7 of which are red and 3 of which are green. Select 3 balls successively
+from the urn. Let $A=\left\{ 1^{\text{st}}\mbox{ ball is red}\right\} $,
 $B=\left\{ 2^{\text{nd}}\mbox{ ball is red}\right\} $, and $C=\left\{ 3^{\text{rd}}\mbox{ ball is red}\right\} $.
 Then\[
 \P(\mbox{all 3 balls are red})=\P(A\cap B\cap C)=\frac{7}{10}\cdot\frac{6}{9}\cdot\frac{5}{8}\approx0.2917.\]
@@ -5225,8 +5230,8 @@
 
 \subsection{How to do it with \textsf{R}}
 
-Example BLANK is similar to Example BLANK, but it is even easier.
-We need to set up an urn (vector \inputencoding{latin9}\lstinline[showstringspaces=false]!L!\inputencoding{utf8})
+Example \ref{exa:urn-7-red-3-green} is similar to Example \ref{exa:two-cards-both-aces},
+but it is even easier. We need to set up an urn (vector \inputencoding{latin9}\lstinline[showstringspaces=false]!L!\inputencoding{utf8})
 to hold the balls, we sample from \inputencoding{latin9}\lstinline[showstringspaces=false]!L!\inputencoding{utf8}
 to get the sample space (data frame \inputencoding{latin9}\lstinline[showstringspaces=false]!M!\inputencoding{utf8}),
 and we associate a probability vector (column \inputencoding{latin9}\lstinline[showstringspaces=false]!probs!\inputencoding{utf8})
@@ -5264,8 +5269,8 @@
 prob(N, isrep(N, "red", 3))
 @
 
-Note that this answer matches what we found in Example BLANK. Now
-let us try some other probability questions. What is the probability
+Note that this answer matches what we found in Example \ref{exa:urn-7-red-3-green}.
+Now let us try some other probability questions. What is the probability
 of getting two \inputencoding{latin9}\lstinline[showstringspaces=false]!"red"!\inputencoding{utf8}s?
 
 <<>>=
@@ -5393,7 +5398,8 @@
 Suppose that $A$ and $B$ are independent. We will show the second
 one; the others are similar. We need to show that\[
 \P(A^{c}\cap B)=\P(A^{c})\P(B).\]
-To this end, note that the Multiplication Rule BLANK implies \begin{eqnarray*}
+To this end, note that the Multiplication Rule, Equation \ref{eq:multiplication-rule-short}
+implies \begin{eqnarray*}
 \P(A^{c}\cap B) & = & \P(B)\P(A^{c}|B),\\
  & = & \P(B)[1-\P(A|B)],\\
  & = & \P(B)\P(A^{c}).\end{eqnarray*}
@@ -5415,14 +5421,14 @@
 will be mutually independent only if they satisfy the product equality
 pairwise, then in groups of three, in groups of four, and so forth,
 up to all $n$ events at once. For $n$ events, there will be $2^{n}-n-1$
-equations that must be satisfied (see Exercise BLANK). Although these
-requirements for a set of events to be mutually independent may seem
-stringent, the good news is that for most of the situations considered
-in this book the conditions will all be met (or at least we will suppose
-that they are).
+equations that must be satisfied (see Exercise \ref{xca:numb-cond-indep}).
+Although these requirements for a set of events to be mutually independent
+may seem stringent, the good news is that for most of the situations
+considered in this book the conditions will all be met (or at least
+we will suppose that they are).
 \begin{example}
-Toss ten coins. What is the probability of observing at least one
-Head? Answer: Let $A_{i}=\left\{ \mbox{the }i^{\text{th}}\mbox{ coin shows }H\right\} ,\ i=1,2,\ldots,10$.
+\label{exa:toss-ten-coins}Toss ten coins. What is the probability
+of observing at least one Head? Answer: Let $A_{i}=\left\{ \mbox{the }i^{\text{th}}\mbox{ coin shows }H\right\} ,\ i=1,2,\ldots,10$.
 Supposing that we toss the coins in such a way that they do not interfere
 with each other, this is one of the situations where all of the $A_{i}$
 may be considered mutually independent due to the nature of the tossing.
@@ -5446,7 +5452,7 @@
 1 - prob(A)
 @
 
-Compare this answer to what we got in Example BLANK.
+Compare this answer to what we got in Example \ref{exa:toss-ten-coins}.
 
 \end{example}
 
@@ -5468,14 +5474,15 @@
 
 
 \begin{example}
-An unbalanced coin (continued, see Example BLANK). It was easy enough
-to set up the probability space for one unbalanced toss, however,
-the situation becomes more complicated when there are many tosses
-involved. Clearly, the outcome $HHH$ should not have the same probability
-as $TTT$, which should again not have the same probability as $HTH$.
-At the same time, there is symmetry in the experiment in that the
-coin does not remember the face it shows from toss to toss, and it
-is easy enough to toss the coin in a similar way repeatedly.
+\textbf{An unbalanced coin} (continued, see Example \ref{exa:unbalanced-coin}).
+It was easy enough to set up the probability space for one unbalanced
+toss, however, the situation becomes more complicated when there are
+many tosses involved. Clearly, the outcome $HHH$ should not have
+the same probability as $TTT$, which should again not have the same
+probability as $HTH$. At the same time, there is symmetry in the
+experiment in that the coin does not remember the face it shows from
+toss to toss, and it is easy enough to toss the coin in a similar
+way repeatedly.
 
 We may represent tossing our unbalanced coin three times with the
 following: 
@@ -5521,8 +5528,8 @@
 Since $\P(A)>0$ we may divide through to obtain \[
 \P(B_{k}|A)=\frac{\P(B_{k})\P(A|B_{k})}{\P(A)}.\]
 Now remembering that $\left\{ B_{k}\right\} $ is a partition, the
-Theorem of Total Probability BLANK gives the denominator of the last
-expression to be\[
+Theorem of Total Probability (Equation \ref{eq:theorem-total-probability})
+gives the denominator of the last expression to be\[
 \P(A)=\sum_{k=1}^{n}\P(B_{k}\cap A)=\sum_{k=1}^{n}\P(B_{k})\P(A|B_{k}).\]
 
 \end{proof}
@@ -5532,10 +5539,11 @@
 how do we \textbf{update} $\P(B_{k})$ to $\P(B_{k}|A)$? The answer:
 Bayes' Rule.
 \begin{example}
-\emph{Misfiling Assistants}. In this problem, there are three assistants
-working at a company: Moe, Larry, and Curly. Their primary job duty
-is to file paperwork in the filing cabinet when papers become available.
-The three assistants have different work schedules:
+\textbf{\label{exa:misfiling-assistants}Misfiling Assistants}\textbf{\emph{.}}
+In this problem, there are three assistants working at a company:
+Moe, Larry, and Curly. Their primary job duty is to file paperwork
+in the filing cabinet when papers become available. The three assistants
+have different work schedules:
 
 %
 \begin{table}[H]
@@ -5633,7 +5641,7 @@
 that if a file is misplaced, then either Moe or Larry or Curly must
 have filed it; there is no one else around to do the misfiling. Further,
 these possibilities are mutually exclusive. We may use the Theorem
-of Total Probability BLANK to write\[
+of Total Probability \ref{eq:theorem-total-probability} to write\[
 \P(A)=\P(A\cap M)+\P(A\cap L)+\P(A\cap C).\]
 Luckily, we have computed these above. Thus\[
 \P(A)=0.0018+0.0021+0.0010=0.0049.\]
@@ -5662,14 +5670,15 @@
 \end{example}
 
 \begin{example}
-Suppose the boss gets a change of heart and does not fire anybody.
-But the next day (s)he randomly selects another file and again finds
-it to be misplaced. To decide whom to fire now, the boss would use
-the same procedure, with one small change. (S)he would not use the
-prior probabilities $ $60\%, 30\%, and 10\%; those are old news.
-Instead, she would replace the prior probabilities with the posterior
-probabilities just calculated. After the math she will have new posterior
-probabilities, updated even more from the day before.
+\label{exa:misfiling-assistants-multiple}Suppose the boss gets a
+change of heart and does not fire anybody. But the next day (s)he
+randomly selects another file and again finds it to be misplaced.
+To decide whom to fire now, the boss would use the same procedure,
+with one small change. (S)he would not use the prior probabilities
+$ $60\%, 30\%, and 10\%; those are old news. Instead, she would replace
+the prior probabilities with the posterior probabilities just calculated.
+After the math she will have new posterior probabilities, updated
+even more from the day before.
 
 In this way, probabilities found by Bayes' rule are always on the
 cutting edge, always updated with respect to the best information
@@ -5682,8 +5691,9 @@
 package, but problems like the ones above are easy enough to do by
 hand.
 \begin{example}
-Misfiling assistants (continued, see Example BLANK). We store the
-prior probabilities and the likelihoods in vectors and go to town.
+\textbf{Misfiling assistants} (continued from Example \ref{exa:misfiling-assistants}).
+We store the prior probabilities and the likelihoods in vectors and
+go to town.
 
 <<>>=
 prior <- c(0.6, 0.3, 0.1)
@@ -5695,8 +5705,8 @@
 \end{example}
 
 
-Compare these answers with what we got in Example BLANK. We would
-replace \inputencoding{latin9}\lstinline[showstringspaces=false]!prior!\inputencoding{utf8}
+Compare these answers with what we got in Example \ref{exa:misfiling-assistants}.
+We would replace \inputencoding{latin9}\lstinline[showstringspaces=false]!prior!\inputencoding{utf8}
 with \inputencoding{latin9}\lstinline[showstringspaces=false]!post!\inputencoding{utf8}
 in a future calculation. We could raise \inputencoding{latin9}\lstinline[showstringspaces=false]!like!\inputencoding{utf8}
 to a power to see how the posterior is affected by future document
@@ -5738,7 +5748,7 @@
 fastpost / sum(fastpost)
 @
 
-Compare this to what we got in Example BLANK.
+Compare this to what we got in Example \ref{exa:misfiling-assistants-multiple}.
 
 
 
@@ -5925,10 +5935,10 @@
 rnorm(1)
 @
 \begin{xca}
-Prove the assertion of Example BLANK. The number of conditions that
-the events $A_{1}$, $A_{2}$, \ldots{}, $A_{n}$ must satisfy in
-order to be mutually independent is $2^{n}-n-1$. (\emph{Hint}: think
-about Pascal's triangle.)
+\label{xca:numb-cond-indep}Prove the assertion given in the text:
+the number of conditions that the events $A_{1}$, $A_{2}$, \ldots{},
+$A_{n}$ must satisfy in order to be mutually independent is $2^{n}-n-1$.
+(\emph{Hint}: think about Pascal's triangle.)
 \end{xca}
 
 \paragraph*{Answer:}
@@ -6493,17 +6503,18 @@
 In this notation the variance is $\sigma^{2}=\E(X-\mu)^{2}$ and we
 prove the identity \begin{equation}
 \E(X-\mu)^{2}=\E X^{2}-(\E X)^{2}\end{equation}
-in Exercise BLANK. Intuitively, for repeated observations of $X$
-we would expect the sample mean of the $g(X)$ values to closely approximate
-$\E\, g(X)$ as the sample size increases without bound.
+in Exercise \ref{xca:variance-shortcut}. Intuitively, for repeated
+observations of $X$ we would expect the sample mean of the $g(X)$
+values to closely approximate $\E\, g(X)$ as the sample size increases
+without bound.
 
 Let us take the analogy further. If we expect $g(X)$ to be close
 to $\E g(X)$ on the average, where would we expect $3g(X)$ to be
 on the average? It could only be $3\E g(X)$. The following theorem
 makes this idea precise.
-\begin{thm}
-For any functions $g$ and $h$, any random variable $X$, and any
-constant $c$: 
+\begin{prop}
+\label{pro:expectation-properties}For any functions $g$ and $h$,
+any random variable $X$, and any constant $c$: 
 \begin{enumerate}
 \item $\E\: c=c$,
 \item $\E[c\cdot g(X)]=c\E g(X)$
@@ -6511,7 +6522,7 @@
 \end{enumerate}
 provided $\E g(X)$ and $\E h(X)$ exist.
 
-\end{thm}
+\end{prop}
 \begin{proof}
 Go directly from the definition. For example,\[
 \E[c\cdot g(X)]=\sum_{x\in S}c\cdot g(x)f_{X}(x)=c\cdot\sum_{x\in S}g(x)f_{X}(x)=c\E g(X).\]
@@ -8652,7 +8663,7 @@
 observed \emph{pairs} $(x,y)$, called the \emph{joint support set}
 of $X$ and $Y$. Then the \emph{joint probability mass function}
 of $X$ and $Y$ is the function $f_{X,Y}$ defined by\begin{equation}
-f_{X,Y}(x,y)=\P(X=x,\, Y=y),\quad\mbox{for }(x,y)\in S_{X,Y}.\end{equation}
+f_{X,Y}(x,y)=\P(X=x,\, Y=y),\quad\mbox{for }(x,y)\in S_{X,Y}.\label{eq:joint-pmf}\end{equation}
 Every joint PMF satisfies\begin{equation}
 f_{X,Y}(x,y)>0\mbox{ for all }(x,y)\in S_{X,Y},\end{equation}
 and\begin{equation}
@@ -8663,12 +8674,13 @@
 In the context of this chapter, the PMFs $f_{X}$ and $f_{Y}$ are
 called the \emph{marginal PMFs} of $X$ and $Y$, respectively. If
 we are given only the joint PMF then we may recover each of the marginal
-PMFs by using the Theorem of Total Probability (see BLANK): observe\begin{eqnarray}
+PMFs by using the Theorem of Total Probability (see Equation\ref{eq:theorem-total-probability}):
+observe\begin{eqnarray}
 f_{X}(x) & = & \P(X=x),\\
  & = & \sum_{y\in S_{Y}}\P(X=x,\, Y=y),\\
  & = & \sum_{y\in S_{Y}}f_{X,Y}(x,y).\end{eqnarray}
 By interchanging the roles of $X$ and $Y$ it is clear that \begin{equation}
-f_{Y}(y)=\sum_{x\in S_{Y}}f_{X,Y}(x,y).\end{equation}
+f_{Y}(y)=\sum_{x\in S_{Y}}f_{X,Y}(x,y).\label{eq:marginal-pmf}\end{equation}
 Given the joint PMF we may recover the marginal PMFs, but the converse
 is not true. Even if we have \emph{both} marginal distributions they
 are not sufficient to determine the joint PMF; more information is
@@ -8683,17 +8695,18 @@
 F_{X,Y}(x,y)=\P(X\leq x,\, Y\leq y),\quad\mbox{for }(x,y)\in\R^{2}.\]
 The bivariate joint CDF is not quite as tractable as the univariate
 CDFs, but in principle we could calculate it by adding up quantities
-of the form BLANK. The joint CDF is typically not used in practice
-due to its inconvenient form; one can usually get by with the joint
-PMF alone.
+of the form in Equation \ref{eq:joint-pmf}. The joint CDF is typically
+not used in practice due to its inconvenient form; one can usually
+get by with the joint PMF alone.
 
 We now introduce some examples of bivariate discrete distributions.
 The first we have seen before, and the second is based on the first.
 \begin{example}
-Roll a fair die twice. Let $X$ be the face shown on the first roll,
-and let $Y$ be the face shown on the second roll. We have already
-seen this example in Chapter \ref{cha:Probability}, Example BLANK.
-For this example, it suffices to define\[
+\label{exa:toss-two-dice-joint-pmf}Roll a fair die twice. Let $X$
+be the face shown on the first roll, and let $Y$ be the face shown
+on the second roll. We have already seen this example in Chapter \ref{cha:Probability},
+Example \ref{exa:Toss-a-six-sided-die-twice}. For this example, it
+suffices to define\[
 f_{X,Y}(x,y)=\frac{1}{36},\quad x=1,\ldots,6,\ y=1,\ldots,6.\]
 The marginal PMFs are given by $f_{X}(x)=1/6$, $x=1,2,\ldots,6$,
 and $f_{Y}(y)=1/6$, $y=1,2,\ldots,6$, since\[
@@ -8714,28 +8727,30 @@
 
 
 \begin{example}
-Let the random experiment again be to roll a fair die twice, except
-now let us define the random variables $U$ and $V$ by\begin{eqnarray*}
+\label{exa:max-sum-two-dice}Let the random experiment again be to
+roll a fair die twice, except now let us define the random variables
+$U$ and $V$ by\begin{eqnarray*}
 U & = & \mbox{the maximum of the two rolls, and }\\
 V & = & \mbox{the sum of the two rolls.}\end{eqnarray*}
 We see that the support of $U$ is $S_{U}=\left\{ 1,2,\ldots,6\right\} $
 and the support of $V$ is $S_{V}=\left\{ 2,3,\ldots,12\right\} $.
 We may represent the sample space with a matrix, and for each entry
 in the matrix we may calculate the value that $U$ assumes. The result
-is in the left half of Table BLANK. 
+is in the left half of Table \ref{tab:max-and-sum-two-dice}. 
 
 We can use the table to calculate the marginal PMF of $U$, because
-from Example BLANK we know that each entry in the matrix has probability
-$1/36$ associated with it. For instance, there is only one outcome
-in the matrix with $U=1$, namely, the top left corner. This single
-entry has probability $1/36$, therefore, it must be that $f_{U}(1)=\P(U=1)=1/36$.
-Similarly we see that there are three entries in the matrix with $U=2$,
-thus $f_{U}(2)=3/36$. Continuing in this fashion we will find the
-marginal distribution of $U$ may be written\begin{equation}
+from Example \ref{exa:Toss-a-six-sided-die-twice} we know that each
+entry in the matrix has probability $1/36$ associated with it. For
+instance, there is only one outcome in the matrix with $U=1$, namely,
+the top left corner. This single entry has probability $1/36$, therefore,
+it must be that $f_{U}(1)=\P(U=1)=1/36$. Similarly we see that there
+are three entries in the matrix with $U=2$, thus $f_{U}(2)=3/36$.
+Continuing in this fashion we will find the marginal distribution
+of $U$ may be written\begin{equation}
 f_{U}(u)=\frac{2u-1}{36},\quad u=1,\,2,\ldots,6.\end{equation}
 
 
-We may do a similar thing for $V$; see the right half of Table BLANK.
+We may do a similar thing for $V$; see the right half of Table \ref{tab:max-and-sum-two-dice}.
 Collecting all of the probability we will find that the marginal PMF
 of $V$ is\begin{equation}
 f_{V}(v)=\frac{6-|v-7|}{36},\quad v=2,\,3,\ldots,12.\end{equation}
@@ -8771,13 +8786,14 @@
 
 }\hfill{}
 
-\caption{Maximum $U$ and sum $V$ of a pair of dice rolls $(X,Y)$}
+\caption{Maximum $U$ and sum $V$ of a pair of dice rolls $(X,Y)$\label{tab:max-and-sum-two-dice}}
 
 \end{table}
 
 
-We may collapse the two matrices from Table BLANK into one, big matrix
-of pairs of values $(u,v)$. The result is shown in Table BLANK. 
+We may collapse the two matrices from Table \ref{tab:max-and-sum-two-dice}
+into one, big matrix of pairs of values $(u,v)$. The result is shown
+in Table \ref{tab:-max-sum-two-dice-joint}. 
 
 %
 \begin{table}
@@ -8794,7 +8810,7 @@
 \end{tabular}
 \par\end{centering}
 
-\caption{Joint values of $U=\max(X,Y)$ and $V=X+Y$}
+\caption{Joint values of $U=\max(X,Y)$ and $V=X+Y$\label{tab:-max-sum-two-dice-joint}}
 
 \end{table}
 
@@ -8805,7 +8821,7 @@
 appears twice, but $(2,3)$ appears only once. We can make more sense
 out of this by writing a new table with $U$ on one side and $V$
 along the top. We will accumulate the probability just like we did
-in Example BLANK. See Table BLANK.
+in Example \ref{exa:toss-two-dice-joint-pmf}. See Table \ref{tab:max-sum-joint-pmf}.
 
 %
 \begin{table}
@@ -8826,7 +8842,7 @@
 \end{tabular}
 \par\end{centering}
 
-\caption{The joint PMF of $(U,V)$ }
+\caption{The joint PMF of $(U,V)$\label{tab:max-sum-joint-pmf} }
 {\small The outcomes of $U$ are along the left and the outcomes of
 $V$ are along the top. Empty entries in the table have zero probability.
 The row totals (on the right) and column totals (on the bottom) correspond
@@ -8837,10 +8853,10 @@
 The joint support of $(U,V)$ is concentrated along the main diagonal;
 note that the nonzero entries do not form a rectangle. Also notice
 that if we form row and column totals we are doing exactly the same
-thing as Expression BLANK, so that the marginal distribution of $U$
-is the list of totals in the right {}``margin'' of the Table BLANK,
-and the marginal distribution of $V$ is the list of totals in the
-bottom {}``margin''.
+thing as Equation \ref{eq:marginal-pmf}, so that the marginal distribution
+of $U$ is the list of totals in the right {}``margin'' of the Table
+\ref{tab:max-sum-joint-pmf}, and the marginal distribution of $V$
+is the list of totals in the bottom {}``margin''.
 \end{example}
 Continuing the reasoning for the discrete case, given two continuous
 random variables $X$ and $Y$ there similarly exists%
@@ -8864,7 +8880,7 @@
 f_{Y}(y)=\int_{S_{X}}f_{X,Y}(x,y)\,\diff x,\quad y\in S_{Y}.\end{equation}
 
 \begin{example}
-Let the joint PDF of $(X,Y)$ be given by\[
+\label{exa:joint-pdf}Let the joint PDF of $(X,Y)$ be given by\[
 f_{X,Y}(x,y)=\frac{6}{5}\left(x+y^{2}\right),\quad0<x<1,\ 0<y<1.\]
 The marginal PDF of $X$ is\begin{eqnarray*}
 f_{X}(x) & = & \int_{0}^{1}\frac{6}{5}\left(x+y^{2}\right)\,\diff y,\\
@@ -8881,9 +8897,9 @@
 
 \subsection{How to do it with \textsf{R}}
 
-We will show how to do Example BLANK using \textsf{R}; it is much
-simpler to do it with \textsf{R} than without. First we set up the
-sample space with the \inputencoding{latin9}\lstinline[showstringspaces=false]!rolldie!\inputencoding{utf8}
+We will show how to do Example \ref{exa:max-sum-two-dice} using \textsf{R};
+it is much simpler to do it with \textsf{R} than without. First we
+set up the sample space with the \inputencoding{latin9}\lstinline[showstringspaces=false]!rolldie!\inputencoding{utf8}
 function. Next, we add random variables $U$ and $V$ with the \inputencoding{latin9}\lstinline[showstringspaces=false]!addrv!\inputencoding{utf8}
 function. We take a look at the very top of the data frame (probability
 space) to make sure that everything is operating according to plan.
@@ -8912,15 +8928,16 @@
 @
 
 The data frame is difficult to understand. It would be better to have
-a tabular display like Table BLANK. We can do that with the \inputencoding{latin9}\lstinline[showstringspaces=false]!xtabs!\inputencoding{utf8}
+a tabular display like Table \ref{tab:max-sum-joint-pmf}. We can
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/ipsur -r 145


More information about the IPSUR-commits mailing list