STAT-S 481/681: Structured practice for Part A — solutions

Other notation is fine as long as it describes the same model. For example, writing \(D_{jk}\mid Z_j=1\sim\operatorname{Bernoulli}(0.02)\) and \(D_{jk}\mid Z_j=0\sim\operatorname{Bernoulli}(0.10)\) on two lines is equivalent to using \(q_{Z_j}\).

S1

(a) \[ Z_j \sim \operatorname{Bernoulli}(0.7), \qquad D_{jk}\mid Z_j \sim \operatorname{Bernoulli}(q_{Z_j}), \qquad q_0 = 0.10,\quad q_1 = 0.02. \] The \(Z_j\) are independent, and the \(D_{jk}\) are independent given \(Z_1,\ldots,Z_m\).

(b) \(D_{jk}\) is observed. \(Z_j\) is unobserved, because the boxes are not labeled.

(c) They are not independent: if bolt 1 is defective, that makes it more likely the box came from machine 0, which makes bolt 2 more likely to be defective too. Given \(Z_j\), they are independent: once you know the machine, bolt 1 tells you nothing more about bolt 2. This is the same structure as in Question A1 of the midterm.

(d) \[ Q_j\sim\operatorname{Uniform}(0,0.2)\ \text{independently},\qquad D_{jk}\mid Q_j\sim\operatorname{Bernoulli}(Q_j), \] with the \(D_{jk}\) independent given \(Q_1,\ldots,Q_m\). \(Q_j\) is unobserved.

S2

(a) \[ W_i\sim\operatorname{Bernoulli}(p_{\mathrm{storm}}), \qquad K_i \mid W_i=0 \sim \operatorname{Poisson}(\lambda), \qquad K_i = 0 \text{ when } W_i=1. \] Equivalently, \(S_i\sim\operatorname{Poisson}(\lambda)\) and \(K_i=(1-W_i)S_i\), where \(S_i\) is the catch the boat would have had if it went out.

(b) If the log records storms, \(W_i\) and \(K_i\) are both observed. If it records only the catch, \(W_i\) is unobserved: a catch of 0 could come from a storm or from a day at sea with no fish.

(c) The two models have the same average, but the storm model produces more zeros and more spread. Under the storm model, \(P(K_i=0)=p_{\mathrm{storm}}+(1-p_{\mathrm{storm}})e^{-\lambda}\), which is always at least as large as \(e^{-(1-p_{\mathrm{storm}})\lambda}\) and much larger when \(\lambda\) is large; the variance is also larger than the mean, while a Poisson count has variance equal to its mean. The fraction of zero-catch days, or the variance of the catches, would differ between the two models.

S3

(a) \[ V_t\sim\operatorname{Uniform}(0,40),\qquad H_t=\mathbb{1}\{V_t>25\},\qquad J_t\mid V_t\sim\operatorname{Bernoulli}(p_{H_t}),\quad p_0=0.01,\ p_1=0.4, \] \[ E_t\sim\operatorname{Normal}(0,1.5^2),\qquad X_t=\begin{cases}V_t+E_t & \text{if } J_t=0,\\ \text{NA} & \text{if } J_t=1.\end{cases} \]

(b) \(V_t\) first, then \(H_t\) (computed from \(V_t\)), then \(J_t\) (which needs \(H_t\)), then \(E_t\) (which could be drawn at any point, since it does not depend on anything), then \(X_t\).

(c) \(X_t\) is observed. You can tell which hours had jams, since \(J_t=1\) exactly when \(X_t\) is NA, so \(J_t\) is effectively observed. \(V_t\), \(H_t\), and \(E_t\) are unobserved. In particular, you cannot tell which jammed hours had strong wind; for unjammed hours, \(X_t\) gives a good but not perfect indication, since the error has standard deviation 1.5.

(d) No, it would be lower. Hours with strong wind are much more likely to jam, so they are underrepresented among the recorded values. The missing values are related to the quantity being measured. (This is the same issue as in Question A2 of the midterm, where failures depended on the temperature.)

S4

(a) 1 → (B), 2 → (D), 3 → (F), 4 → (A), 5 → (C). Line (E) matches no sentence: it does not use \(A_i\) at all, and it describes a count out of 40 trials.

(b) \(A_i\): whether there is an advertisement on day \(i\). \(S_i\): the number of people who sign up on day \(i\). \(U_i\): whether the server is up on day \(i\). \(X_i\): the recorded count.

(c) \(X_i\) is observed; \(A_i\), \(S_i\), and \(U_i\) are unobserved. (If the site kept records of its advertising, \(A_i\) would be observed.)

