The function is intended for post-processing models fitted with mmes, allowing prediction error variances or the complete inverse of the mixed model coefficient matrix to be calculated only when they are needed.
When mode = 1, the sparse mixed model coefficient matrix stored in the fitted object is factorized and the Takahashi equations are used to obtain the selected elements of its inverse required for the diagonal prediction error variances. The complete inverse is not formed.
When mode = 2, the complete inverse of the mixed model coefficient matrix is computed. The prediction error variances are then obtained from the corresponding diagonal elements of this inverse.
When mode = 0, no matrix factorization or inverse calculation is performed and previously stored inverse-derived results are cleared.
predict.mmes does not require any particular mode: it computes exact standard errors for arbitrary linear combinations of fixed and random effects directly from the stored coefficient matrix C, without using Ci at all (see predict.mmes for details). postPEV() is only needed when the diagonal prediction error variances (uPevList) or the complete inverse (Ci) are wanted for their own sake.
For the sampling variance of the BLUP itself, use postVarU:
\(\operatorname{Var}(\hat u)=G-\operatorname{Var}(u-\hat u)\).
PEV and BLUP sampling variance are different quantities. Neither includes
uncertainty from estimating covariance parameters. postVarU() leaves
existing PEV outputs unchanged.
For this post-fit calculation to be available, fit the mmes model with
control = mmes_control(output = list(coefficientMatrix = TRUE)) so the
final coefficient matrix is retained. Models can use
control$output$inverse = 0 during fitting, then calculate PEVs or the
complete inverse afterwards only if required.