---
title: "Theory and notation"
author: "Muhammad Yaseen"
date: last-modified
format:
  html:
    self-contained: true
    number-sections: true
    toc: true
    toc-depth: 3
    highlight-style: pygments
    code-tools: true
    html-math-method: mathjax
vignette: >
  %\VignetteIndexEntry{Theory and notation}
  %\VignetteEngine{quarto::html}
  %\VignetteEncoding{UTF-8}
execute:
  echo: true
  warning: false
  message: false
---

{{< include _stability-macros.txt >}}

```{r setup, include = FALSE}
knitr::opts_chunk$set(collapse = FALSE, comment = "", fig.width = 7, fig.height = 4.6,
                      dev = if (knitr::is_latex_output()) "cairo_pdf" else
                        if (requireNamespace("svglite", quietly = TRUE)) "svglite" else "png")
if (requireNamespace("stability", quietly = TRUE)) library(stability) else
  pkgload::load_all(export_all = FALSE, helpers = FALSE, quiet = TRUE)
```

# Abstract

The models behind the analyses and the notation of the help pages.

# Notation

```{r notation}
stab_notation(
    format = c("table", "path", "tex")[1]
  )
```

# The two-way table

All methods start from the table of means $\mY = (\ybar_{ij})$, $G$ genotypes by $E$ environments, each the mean of
$B$ replicates. The additive model and the interaction:

$$
\ybar_{ij} = \mu + g_i + e_j + z_{ij}, \qquad z_{ij} = \ybar_{ij} - \ybar_{i\cdot} - \ybar_{\cdot j} + \ybar .
$$

**Regression methods** model the interaction as a linear function of the environment index
$I_j = \ybar_{\cdot j} - \ybar$: $\ybar_{ij} = \mu_i + \beta_i I_j + \delta_{ij}$.

**Variance methods** summarise each row of $\mZ$: Wricke's ecovalence $W_i = \sum_j z_{ij}^2$ and Shukla's stability
variance $\sigma^2_i = [G(G-1)W_i - \sum_k W_k]/[(E-1)(G-1)(G-2)]$.

**AMMI** decomposes $\mZ$ by its singular values, $\mZ = \sum_n \lambda_n \vg_n \vd_n^\top$, and tests each term.

**GGE** decomposes the environment-centred table $\mX = (\ybar_{ij} - \ybar_{\cdot j})$, genotype main effect plus
interaction, and plots its first two terms.

# Scales

The analyses of variance are on the scale of the plots; the stability statistics on the scale of the means. A mean
square of the means corresponds to a plot mean square divided by $B$; the pooled error of the means is $s^2/B$.

# Summary

One table of means, four views of it: regression, variance, AMMI and GGE.

# References

Becker, H. C. and Leon, J. (1988). Stability analysis in plant breeding. *Plant Breeding*, 101(1), 1--23.

Gauch, H. G. (1992). *Statistical Analysis of Regional Yield Trials: AMMI Analysis of Factorial Designs*. Elsevier, Amsterdam.

Yan, W., Hunt, L. A., Sheng, Q. and Szlavnics, Z. (2000). Cultivar evaluation and mega-environment investigation based on the GGE biplot. *Crop Science*, 40(3), 597--605.
