h2(x) = phi(x)' C phi(x) / V_P(x), with C the covariance of the reaction-norm group and
phi(x) the Legendre basis evaluated at x. The phenotypic variance V_P(x) is evaluated at x
too: every other random regression on the same basis (the permanent environment of a
test-day model) enters as phi(x)' P phi(x), each scalar term with its variance, and the
residual. A covariance between two scalar terms enters with coefficient 1, as in h2(),
and the residual of a fit with weights is read at the harmonic mean weight of the
records, as in h2() (weights w and 10 w give the same curve).
Every random regression of the fit is evaluated on the Legendre basis with these limits.
Arguments
- fit
result of
model()with an rn() term- group
name of the reaction-norm group; by default the group of the direct genetic term, as in
h2()- limits
the same ones passed to
legendre()when preparing the data- points
where to evaluate the curve
- bases
a named list, term -> function(x), with the value at each point x of the base of a scalar term declared with
base =(for examplerandom(id, base = "young"), withyoungan indicator of a class of the gradient:list(random = function(x) as.numeric(x < 30))). The value of a data column at a point of the gradient is not known from the fit, so such a term without an entry here enters with base 1 at every point, and a warning says so. In a fit withresidual_by =, the entryresidualis a function(x) that gives the residual class at each point (for example the band of days that holds x); without it the residual enters at its mean over the records, the one ofh2(), and a warning says so