Missing values are replaced by the column (marker) mean. At least two individuals and one variable marker surviving the frequency filter are required. Genotypes must lie in \([-1,1]\) by default, or \([0,P]\) for explicit ploidy \(P\); a marker with no observed genotypes cannot be imputed.
For the VanRaden method, let \(p_k\) be the column mean of \((X+1)/2\) for each retained marker and \(W_{ik}=X_{ik}+1-2p_k\). Then \(A=WW'/c\), where \(c=2\sum_k p_k(1-p_k)\).
For explicit ploidy \(P\), let \(p_k\) be the column mean of
\(X/P\) and \(W_{ik}=X_{ik}-Pp_k\). The additive relationship matrix
is \(A=WW'/c\), where \(c=P\sum_k p_k(1-p_k)\). This uses the
binomial allele-dosage variance and does not model double reduction.
The returned imputed matrix retains the input dosage scale.
method="ASV" uses the column-centered retained marker matrix
\(W=X-1_n\bar x'\) and computes
$$A_{\mathrm{ASV}} =
\frac{WW'}{\mathrm{tr}(WW')/(n-1)}.$$
The denominator is the sum of sample variances of the retained markers,
not the expected allele-dosage variance used by VanRaden. For
\(P_n=I_n-1_n1_n'/n\), this gives
\(\mathrm{tr}(P_n A_{\mathrm{ASV}})/(n-1)=1\); equivalently, the
average over unordered pairs of
\((A_{ii}+A_{jj}-2A_{ij})/2\) equals one.
The mean diagonal is \((n-1)/n\), not one.
ASV changes the scale, not the relative relationships, of the unshrunken
VanRaden matrix computed from the same markers. It does not add
regularization or make a rank-deficient matrix invertible.
The normalization is invariant to a common shift or nonzero scale
change of all marker dosages, including equivalent diploid and
polyploid codings. Explicit ploidy is still needed to interpret allele
frequencies correctly for filtering. The paper describes diploid coding;
applying its same centered-crossproduct formula to polyploid dosage
data is a natural extension.
Mean imputation is explicit. Earlier implementations inadvertently used the imputation helper's default median despite reporting mean imputation; results with missing genotypes can therefore differ.
shrink=TRUE is intended for lower-density marker data. For the
\(m\) retained markers, let \(\mu_i\) be the row mean of \(W\),
\(Z=W-\mu 1_m'\), \(S=ZZ'/m\), and
\(T=\mathrm{tr}(S)I_n/n\). Estimate
$$\hat b^2 = \frac{1}{m^2}\sum_{k=1}^{m}
\|z_k z_k' - S\|_F^2,\qquad
\hat d^2 = \|S-T\|_F^2,$$
where \(z_k\) is column \(k\) of \(Z\). The intensity
\(\delta\) is \(\hat b^2/\hat d^2\) clipped to \([0,1]\).
If \(\hat d^2=0\), the covariance already equals its target and the
intensity is reported as zero. The result is
$$A_{\mathrm{EJ}} =
\frac{(1-\delta)S+\delta T+\mu\mu'}{c/m}.$$
This preserves the mean diagonal of the unshrunken relationship matrix.
It is not generally equivalent to blending the unshrunken matrix with
the identity: the row-mean contribution is retained without shrinkage.
The same estimator applies to explicit ploidy using its dosage-based
\(W\) and \(c\).
Shrinkage is deterministic and uses the same mean imputation, strict
MAF cutoff and constant-marker removal as the unshrunken path.
The EJ calculation matches rrBLUP for the same retained and imputed
markers. rrBLUP has different default MAF/missingness filters and also
offers EM imputation; these options are not added here.