Estimation of prediction error variances via Monte Carlo sampling methods using different formulations of the prediction error variance

Calculation of the exact prediction error variance covariance matrix is often computationally too demanding, which limits its application in REML algorithms, the calculation of accuracies of estimated breeding values and the control of variance of response to selection. Alternatively Monte Carlo sampling can be used to calculate approximations of the prediction error variance, which converge to the true values if enough samples are used. However, in practical situations the number of samples, which are computationally feasible, is limited. The objective of this study was to compare the convergence rate of different formulations of the prediction error variance calculated using Monte Carlo sampling. Four of these formulations were published, four were corresponding alternative versions, and two were derived as part of this study. The different formulations had different convergence rates and these were shown to depend on the number of samples and on the level of prediction error variance. Four formulations were competitive and these made use of information on either the variance of the estimated breeding value and on the variance of the true breeding value minus the estimated breeding value or on the covariance between the true and estimated breeding values.


Introduction
In quantitative genetics the prediction error variance-covariance matrix is central to the calculation of accuracies of estimated breeding values ( ) [e.g. [1]], to REML algorithms for the estimation of variance components [2], to methods which restrict the variance of response to selec-tion [3], and can be used to explore trends in Mendelian sampling deviations over time [4]. The mixed model equations (MME) for most national genetic evaluations range from 100,000 to 20,000,000 equations and inversion of systems of equations of this size is generally not possible because of their magnitude or because of loss of numerical precision [5]. Methods that approximate the prediction error variances (PEV) and calculate the accuracy of provide biased estimates in some circumstances by ignoring certain information [e.g. [6]]. Variance components upon which genetic evaluations of large populations are based are generally estimated using reduced data sets. The use of reduced data sets may create bias in the estimates as REML only provides unbiased estimates of variance components when all the data on which selection has taken place is included in the analysis [7]. Variance of response to selection is generally not controlled in breeding programs although it might be a risk to them [3].
Approximations of the PEV without needing to invert the coefficient matrix or to delete data, can be obtained by comparing Monte Carlo samples of the data and successive solutions of the mixed model equations of this data.
However different formulations have been presented to approximate the PEV in this way [8][9][10][11]. Approximations of the PEV using these formulations converge to the exact PEV (PEV exact ) as the number of Monte Carlo samples increases, but the number of samples is generally limited by computational requirements in practice [e.g. [12]]. Also, differences in the rates of convergence have been shown to depend on the level of PEV exact for a given genetic variance ( ) [10]. Consequently, when finding the optimal number of iterations required, both the different formulations, and the level of PEV exact need to be taken into account. Some of the formulations are weighted averages of other formulations, with the weighting depending on the sampling variances of these. Garcia-Cortes et al. [10] use asymptotic approximations of these sampling variances. Alternative weighting strategies could use empirically approximated sampling variances based on independent replicates of samples or using leave-one-out Jackknife procedures [13,14].
The objective of this study was to compare the convergence to PEV exact of ten different formulations of the PEV, using simulations based on data and pedigree from a commercial population containing animals with different levels of PEV and using different numbers of samples (n = 50, 100, ..., 950, 1000). Four of the formulations were previously published, four were alternative versions of these, and two were derived as part of this study.

