# 8章章末問題
## 1
### 復習
#### Exchangeability
以下は、https://www.uv.es/~bernardo/Exchangeability.pdf より
Suppose that in considering $p(x_1,...,x_n)$ the scientist makes the judgement that the subscripts, the ‘labels’ identifying the individual random quantities are ‘uninformative’, in the sense the information that the $x_i$’s provide is independent of the order in which they are collected.
This judgement of ‘similarity’ or ‘symmetry’ is captured by requiring that
$$
p(x_1,...,x_n) = p(x_{\pi(1)},...,x_{\pi(n)})
$$,
for all permutations $\pi$ defined on the set ${1,...,n}$. A sequence of random quantities is said to be exchangeable if this property holds for every finite subset of them.
Example. (Physiological responses). Suppose ($x_1,...,x_n$) are real-valued measurements of a specific physiological response in human subjects when a particular drug is administered. If the drug is administered at more than one dose level, and if they are male and female subjects from different ethnic groups, one would be reluctant to make a judgement of exchangeability for the entire sequence of results. However, within each combination of dose-level, sex, and ethnic group, an assumption of exchangeability would often be reasonable.
#### Ignorability
$$
p(\theta|x, y_{obs}) = p(\theta|x, y_{obs}, I)
$$
が成り立つこと。すなわち、missing at randomとdistinct parametersの仮定が成り立つ場合、観察・欠落を示す、Inclusion vector $I$を無視できることを指す。$I$と$y$が独立でない場合、例えば、200以上は「非常に重い」に分類されるような場合、この性質は成り立たない。
### Question
Definition of concepts: the concepts of randomization, exchangeability, and ignorability have often been confused in the statistical literature. For each of the following statements, explain why it is false but also explain why it has a kernel of truth. Illustrate with examples from this chapter or earlier chapters.
(a) Randomization implies exchangeability: that is, if a randomized design is used, an exchangeable model is appropriate for the observed data, $y_{obs 1}, . . . , y_{obs n}$.
(b) Randomization is required for exchangeability: that is, an exchangeable model for $y_{obs 1}, . . . , y_{obs n}$ is appropriate only for data that were collected in a randomized fash-ion.
(C) Randomization implies ignorability; that is, if a randomized design is used, then it is ignorable.
(d) Randomization is required for ignorability; that is, randomized designs are the only designs that are ignorable.
(e) Ignorability implies exchangeability; that is, if an ignorable design is used, then an exchangeable model is appropriate for the observed data, $y_{obs 1}, . . . , y_{obs n}$.
(f) Ignorability is required for exchangeability; that is, an exchangeable model for the vector $y_{obs 1}, . . . , y_{obs n}$ is appropriate only for data that were collected using an ignorable design.
### Solution
#### a
"Randomization implies exchangeability"は必ずしも真ではない。$y$に影響を与える共変量$x$が既知の場合、$y$だけではexchangeabilityが成り立たない。この場合、$(x, y)$で事後分布を考える必要がある。。例えば、8.3における1988年大統領選挙では、地域ごとの共和党支持率、民主党支持率はexchangeabilityの上で必須であろう。
しかし、そのような共変量がない場合(例: 実験室実験)、ランダム化比較試験によって交換可能性は得られる。
#### b
"Randomization is required for exchangeability"は必ずしも真ではない。他に共変量の情報が全くない場合、exchangeabilityを満たすと考えざるを得ない(?)
しかし、"Randomization is required for exchangability"も核心をついている。観察データの場合、追加の情報によっては、交換可能性は妥当ではない。
#### c
"Randomization implies ignorability"は必ずしも真ではない。ランダム化しても、データ収集段階でデータの欠損がランダムでない場合(例: 200以上は「非常に多い」に分類)、欠損の無視可能性は成り立たない。
また、無視可能性が成り立つには、ランダムであることに加え、"distinct parameters"(p202)という仮定も必要である。これは観察されたデータ$\mathbf{y}$のパラメータ$\theta$と、データの欠損行列$\mathbf{I}$を決めるパラメータ$\phi$とが独立であるという仮定である。
しかし、以上の2つが満たされる場合、すなわち、randomizationが満たされ、欠損や収集過程がランダムである場合、この命題は正しい
#### d
"Randomization is required for ignorability"は必ずしも真ではない。$\mathbf{I}$が$y_{mis}$に依存しない状況を考えれば良い。例えば、観察された順番に$1, 1, 0, 0, 1, 1, 0, 0...$と欠損が割り当てられた場合、これは明らかに$y_{mis}$と独立している。
しかし、多くの場合、"Randomization is required for ignorability"は正しい。ランダム化しない状況では、確かにdistinct parametersの仮定を満たすことは困難だからである。例えば、風邪を引いているように見える人にだけ薬を処置しては因果効果の識別は困難であろう。
#### e
"Ignorability implies exchangeability"は必ずしも真ではない。ランダム化されignorableで合っても、共変量が他にあればexchangeableではない。
この命題は正しい場合もある。通常、ignorableであれば、$I$は共変量$x$に依存しない。その場合、必ずしも$x$をモデルに入れる必要は必ずしもない。
#### f
"Ignorability is required for exchangeability"は必ずしも真ではない。censored dataはignorableでない。しかし、もし他に共変量$x$がなければ、exchangableである。
一方で、この命題は正しい場合もある。ignorabilityが満たされていない場合、そして、$x$が$\phi$と共に$I$のパラメータである場合、$p(\theta|x, y_{obs}, I) \neq p(\theta|y_{obs})$である。すなわち、$\theta \rightarrow y$であり、$\theta \leftarrow I \leftarrow x, \phi$であるため、事後分布は$x, y$で条件づけなければexchangeableにならない。
逆に、この状況で、ignorableであれば、$x \rightarrow I$であり、$I$と$y$は独立しているので、$p(\theta|x, y_{obs}, I) = p(\theta|y_{obs})$である。よって交換可能性が成り立つ。
## 7. Simple random sampling:
### Question (a)
Derive the exact posterior distribution for y under simple random sampling with the normal model and noninformative prior distribution.
### Answer.
$$
\sigma^2|y^{obs} \sim Inv-\chi^2(n-1,s^2) \\
\mu|\sigma^2, y^{obs} \sim \mathcal{N}(\bar{y}^{obs}, \sigma^2/n)
$$
このとき、$\bar{y}^{obs}$はサンプルデータの平均、$s^2$はサンプルデータの分散
サンプリングされなかったデータの事後予測分布は、以下にしたがう
$$
\bar{y}^{miss}|\mu,\sigma^2,y^{obs} \sim \mathcal{N}(\mu,\sigma^2/(N-n))
$$
このとき、$\mu$を消去すると以下の通り
$$
\bar{y}^{miss}|\sigma^2,y^{obs} \sim \mathcal{N}(\bar{y}^{obs}, (1/n + 1/(N-n))\sigma^2)
$$
$\sigma^2$の事後分布が逆カイ2乗分布になるため、$\sigma$をaveraging overした分布はt分布になる
$$
\bar{y}^{miss}|y^{obs} \sim \mathcal{t_{n-1}}(\bar{y}^{obs}, (1/n + 1/(N-n))s^2)
$$
complete data meanは
$$
\bar{y} = \frac{n}{N}\bar{y}^{obs} + \frac{N-n}{N}\bar{y}^{miss}
$$
である。このとき、$n,N,\bar{y}^{obs}$はすでに観察されているため、constantと見做せる。
従って、complete data meanは線形変換なので、
\begin{eqnarray}
\bar{y}|y^{obs} &\sim& \mathcal{t_{n-1}}(\bar{y}^{obs}, s^2(1/n + 1/(N-n))(N-n)^2/N^2)\\
&=& \mathcal{t_{n-1}}(\bar{y}^{obs},s^2(N-n)/nN)\\
&=& \mathcal{t_{n-1}}(\bar{y}^{obs},s^2(1/n-1/N))\\
\end{eqnarray}
### Question (b)
Derive the asymptotic result (8.6).
### Solution
w→∞のとき、$(1+z/w)^w → exp(z)$であるから、
$(1/\sigma)(1+(1/v)((\theta-\mu)/\sigma)^2)^{-(v+1)/2}$について、v→∞のとき、
$(1/\sigma)exp(-\frac{1}{2}(\theta-\mu)/\sigma)^2)$となる
## 15
### Question
Sequential treatment assignment: consider a medical study with two treatments, in which the subjects enter the study one at a time. As the subjects enter, they must be assigned treatments. Efron (1971) evaluates the following ‘biased-coin’ design for assigning treatments: each subject is assigned a treatment at random with probability of receiving treatment depending on the treatment assignments of the subjects who have previously arrived. If equal numbers of previous subjects have received each treatment, then the current subject is given the probability $\frac{1}{2}$ of receiving each treatment; otherwise, he or she is given the probability $p$ of receiving the treatment that has been assigned to fewer of the previous subjects, where $p$ is a fixed value between $\frac{1}{2}$ and $1$.
(a) What covariate must be recorded on the subjects for this design to be ignorable?
(b) Outline how you would analyze data collected under this design.
\(c\) To what aspects of your model is this design sensitive?
(d) Discuss in Bayesian terms the advantages and disadvantages of the biased-coin design
over the following alternatives: (i) independent randomization (that is, $p = \frac{1}{2}$ in the above design), (ii) randomized blocks where the blocks consist of successive pairs of subjects (that is, $p = 1$ in the above design). Be aware of the practical complications discussed in Section 8.5.
### Solution
#### a
被験者が実験に参加した順番を記録した変数がignorabilityに必要。例えば被験者$i$に対して$t_i=1,2,3,\cdots$を割り当てるなど。
#### b
ここで結果変数を$y = (y_1, \cdots , y_n)$とすれば、これを$(y|x, \theta)$としてモデル化し、事前分布は$p(\theta|x)$となる。
#### c
このリサーチデザインの解釈は、$y$の$t$に対する依存で変化しうる。例えば$y$が時間的なトレンドを持っていると、その分をモデルに含めなければならい。
#### d
##### 「バイアス付きコイン」デザイン
長所:
$t$に対して中程度のバランスを取れる。
短所:
時間依存変数をモデルに組み込む必要があるのでで情報収集コストが高い。
##### 代替案(i)
長所:
時間依存変数をモデルに組み込む必要がないので情報収集コストが低い。
短所:
$t$に対して最もバランスが取れない。
結果変数のなめらかな時間依存があった場合最も不正確な推定になる。
##### 代替案(ii)
長所:
$t$に対して最もバランスが取れる。
結果変数の時間依存があった場合、最も正確な推定になる。
短所:
時間に対してalternating trendがあった場合、最も不正確な推定になる。
posterior predictive checkingが難しい。