Mathematical Formulation:
The GW-LMSI maximizes the correlation between the index
\(I_{GW} = \mathbf{b}_{GW}^{\prime}\mathbf{m}\) and the breeding
objective \(H = \mathbf{w}^{\prime}\mathbf{g}\).
Marker covariance matrix:
$$\mathbf{P}_{GW} = Var(\mathbf{m})$$
Covariance between markers and traits:
$$\mathbf{G}_{GW} = Cov(\mathbf{m}, \mathbf{g})$$
Index coefficients (with optional Ridge regularization):
$$\mathbf{b}_{GW} = (\mathbf{P}_{GW} + \lambda \mathbf{I})^{-1} \mathbf{G}_{GW} \mathbf{w}$$
Accuracy:
$$\rho_{HI} = \sqrt{\frac{\mathbf{b}_{GW}^{\prime} \mathbf{G}_{GW} \mathbf{w}}{\mathbf{w}^{\prime} \mathbf{G} \mathbf{w}}}$$
Selection response:
$$R_{GW} = k \sqrt{\mathbf{b}_{GW}^{\prime} \mathbf{P}_{GW} \mathbf{b}_{GW}}$$
Expected genetic gain per trait:
$$\mathbf{E}_{GW} = k \frac{\mathbf{G}_{GW}^{\prime} \mathbf{b}_{GW}}{\sigma_{I_{GW}}}$$
Note on Singularity Detection and Regularization:
The function automatically detects problematic cases:
1. **High-dimensional case**: When n_markers > n_genotypes, P_GW is mathematically
singular (rank-deficient). The function issues a warning and suggests an
appropriate lambda value.
2. **Ill-conditioned case**: When P_GW has a high condition number (> 1e10),
indicating numerical instability.
3. **Numerical singularity**: When P_GW has eigenvalues near zero.
Ridge regularization adds \(\lambda\)I to P_GW, ensuring positive definiteness. Recommended
lambda values are 0.01-0.1 times the average diagonal element of P_GW. Users can
also set lambda = 0 to force generalized inverse (less stable but sometimes needed).