(d) Not with certainty, because a Poisson count can be 0 even when the server is up. Here, though, \(P(S_i=0)\) is at most \(e^{-15}\approx 3\times10^{-7}\), so in practice a recorded 0 almost certainly means the server was down. If the averages were small, say 1 or 2, a recorded 0 would be ambiguous.

S5

(a) 1 → (A) (the rate \(R_j\) is a random variable with its own value for each patient); 2 → (F) (this is what distinguishes (A) from (B)); 3 → (A); 4 → (C); 5 → (D). Notation (B) and (E) are not used.

(b) \[ R_j\sim\operatorname{Uniform}(0,5)\ \text{independently},\qquad Y_{jk}\mid R_j\sim\operatorname{Poisson}(R_j), \] with the \(Y_{jk}\) independent given \(R_1,\ldots,R_m\).

S6

(a) (B).

(b)

(c) In (C), each \(Y_{jk}\) has its own independent \(P_{jk}\), so each \(Y_{jk}\) is independently 1 with probability equal to the average of \(P_{jk}\), which is 0.65. That is exactly model (A). The matching model (B) differs because a student’s answers share \(P_j\): some students get most questions right and others get many wrong. The spread of the students’ scores (number correct out of \(n\)) would be larger under (B) than under (A).

S7

(a) (B).

(b) \[ C_i\sim\operatorname{Normal}(\mu,\sigma^2),\quad E_i\sim\operatorname{Normal}(0,\tau^2),\quad B_i=\mathbb{1}\{C_i+E_i<L\},\quad X_i = d_{B_i}, \] where \(d_0 = C_i+E_i\) and \(d_1 = L/2\). Equivalently, \(X_i=(1-B_i)(C_i+E_i)+B_i\,L/2\).

S8

Problems:

  1. \(S_j=1\) means the hive survives, so \(S_j\sim\operatorname{Bernoulli}(1-p_{\mathrm{die}})\).
  2. The average should be specific to the hive: \(\Lambda_j\), drawn independently for each hive, not a single \(\Lambda\).
  3. The count for a dead hive should be 0, but the student’s model gives a Poisson count regardless of \(S_j\).
  4. \(\Lambda_j\) is not observed; only \(S_j\) and \(H_j\) are. (Arguably \(S_j\) is also determined by the data, if a dead hive is distinguishable from a live hive with no honey.)
  5. Minor: \(H_j\) is never defined, and the independence assumptions are not stated.

Corrected model, with \(H_j\) the number of frames of honey in hive \(j\): \[ S_j\sim\operatorname{Bernoulli}(1-p_{\mathrm{die}}),\qquad \Lambda_j\sim\operatorname{Uniform}(2,10),\qquad H_j\mid S_j=1,\Lambda_j\sim\operatorname{Poisson}(\Lambda_j),\qquad H_j=0\ \text{if } S_j=0, \] independently across hives.

S9

(a) When \(F_i=0\), the rule gives \(A_i=G_i\), which is correct. When \(F_i=1\), it gives \(A_i=C_i+G_i\), which is wrong whenever \(G_i=1\): the person should answer \(C_i\), but the rule adds the irrelevant second coin, and when \(C_i=1\) and \(G_i=1\) it even gives \(A_i=2\).

(b) \(A_i = F_iC_i + (1-F_i)G_i\), or, with the “one of two forms” notation, \(A_i = d_{F_i}\) where \(d_1=C_i\) and \(d_0=G_i\).

(c) Only \(A_i\) is observed. \(P(A_i=1) = 0.5\,\pi + 0.5\times0.5 = 0.5\,\pi+0.25\).

S10

(a) For example: each restaurant is either a problem restaurant (with probability 0.1) or not, and this does not change over time. At each inspection, the number of health code violations found is a Poisson count, with average 12 for problem restaurants and 2 for others. Given which restaurants are problem restaurants, the inspections are independent. Whether a restaurant is a problem restaurant is not recorded.

(b) More. Many violations at the first inspection suggest \(G_j=1\), and the same \(G_j\) applies at the second inspection. The shared \(G_j\), indexed by restaurant but not by inspection, is responsible.

(c) Give the category an inspection index, \(G_{jk}\), and say how it changes from one inspection to the next, for example \[ G_{j1}\sim\operatorname{Bernoulli}(0.1),\qquad G_{jk}\mid G_{j,k-1}\sim\operatorname{Bernoulli}(s_{G_{j,k-1}}),\qquad V_{jk}\mid G_{jk}\sim\operatorname{Poisson}(\mu_{G_{jk}}), \] where \(s_1\) is the probability a problem restaurant stays a problem restaurant and \(s_0\) is the probability a good restaurant becomes one.