Skip to contents

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.

Usage

h2_curve(fit, group = NULL, limits, points = 101L)

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

Value

a data.frame with x, the point on the gradient, va, the additive variance there, and h2, the heritability at that point.

Details

The LIMITS must be the same ones used to generate the basis in the fit: the scale is part of the model. That is why they are a mandatory argument, with no default: a silent default here would produce a curve from another basis.