cwad is a small, dependency-free R package for
plant-breeding trial design.
A design comparison usually changes two things at once: how plots are allocated among genotypes, and whether the analysis borrows information through a kinship matrix. The resulting gain in precision is then reported as a property of the design, although most of it may belong to the analysis model.
cwad keeps the two apart. Every replication allocation
is evaluated in one reduced linear mixed model on genotype means, and
every allocation can be scored both with and without
kinship, so allocation and analysis model enter as crossed
factors rather than as a single confounded contrast.
greedy_alloc()).compare_designs()).balanced_control()), because comparing an integer
allocation against a fractional “uniform r = B/N” inflates the apparent
gain.sim_transgressive()) and kinship mis-specification
(sim_wrongG()).On its own 200-genotype, 400-plot example at plot-basis heritability 1/3, the 23.3 % reduction in the mean variance of a genotype difference that a naive comparison attributes to connectivity-weighted allocation decomposes into 22.94 percentage points from using kinship in the analysis and 0.34 percentage points from the allocation itself. Across plot budgets from 1.2N to 3N and heritabilities from 0.10 to 0.67 the allocation contributes at most 1.91 %.
The package is a comparison and calibration tool, not a claim that any one design is universally best.
install.packages("cwad")
# development version
# install.packages("remotes")
remotes::install_github("bkpraveenars-del/cwad")library(cwad)
g <- make_fs_G(c(rep(24, 5), rep(6, 10), rep(1, 20)))
Ginv <- solve(g$G); N <- nrow(g$G)
r_unif <- rep(2, N)
r_cwad <- greedy_alloc(Ginv, B = 2 * N, alpha = 2, sig2e = 2)
compare_designs(g$G, alpha = 2, sig2e = 2,
list(`Uniform r=2` = r_unif, CWAD = r_cwad))Reading across a row isolates the analysis model; reading down a column isolates the allocation.
Rscript inst/scripts/reproduce.Rregenerates every table and figure. inst/VERIFICATION.md
records the checks of the computational engine against independent
ground truth.
Version 0.1.0 reported the 23 % figure above as a property of the
design. It was not: allocation and analysis model had been varied in a
single step. Version 0.2.0 reports the same engine, the same example and
the same numbers, decomposed, and the API no longer permits the
confounded comparison to be expressed. Scripts calling the v0.1.0
compare_designs(), sim_transgressive() or
sim_wrongG() will need updating.
GPL-3