Skip to contents

Fits a single trait pedigree BLUP model, also known as an animal model, to a training population, using the pedigree recorded in the SimParam. The output is used with setEBV to set estimated breeding values or genetic values for any individual in the simulation, including individuals created after the model was fitted. The pedigree must have been tracked from the start of the simulation, see setTrackPed.

Usage

pedBLUP(
  pop,
  traits = 1,
  use = "pheno",
  Vu = NULL,
  Ve = NULL,
  varComp = NULL,
  simParam = NULL,
  ...,
  estVarComp = TRUE
)

Arguments

pop

a Pop-class to serve as the training population. Several generations can be combined with c(), and an individual that appears more than once has its records treated as repeated records.

traits

an integer indicating the trait to model, a trait name, or a function of the traits returning a single value. Only one trait can be modeled.

use

train model using phenotypes "pheno", genetic values "gv", estimated breeding values "ebv", breeding values "bv", or randomly "rand"

Vu

the additive genetic variance. Supplied with Ve, its ratio to Ve is where the REML search starts, or with estVarComp FALSE the value held fixed. See details.

Ve

the error variance. It is supplied together with Vu; see Vu.

varComp

an earlier fit of pedBLUP, whose Vu and Ve are taken in place of supplying them. Supply either varComp or Vu and Ve, not both.

simParam

an object of class SimParam. If NULL, the function uses the object named SP from the global environment.

...

additional arguments if using a function for traits

estVarComp

should the variance components be estimated by REML? TRUE, the default, estimates them, starting from Vu and Ve, or varComp, when they are supplied. FALSE holds the supplied values fixed and only solves the mixed model equations, so they must be supplied.

Value

Returns an object of PedSol-class

Details

The model is \(y = Xb + Zu + e\), where \(X\) has one column for each level of the population's fixEff slot, \(u \sim N(0, A \sigma^2_u)\) with \(A\) the numerator relationship matrix of the phenotyped individuals and all of their ancestors, and \(e \sim N(0, I \sigma^2_e)\). The relationships are those of pedigreeA, including its treatment of doubled haploids, inbred founders and polyploids. An individual with several records has a single breeding value, and no permanent environmental effect is fitted, so any non-additive genetic variance among repeated records is not separated from the additive variance.

The mixed model equations are built from the inverse of \(A\), which is sparse, and solved with the sparse Cholesky factorization of the Matrix package. Individuals with no Mendelian sampling variance, such as doubled haploids of inbred parents and F1s of two inbred parents, make \(A\) singular, and are written as exact functions of their parents rather than fitted separately.

Unless estVarComp is FALSE, the variance components are estimated by restricted maximum likelihood (REML) with the derivative-free approach of Graser et al. (1987) and Meyer (1989) : the error variance is profiled out of the likelihood, which is then maximized over the ratio of the error variance to the additive genetic variance. The search covers two orders of magnitude either side of a starting ratio: that of Ve to Vu when they are supplied, as an earlier fit in varComp or directly, and otherwise the ratio of the trait's default error variance to its additive genetic variance in the founder population, as set in the SimParam, or 1 when traits is a function, use is not "pheno" or the trait has no default error variance. An earlier fit to a population much like this one keeps the search centered near the estimate as the population moves away from the founders. The search takes as many steps from any start, so a start does not save time. The likelihood is evaluated on a grid of points across that range and then maximized near the best of them, so the estimate is the best found rather than a guaranteed global maximum, which makes little difference to the breeding values near the best ratio. A warning is given if the estimate is at the edge of the range.

An individual outside the fitted pedigree has no phenotyped descendants in the training population, so its best linear unbiased prediction is the average of its parents', which is what setEBV uses.

A fit is tied to the pedigree it was fitted to. Once resetPed discards any of its individuals, new individuals can take their internal IDs, so setEBV refuses the fit and the model must be fitted again. A reset that keeps every fitted individual does not affect it. For the same reason, pedBLUP and setEBV with its output need a SimParam created by this version of AlphaSimR or later, which records resets, and refuse one saved by an older version.

References

Graser H, Smith SP, Tier B (1987). “A derivative-free approach for estimating variance components in animal models by restricted maximum likelihood.” Journal of Animal Science, 64(5), 1362–1370. doi:10.2527/jas1987.6451362x .

Meyer K (1989). “Restricted maximum likelihood to estimate variance components for animal models with several random effects using a derivative-free algorithm.” Genetics Selection Evolution, 21(3), 317–340. doi:10.1186/1297-9686-21-3-317 .

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=20, nChr=1, segSites=20)

#Set simulation parameters
SP = SimParam$new(founderPop)
SP$setTrackPed(TRUE)
SP$addTraitA(10)
SP$setVarE(h2=0.5)

#Train on two generations
pop = newPop(founderPop, simParam=SP)
pop2 = randCross(pop, nCrosses=20, nProgeny=5, simParam=SP)
ans = pedBLUP(c(pop, pop2), simParam=SP)

#Predict a generation that was not in the training population
pop3 = randCross(pop2, nCrosses=20, simParam=SP)
pop3 = setEBV(pop3, ans, value="bv", simParam=SP)
cor(bv(pop3, simParam=SP), ebv(pop3))
#>        est_BV_Trait1
#> Trait1     0.4429597