应用统计和数据可视化 Applied Statistics and Data Visualisation STAT3406

To elaborate on some of the comments made earlier about iterated sums and arrays, we now strip away the genetics overlay and concentrate on issues of numerical analysis. As an example [18], consider the problem of computing the sum of products
$$\sum_{G_{1} \in S_{1}} \sum_{G_{2} \in S_{2}} \sum_{G_{3} \in S_{3}} A\left(G_{1}, G_{2}\right) B\left(G_{2}\right) C\left(G_{2}, G_{3}\right)$$
where $S_{i}$ is the finite range of summation for the index $G_{i}$, and where $A$, $B$, and $C$ are arrays of real numbers. Let $S_{i}$ have $m_{i}$ elements. Computing (7.2) as a joint sum requires $2 m_{1} m_{2} m_{3}$ multiplications and $m_{1} m_{2} m_{3}-1$ additions. If we compute $(7.2)$ as an iterated sum in the sequence $(3,2,1)$ specified, we first compute an array
$$D\left(G_{2}\right)=\sum_{G_{3} \in S_{3}} C\left(G_{2}, G_{3}\right)$$
in $m_{2}\left(m_{3}-1\right)$ additions. Note that the arrays $A$ and $B$ do not depend on the index $G_{3}$ so it is uneconomical to involve them in the sum on $G_{3}$. Next we compute an array
$$E\left(G_{1}\right)=\sum_{G_{2} \in S_{2}} A\left(G_{1}, G_{2}\right) B\left(G_{2}\right) D\left(G_{2}\right)$$

STAT3406 COURSE NOTES ：

A reasonable covariance model incorporating both household and random effects is $\Upsilon=\sigma_{h}^{2} H+\sigma_{e}^{2} I$, giving an overall covariance matrix $\Omega$ for $Y$ of
$$\Omega=2 \sigma_{a}^{2} \Phi+\sigma_{d}^{2} \Delta_{7}+\sigma_{h}^{2} H+\sigma_{e}^{2} I .$$
This last representation suggests studying the general model
$$\Omega=\sum_{k=1}^{r} \sigma_{k}^{2} \Gamma_{k}$$
where the variance components $\sigma_{k}^{2}$ are nonnegative and the matrices $\Gamma_{k}$ are known covariance matrices. Since measurement error will enter almost all models, at least one of the $\Gamma_{k}$ should equal $I$. For convenience, we assume $\Gamma_{r}=I$.