Builds the known matrix D such that the residual covariance of the associative model
is exactly s2_ED * I + s2_ES * D, with one row per RECORD. Pass it to kernel() as
the covariance of a record-level term and s2_ES becomes an ordinary variance
component, estimated jointly and reported with a standard error.
Arguments
- pen
pen (group) label of each record. A missing pen,
NA,NaN,Inf,-Inf, blank text or the text "NaN", is refused with its row, as in every fitter that takesindirect()- id
animal of each record, used to count DISTINCT animals per pen, which is the
nof the model and the same count theindirect()incidence uses; a missing id is refused the same way- labels
row and column names for the returned matrix, one per record; defaults to the record position. These are the levels the
kernel()term will match on, so they must be the same values as the column named in the formula; a missing label (NA,NaN,Inf,-Inf, blank text or the text "NaN") is refused with its row, as in a level column ofmodel()- dilution
the same
das inindirect(dilution = d): each mate's social environmental deviation enters with weight(n - 1)^(-d), so the block of a pen becomes(n - 1)^(-2d) [I + (n - 2) J]. Keep it equal to the formula's value; with a mismatch the residual describes a different model from the genetic side.
Value
a square matrix, records by records, positive semi-definite, with the attribute
br_associative holding dilution: h2() and t2() read a kernel() that carries
it as this residual structure and not as a relationship matrix. Indexing the matrix
(D[o, o]) or inverting it drops the attribute; with every pen of 2 animals, or
dilution = 0.5, the diagonal alone does not tell it from a relationship matrix, so
pass it as returned, built on the rows of the fit, or restore the attribute with
attr(D, "br_associative") <- dilution
Details
The block of a pen of n animals is I + (n - 2) J, from var(e_i) = s2_ED + (n - 1) s2_ES and cov(e_i, e_j) = (n - 2) s2_ES for pen mates. Its eigenvalues are
(n - 1)^2 once and 1 with multiplicity n - 1, so it is positive semi-definite for
every n, and a pen of one animal gives a block of exactly zero. The covariance GROWS
with pen size, which is why a single random(pen) variance cannot stand in for it
unless every pen has the same size.
Unlike the weights route of indirect_residual(), this one does NOT need pens of
different sizes: from n >= 3 the off-diagonal (n - 2) s2_ES is a signature the
identity does not have, and the two components separate on a balanced design. At n = 2
exactly the block is the identity and nothing separates, whatever the number of pens.
THE BINDING CONSTRAINT IS RELATEDNESS, NOT PEN SIZE. The social GENETIC effect
contributes Z_S A Z_S' * s2_AS, and when pen mates are mutually unrelated and
non-inbred the A restricted to a pen is the identity, so Z_S A Z_S' is exactly this
same D: the genetic and the environmental social components are then perfectly
ALIASED and only their sum is estimable. Measured, at 192 animals in pens of 8 with a
planted s2_AS = 0.12 and s2_ES = 0.25: with families kept apart, so that no pen
held two half sibs, the fit returned s2_AS = -0.02 and s2_ES = 0.39, whose sum
0.369 reproduces the planted 0.37 while the split is meaningless; with the same
animals rearranged so that half sibs share pens, s2_ES came back at 0.21. Separation
needs relatives sharing pens and families split across pens. Pen-size variation does
not buy it; family structure does.
Two more things the design has to avoid. A free random(pen) alongside this term spans
the same pair of matrices on a balanced design and is a rank deficiency, not a
refinement. And a pen that is fixed, or nested inside the contemporary group, absorbs
the within-pen contrasts that carry the covariance, leaving only the diagonal slope in
n_i, which is what indirect_residual() already fits.
The derivation assumes one record per animal within a pen: with two records of the same
animal in one pen the direct deviation eps_D is shared between them and the block is
no longer I + (n - 2) J. That case is refused rather than approximated.
References
Bijma, P., Muir, W.M. & Van Arendonk, J.A.M. (2007). Multilevel selection 1: quantitative genetics of inheritance and response to selection. Genetics 175:277-288.
Bijma, P. (2010). Multilevel selection 4: modeling the relationship of indirect genetic effects and group size. Genetics 186:1029-1031.