Monte Carlo sampling procedure for calculating PEV
The Monte Carlo sampling procedure for calculating the sampled PEV has been described extensively elsewhere for single breed [8][9][10] and multiple breed scenarios [12]. Assuming a simple additive genetic animal model without genetic groups y = Xb + Zu + e, where the distribution of random variables is y ~ N(Xb, ZGZ' + R), u ~ N(0, G), and e ~ N(0, R), the three steps involved in calculating the sampled PEV are as follows: 1. Simulate n samples of y and u using the pedigree and the distributions of the original data, modified to account for the fact that the expectation of Xb does not affect the distribution of random variables [15,16] thus the samples of y can be simulated using random normal deviates from N(0, ZGZ' + R) instead of N(Xb, ZGZ' + R). 2. Set up and solve the mixed model equations for the data set using the n simulated samples of y instead of the true y. This accounts for the fixed effects structure of the real data. 3. Calculate the sampled PEV for some formulation.

Formulations of PEV
Ten formulations of the sampled PEV are shown in Table  1. The first three formulations (PEV GC1 , PEV GC2 , and PEV GC3 ) were outlined by Garcia-Cortes et al. [10] and the fourth formulation (PEV FL ) was outlined by Fouilloux and Laloë [8]. PEV AF1 , PEV AF2 , PEV AF3 , and PEV AF4 are alternative versions of these formulations, which rescale the formulations from the Var (u) and to the in order to account for the effects of sampling on the Var(u). Two new formulations of the sampled PEV (PEV NF1 , and PEV NF2 ) are also given in Table 1. The ten formulations differ from each other in the way in which they compare information relating to the Var(u), the Var( ), the Var (u -), or the Cov(u, ).

Approximation of sampling variance of PEV
Formulae, based on Taylor series approximations, to predict the asymptotic sampling variances for each of the ten formulations of sampled PEV at different levels of PEV exact are given in Table 1. The sampling variance can also be approximated stochastically using a number (e.g. 100) of independent replicates of the n samples or by applying a leave-one-out Jackknife [13,14] to the n samples. Based on the classical formulation of the accuracy of an EBV 10 Implicitly weighs information on Var ( ) and Var(u, ) and corrects for Var(u) ≠ 11 No assumption made about the relationship between Var( )and Cov(u, )

Calculation of exact PEV
The PEV exact were calculated for the extracted data set by setting up and solving the MME, with fixed effects of contemporary group, technician who scored the animal, parity of dam, and a second order polynomial of age of animal at scoring nested within sex, and random animal and residual effects, using the BLUP option in ASReml [17] which fully inverts the left hand side of the MME.

Sampled PEV
Following the Monte Carlo sampling procedure described above, 100,000 samples of the extracted data set were simulated assuming a of 1.0 and of 3.0. For each of the simulated data sets MME, using the same design matrix (X) as used when estimating the PEV exact , were set up and solved using MiX99 [18]. The sampled PEV of the for each animal in the pedigree was approximated using the formulations of the sampled PEV described in Table 1 using n samples (n = 50, 100, ..., 950, 1000).
Stochastic approximations of the sampling variance of the sampled PEV were calculated using 100 independent replicates of the n samples, and using the leave-one-out Jackknife on n samples, for the different formulations, with the exception of PEV GC3 and PEV AF3 . To calculate the sampling variance for PEV GC3 and PEV AF3 using n independent replicates would have required more than 100,000 samples (due to the need to generate sampling variances of component formulations) generated for this study so therefore these were not considered. Asymptotic sampling variances for all ten formulations were calculated using the formulae in Table 1.

Alternative weighting strategies
Of the formulations presented in Table 1, PEV GC3 and PEV AF3 are weighted averages of PEV GC1 and PEV GC2 and of PEV AF1 and PEV AF2 respectively with the weighting dependent on the sampling variances of the component formulations. Garcia-Cortes et al. [10] suggest weighting by asymptotic approximations of the sampling variances. The sampling variances could also be approximated empirically using independent replicates of n samples or by leave-one-out Jackknife procedures [13,14]. These alternative weighting strategies were compared by calculating sampling variances using 100 independent replicates of the n samples, using the n samples and a leaveone-out Jackknife procedure [14], and using the asymp-totic sampling variances outlined in Table 1 as part of an iterative procedure, which involved two iterations. In the first iterations the asymptotic sampling variances were calculated using the PEV GC1 and PEV GC2 of the component formulations, in the second they used the PEV GC3 approximated in the first iteration.

Calculation of required variances and covariances
It was not possible to store each of the 100,000 simulated values for each of the 50,435 animals in the main memory of the computer simultaneously meaning that textbook formulae to calculate the different variances and covariances required for the different formulations was not possible. Textbook updating algorithms to calculate the variance can be numerically unreliable [19]. Instead the required variances were calculated using a one pass updating algorithm based on Chan et al. [19] which updates the estimated sum of squares with a new record as it reads through the data and takes the form: where n are the number samples at any stage in the updating procedure and T and S are the sum and sum of squares of the data points 1 through n. It was modified to calculate the covariances between X and Y by changing to . Both of these algorithms were tested using one replication of 100,000 samples and found to be stable.

Results
As the was taken to be 1.0, the PEV ranged between 0.00 and 1.0. For the purpose of categorizing the results PEV with values between 0.00 and 0.33 were regarded as low, values between 0.34 and 0.66 were regarded as medium, and values between 0.67 and 1.00 were regarded as high.
Henderson [20] showed that it is much easier to form A -1 than A, where A is the numerator relationship matrix among animals. This follows from the fact that, if the individuals are listed with ancestors above descendants, A can be written as TMT' where M is a diagonal matrix and T is a lower triangular matrix with non-zero diagonal ele-

General trends of sampled PEV
While all different formulations of the sampled PEV converged to the PEV exact and the sampling variance of the PEV reduced as the number of samples (n) increased, convergence rates differed between the formulations. For example, PEV GC2 converged at a slower rate than all other formulations when the convergence rate was measured by the correlation between PEV exact and sampled PEV (Fig. 1). PEV GC1 , PEV AF3 , PEV AF4 , and PEV NF2 , all converged at a very similar rates and had the best convergence across all formulations.
As well as depending on the numbers of samples, the convergence rate also depended on the level of the PEV exact . The sampled PEV calculated using different formulations had different sampling variances and within each formulation the sampling variances differed depending on the level of the PEV exact (Fig. 2). Of the previously published formulations PEV GC1 and PEV FL had low sampling variance at high PEV exact , with PEV GC1 being better than PEV FL . PEV GC2 had low sampling variance at low PEV exact . Accounting for the effects of sampling on the Var(u) reduced the sampling variance in regions where the previously published formulations had high sampling variances but had little (or even slightly negative) effect where these formulations had low sampling variances. PEV AF4 , which is the alternative version of PEV FL gave major improvements in terms of sampling variance low and intermediate PEV exact . Its performance was almost identical to PEV NF2 , PEV AF3 , and PEV GC3 , which had low sam-

Comparison of formulations
Different formulations were compared in greater detail using n = 300 samples (Table 2), which is a practical number of samples. PEV GC3 , PEV AF3 , PEV AF4 , and PEV NF2 were the best formulations across all of the ten formulations. The slopes and R 2 of their regressions were always among the best where PEV exact was low, intermediate, or high ( Table 2). These formulations gave good approximations at both high and low PEV exact their performance was less good at intermediate PEV, measured by each of the summary statistics (Table 2).
PEV GC1 and PEV FL gave good approximations for high PEV exact and poor approximations for low PEV exact . PEV GC2 gave good approximations for low PEV exact and poor approximations for high PEV exact . Improving the published formulations by correcting for the effects of sampling resulted in better approximations in areas where the published formulations were weak. Slight (dis)improvements were observed where the previously published formulations were strong. Of the new formulations PEV NF1 gave poor approximations and PEV NF2 gave good approximations.
Using the three alternative weighting strategies to combine the component formulations for PEV GC3 and PEV AF3 gave almost identical results (Table 3).

Required number of samples
The formulations PEV GC3 , PEV AF3 , PEV AF4 , and PEV NF2 gave similar approximations and had the lowest sampling variance. Even when a few samples (n = 50) were used, Sampling variances of sampled prediction error variance approximated asymptotically (As) and empirically 1 (Em) using different formulations of the prediction error variance using 300 samples for different levels of exact prediction error variance

Differences between formulations
Ten different formulations of the PEV approximated using sampling were compared and these were each shown to converge to the PEV exact at different rates. Within each of these formulations differences in convergence were observed at different levels of PEV exact . PEV GC1 and its corresponding alternative formulation PEV AF1 make use of information on the Var( ). PEV GC2 and its corresponding alternative formulation PEV AF2 makes use of information on the Var(u -). The sampling variance of the Var( ) is lower at high PEV exact than it is at low PEV exact (Fig. 3), therefore the formulations using information on the Var( ) are more suited to approximating high PEV exact than to low PEV exact . The opposite is the case for formula-   fied. These gave similar approximations. Of the four, two, PEV GC3 and PEV AF3 , were weighted averages of component formulations. The weighting was based on the sampling variances of their component formulations. These sampling variances can be calculated using a number of independent replicates, using Jackknife procedures, or asymptotically. Each of these approaches gave almost identical results but the Jackknife and asymptotic approaches were far less computationally demanding.

Computational time
A single BLUP evaluation for the routine Irish multiple breed beef genetic cattle evaluation (January 2007) which included a pedigree of 1,500,000 and 493,092 animals with performance records on at least one of the 15 traits could be run using MiX99 [18] in 366 min on a 64 bit PC, with a 2.40 GHz AMD Opteron dual-core processor and 8 gigabytes of RAM [12]. Using n = 300 samples and PEV NF2 the accuracy of the estimated breeding values could be estimated in 1,830 hours on a single processor. Several samples can be solved simultaneously on multiple processors thereby reducing computer time. Nowadays PC's are available that contain two quad core 64 bit processors (i.e. 8 CPU's) and cost approximately 5,000 euro. Using six of these PC's the accuracy of estimated breeding values for the Irish data set could be estimated in less than 38.1 h.

