Skip to contents

acc_i = sqrt(1 - PEV_i / (k_ii sigma2)), with the PEV coming from the diagonal of the selective inverse of the MME at the optimum, sigma2 the variance of the term and k_ii the PRIOR variance of level i at unit sigma2, the diagonal of the covariance matrix the term was fitted with. For a pedigree term that is 1 + F_i, and it matters: without it the accuracy of an inbred animal comes out underestimated, and in a closed nucleus that is everybody.

Usage

accuracy(fit, pedigree, group = NULL, trait = NULL)

Arguments

fit

result of model(), model_mt(), model_ar1(), model_threshold() or model_survival() (log-hazard scale, from the Laplace PEV of the frailty) (ordinal mode; the joint threshold fit carries no PEV, a declared limit)

pedigree

the same data.frame used in the fit. Only a group with a pedigree term reads it; for a group of kernel() terms, of iid terms, or of a term given a declared k_inverse = other than an h_inverse(), it may be omitted. A term fitted with k_inverse = h_inverse(...) or genotypes = is a pedigree term and needs it

group

covariance group; by default the group of the direct genetic term: the first pedigree or genomic term that is not maternal() or indirect(), else the first kernel() with an estimated variance over the animals (most of its levels are animals of the pedigree, or there is no pedigree term), else the first maternal() term, else the first other kernel() with an estimated variance, else the first group; the same default in ebv(), solutions(), accuracy(), h2() and h2_curve()

trait

required in the multi-trait case (model_mt(), or model_ar1() with cbind()): accuracy is per trait, with the corresponding var(term@trait)

Value

a numeric vector named by level, in the order of fit$pev[[group]]; a group with several scalar terms (direct-maternal, direct-indirect) returns one block of levels per term, each scaled by its own variance.

Details

It is only defined for a group with ONE coefficient. In a reaction norm the accuracy of the intercept alone is misleading (the slope's is tiny and the total EBV's depends on the point of the gradient), so the error here tells you to combine the coefficients explicitly.

The prior variance is each level's own, read from the structure of its term and matched to the PEV by level NAME, never by position:

  • a pedigree term (animal(), sire(), maternal(), indirect()): 1 + F from the pedigree. The pedigree must be the one the fit was given: the founders the fit added (ids of the data with no line) and its pruning to the animals of the data, the genotyped and their ancestors (see pedigree in model()) are redone here, so the animals are exactly the levels of the group. A pedigree with ancestors added or animals missing is refused (it would change the F of their descendants); lines that are not ancestors of any level are pruned, as in the fit. Its rows may come in any order. For a GENOTYPED animal in a single-step fit it is the diagonal of H, which in that block is the diagonal of G*, and that is a different number: on a simulated population of 510 animals, all genotyped, the two differ by up to 0.18, moving an individual accuracy by up to 0.067 (median 0.011). The herd average barely notices (0.6966 against 0.6964); what moves is the individual, and with it the ranking of genotyped animals by accuracy. The fit carries the genomic prior when it has one, in h_prior, named by genotyped animal.

  • a kernel(id, K = ) term: K[i, i], the diagonal of the declared matrix, which the fit carries. With K = dominance_matrix(ped) on an inbred pedigree the diagonal is 1 while 1 + F is not, and dividing by 1 + F overstated the accuracy (measured on an inbred pedigree with a sire-daughter mating: 0.7282 where the right value is 0.6426 for the animals with F = 0.25). A K with a non-unit diagonal (a G with a ridge, a scaled matrix) is divided by that diagonal.

  • a kernel(id, Kinv = ) term: the diagonal of K = Kinv^-1. From dominance_inverse() it comes ready in prior, 1 for an animal and F_cc / 4 for a sire x dam pair, so the animals get the same accuracy as with kernel(K = dominance_matrix(ped)); for any other precision it is read from the selective inverse of Kinv after the fit, one more factorization of Kinv (if that fails, the fit is kept with a warning and the term has no accuracy).

  • a relationship term given its own inverse with k_inverse = in model_threshold() or model_survival(): the diagonal of K, read from the selective inverse of the declared K^-1 when the fit is built. An h_inverse() passed there follows the single-step convention of the first item instead, so both doors to the same model return the same accuracy. That convention divides a NON-genotyped animal by 1 + F, while its prior variance under H is H[i, i], which differs by (A12 A22^-1 (G* - A22) A22^-1 A21)[i, i]; a dense H given as kernel(K = H) is divided by H[i, i] for every animal, so the two routes differ there.

  • an iid term (pe(), random()): 1.

A group with several scalar terms (direct-maternal, direct-indirect, two correlated iid terms) is split into one block of levels per term, and each block is divided by its own variance. Every term of a group indexes the same levels: the pedigree, the ids of K, or, for terms without a relationship matrix (random(), pe()), the union of the level names of their columns. With 8 sires in one column and 16 dams in the other each block has the levels of both columns. A level that appears only in the other term's column has no record for this term, and its accuracy is what the group covariance carries over from the other term at the same level, 0 when that covariance is 0. A fit made before this version paired the levels of such a group by position; when its blocks do not carry the same level names it is refused, and it should be refitted either way.

THE STATE OF THE FIT. A fit that did not converge is read at its last iterate, with a warning. When the fit reports the information matrix SINGULAR along a set of components that includes a variance or covariance of the group, the PEV and the variance move together along that ridge and the accuracy of every level is returned as NA, with a warning naming the components; a fit with no estimates (theta NA, the start was inadmissible) gives NA too, saying so (it used to stop with "no component 'var(animal)'"). A fit at given components (start with maxiter = 0 and n_em = 0) is read at those components without a word. A PEV above the prior variance of its level beyond rounding gives accuracy 0 with a warning that counts those levels: the prior used is then not the one the level was fitted with, as for a non-genotyped animal of a single step (see above).

References

Henderson, C.R. (1975). Best linear unbiased estimation and prediction under a selection model. Biometrics 31:423-447.

Mrode, R.A. & Pocrnic, I. (2023). Linear Models for the Prediction of the Genetic Merit of Animals, 4th ed. CABI, ch. 3.