Livestock Improvement Corporation, Private Bag 3016, Hamilton, 3240, New Zealand.
BMC Genet. 2020 Sep 3;21(1):97. doi: 10.1186/s12863-020-00881-z.
R package mbend was developed for bending symmetric non-positive-definite matrices to positive-definite (PD). Bending is a procedure of transforming non-PD matrices to PD. The covariance matrices used in multi-trait best linear unbiased prediction (BLUP) should be PD. Two bending methods are implemented in mbend. The first is an unweighted bending with small positive values in a descending order replacing negative eigenvalues (LRS14), and the second method is a weighted (precision-based) bending with a custom small positive value (ϵ) replacing smaller eigenvalues (HJ03). Weighted bending is beneficial, as it relaxes low precision elements to change and it reduces or prohibits the change in high precision elements. Therefore, a weighted version of LRS14 was developed in mbend. In cases where the precision of matrix elements is unknown, the package provides an unweighted version of HJ03. Another unweighted bending method (DB88) was tested, by which all eigenvalues are changed (eigenvalues less than ϵ replaced with 100 × ϵ), and it is originally designed for correlation matrices.
Different bending procedures were conducted on a 5 × 5 covariance matrix (V), V converted to a correlation matrix (C) and an ill-conditioned 1000 × 1000 genomic relationship matrix (G). Considering weighted distance statistics between matrix elements before and after bending, weighting considerably improved the bending quality. For weighted and unweighted bending of V and C, HJ03-4 (HJ03, ϵ = 10) performed the best. HJ03-2 (HJ03, ϵ = 10) ranked better than LRS14 for V, but not for C. Though the differences were marginal, LRS14 performed the best for G. DB88-4 (DB88, ϵ = 10) was used for unweighted bending and it ranked the last. This method could perform considerably better with a lower ϵ.
R package mbend provides necessary tools for transforming symmetric non-PD matrices to PD, using different methods and parameters. There were benefits in both weighted bending and small positive values in a descending order replacing negative eigenvalues. Thus, weighted LRS14 was implemented in mbend. Different bending methods might be preferable for different matrices, depending on the matrix type (covariance vs. correlation), number and the magnitude of negative eigenvalues, and the matrix size.
mbend 包是为将对称非正定矩阵弯曲为正定(PD)而开发的。弯曲是将非 PD 矩阵转换为 PD 的过程。多性状最佳线性无偏预测(BLUP)中使用的协方差矩阵应该是 PD。mbend 中实现了两种弯曲方法。第一种是按降序用较小的正值替换负特征值的无权重弯曲(LRS14),第二种方法是用自定义小正值(ϵ)替换较小特征值的加权(基于精度)弯曲(HJ03)。加权弯曲是有益的,因为它可以放宽对低精度元素的改变,减少或禁止高精度元素的改变。因此,mbend 中开发了一种加权版本的 LRS14。在矩阵元素精度未知的情况下,该软件包提供了 HJ03 的无权重版本。还测试了另一种无权重弯曲方法(DB88),其中所有特征值都发生了变化(特征值小于ϵ的替换为 100×ϵ),它最初是为相关矩阵设计的。
在一个 5×5 协方差矩阵(V)、V 转换为相关矩阵(C)和一个病态的 1000×1000 基因组关系矩阵(G)上进行了不同的弯曲过程。考虑到弯曲前后矩阵元素之间的加权距离统计,加权显著提高了弯曲质量。对于 V 和 C 的加权和无权重弯曲,HJ03-4(HJ03,ϵ=10)表现最佳。对于 V,HJ03-2(HJ03,ϵ=10)优于 LRS14,但对于 C 则不然。虽然差异很小,但 LRS14 对 G 的表现最佳。DB88-4(DB88,ϵ=10)用于无权重弯曲,排名最后。这个方法使用较小的 ϵ 可以表现得更好。
mbend R 软件包提供了将对称非 PD 矩阵转换为 PD 的必要工具,使用不同的方法和参数。加权弯曲和按降序用较小的正值替换负特征值都有好处。因此,mbend 中实现了加权版本的 LRS14。不同的弯曲方法可能更适合不同的矩阵,具体取决于矩阵类型(协方差与相关)、负特征值的数量和大小以及矩阵大小。