The Hadamard construction of g_epistasis() is not restricted to additive-by-additive.
Under the orthogonal partition the relationship matrix of an interaction between two
effect types is the elementwise product of their relationship matrices, so with G the
additive and D the dominance matrix, G_AD = G * D and G_DD = D * D, each rescaled
so its diagonal averages one. Higher orders follow the same rule: G_AAA = G * G * G.
Arguments
- g
additive relationship matrix, as from
g_matrix()- d
dominance relationship matrix, as from
g_dominance()- order
for
g_epistasis_order(), how many additive factors to multiply: 2 isg_epistasis(), 3 is additive-by-additive-by-additive
Value
relationship matrix with the dimnames of the input, rescaled to unit mean
diagonal; ridge it before kernel() if the input was singular
Details
Two warnings that belong with the formula rather than after it. The orthogonality that makes these terms separable holds under Hardy-Weinberg and linkage equilibrium; away from it the terms correlate and the partition of variance stops being clean. And every order added is a covariance component the data has to support: a fit with additive, dominance and three epistatic terms asks five variances of a design that usually struggles to give two, and the components collapse to the boundary rather than informing anything. Add an order because a hypothesis calls for it, never because the function exists.