Real trials lose plots, and some genotypes are not grown in every environment. The error variance also differs from one site to the next. This vignette shows how bayes_ammi() handles both: missing plots and empty cells by data augmentation, and a separate error variance for every environment with .het = TRUE. It ends with a comparison of the two variance models on Maiz.
2 Missing plots and empty cells
2.1 The idea
With \(B\) the largest number of plots in a cell, a cell \((i, j)\) with \(n_{ij} < B\) plots has \(B - n_{ij}\) missing plots. A cell with \(n_{ij} = 0\) is an empty cell. At every iteration the sampler draws the missing plots from the model, \[y^{\mathrm{mis}}_{ijl} \mid \vtheta \sim N(\eta_{ij}, \sigma^2_j), \qquad \eta_{ij} = \mu + \tau_i +
\delta_j + \sum_{k=1}^{K}\lambda_k\alpha_{ik}\gamma_{jk},\] and then draws the parameters from the conditional distributions of the balanced design (vignette 2) given the completed data. This is the data augmentation of Tanner and Wong (1987). The draws of the parameters come from their posterior given the observed plots only, so nothing is invented: a missing plot adds no information, and an empty cell is predicted from the row and column structure of the model. The missing plots are assumed to be missing at random (Little and Rubin 2019).
The sampler needs only the sums, sums of squares and counts of the observed plots in every cell, so the completed data are never stored.
2.2 An example
From Maiz we remove 60 plots at random and every plot of three genotype-environment combinations:
The column full holds the cell means of the complete data, which the fit never saw. 2 of the 3 HPD intervals contain them. The miss, genotype 2 in environment 5, is a cell whose interaction is not carried by the two bilinear terms: the model predicts an empty cell only from the pattern of the rest of the trial. The posterior standard deviations of the empty cells are on average 1.1 times those of the cells with all four plots.
plot(x = pu, which ="cells")
3 Environment-specific error variances
3.1 The model
With .het = TRUE the plots of environment \(j\) have their own variance, \(e_{ijl} \sim N(0, \sigma^2_j)\), and every \(\sigma^2_j\) has the scaled inverse chi-squared prior of the common variance. Write \(w_j = 1/\sigma^2_j\). The conditional distributions change as follows.
\(\sigma^2_j\): scaled inverse chi-squared with \(\nu + BG\) degrees of freedom and the residual sum of squares of environment \(j\).
\(\tau_i\): the data precision becomes \(B\sum_j w_j\), the same for every genotype.
\(\mu\) and \(\delta_j\): no longer independent, so \((\mu, \mathbf{d})\) is drawn jointly from its multivariate normal conditional.
\(\lambda_k\): mean and variance weighted by \(w_j\).
\(\va_k\): still von Mises-Fisher, because the quadratic term \(\sum_j w_j\gamma_{jk}^2\) does not depend on \(\va_k\).
\(\vg_k\): the quadratic term \(\sum_j w_j\gamma_{jk}^2\) now varies on the sphere. The conditional is a Bingham-von Mises-Fisher distribution (Hoff 2009), drawn one coordinate at a time in the eigenbasis of the quadratic form by slice sampling.
Perez-Elizalde et al. (2012) give the general linear-bilinear model with these conditionals.
Comparison of Bayesian models (smaller is better)
model terms variances DIC pD WAIC p_waic
<char> <int> <char> <num> <num> <num> <num>
1: environment_var 2 per environment 11735.63 85.6869 11741.45 82.0777
2: common 2 common 11862.02 67.9290 11865.68 65.9309
se lambda_last_lower lambda_last_mean dWAIC dWAIC_se
<num> <num> <num> <num> <num>
1: 41.9641 910.1783 2093.077 0.0000 0.0000
2: 44.2329 63.7490 1686.287 124.2365 22.4796
Sources: Spiegelhalter et al. (2002); Watanabe (2010); Vehtari et al. (2017).
Full references: bam_cite(x).
The environment-specific variances lower WAIC by 124, 5.5 times the standard error of the difference. They also sharpen the interaction: the lower HPD limit of \(\lambda_2\) rises from 64 to 910, because the plots of the noisy environments no longer blur the second term. The posterior predictive check of the common-variance model tells the same story through the ratio of the largest to the smallest environment variance:
Posterior predictive checks (500 replicated trials)
statistic observed mean_rep p_value
<char> <num> <num> <num>
1: variance of cell means 1.842e+06 1.901e+06 0.682
2: largest cell mean 8.385e+03 8.608e+03 0.728
3: smallest cell mean 1.632e+03 1.743e+03 0.672
4: variance of genotype means 1.247e+05 1.429e+05 0.662
5: first singular value 5.923e+03 5.902e+03 0.482
6: within-cell variance 7.559e+05 7.660e+05 0.526
7: largest / smallest environment variance 2.582e+01 2.924e+00 0.000
Sources: Gelman et al. (1996). Full references: bam_cite(x).
The observed ratio is 26, against 2.9 on average in the replicated trials of the common-variance model (posterior predictive p-value 0.000). The other statistics are reproduced well. Vignette 9 returns to these tools.
5 References
Crossa, J., Perez-Elizalde, S., Jarquin, D., Cotes, J. M., Viele, K., Liu, G. and Cornelius, P. L. (2011). Bayesian estimation of the additive main effects and multiplicative interaction model. Crop Science, 51(4), 1458–1469. doi:10.2135/cropsci2010.06.0343
Perez-Elizalde, S., Jarquin, D. and Crossa, J. (2012). A general Bayesian estimation method of linear-bilinear models applied to plant breeding trials with genotype x environment interaction. Journal of Agricultural, Biological, and Environmental Statistics, 17, 15–37. doi:10.1007/s13253-011-0063-9
Hoff, P. D. (2009). Simulation of the matrix Bingham-von Mises-Fisher distribution, with applications to multivariate and relational data. Journal of Computational and Graphical Statistics, 18(2), 438–456.
Tanner, M. A. and Wong, W. H. (1987). The calculation of posterior distributions by data augmentation. Journal of the American Statistical Association, 82(398), 528–540.
Little, R. J. A. and Rubin, D. B. (2019). Statistical Analysis with Missing Data, 3rd edn. Wiley, Hoboken.