Application
The Monte Carlo sampling approach using one of these four competitive formulations can be used to improve many tasks in animal breeding. Stochastic REML algorithms [e.g. [9]] can be improved in terms of speed of calculation using these formulations, therefore allowing variance components to be estimated using REML in large data sets. These REML formulations are usually written in terms of additive genetic effects u'A -1 u and trace [A -1 PEV], where PEV is the prediction error covariance matrix for the estimated breeding values. The results of Henderson [22] show how the REML formulations can be equivalently written as in terms of Mendelian sampling effects m m'A -1 m and trace [A m -1 PEV m ], where PEV m is the prediction error covariance matrix for the Mendelian sampling effects. As A m is diagonal we see that we only need to compute the sampling variances of the Mendelian sampling terms. When the sampling was carried out in this study we, in error, did not correct the Mendelian sampling terms for inbreeding. We therefore have only reported results for non-inbred animals and think that the incorrect generation will have a minimal effect on the sampling variances, which are presented as an empirical check on the formulae. There may be circumstances where a Stochastic REML approach may be faster than Gibbs sampling and have less bias than Method R [23]. Calculating variance components using more complete data sets would facilitate a reduction in the bias of estimated variance components caused by the ignoring of data on which selection has taken place in the population [12], due to computational limitations. Calculation of unbiased accuracy of within breed [8] and across breed [12] estimated breeding values can be improved by reducing the computational time required of calculation or reducing the sampling error for a given computational time. Application of an algorithm controlling the variance of response to selection [24] to large data sets can be speeded up. The variance of response to selection is a risk to breeding programs [3], which is generally not explicitly controlled using the approach outlined by Meuwissen [24] due to the inability to generate a prediction error (co)variance matrix for large data sets.
Computational power is a major limitation of stochastic methods, particularly when large data sets are involved, however this is dissipating rapidly with the improvement in processor speed, parallelization, and the adoption of 64-bit technology, however in the meantime deterministic methods will continue to be used for large scale BLUP analysis.

Conclusion
PEV approximations using Monte Carlo estimation were affected by the formulation used to calculate the PEV. The difference between the formulations was small when the number of samples increased, but differed depending on the level of the exact PEV and the number of samples. Rescaling from the scale of Var(u) to the scale of improved the approximation of the PEV and four of the 10 formulations gave the best approximations of PEV exact thereby improving the efficiency of the Monte Carlo sampling procedure for calculating the PEV. The fewer sam-