To accomplish this, we simply add a term ide(dam) to the random part of the model. The
ide() function specifies that a factor that we have previously defined as a pedigree factor (and so normally has a variance-covariance structure proportional to the A matrix computed from the pedigree information) should be fit without the pedigree information. So, we fit the dam effect twice in this model, once where the random dam effects have breeding values with covariances determined by coancestries, and a second time where the random dam effects have no covariances and an IDV structure. This second term corresponds to the maternal environment effects, since it includes any maternal effects that cannot be associated with the pedigree relationships:
Code example 4.5: Animal model for pig data, continued (Code04-‐5_AnimalModel.as)