rzshrote / pybrops

Python Breeding Optimizer and Simulator: A Python library for simulating and optimizing breeding pipelines.
https://rzshrote.github.io/pybrops/
MIT License
2 stars 1 forks source link

GEBV calculation from additive linear genomic model may occasionally induce NaN values #75

Closed rzshrote closed 1 year ago

rzshrote commented 1 year ago

Not sure about the origin of this bug. Was using algmod.gebv(pgmat).descale().sum(1).mean() and a NaN was introduced. This bug cannot be easily replicated.

rzshrote commented 1 year ago

I believe this is caused by the DenseBreedingValueMatrix class when it centers and scales breeding values. If the scale is zero (caused by fixation of all alleles), this causes a division by zero error and induces a NaN value.