Estimating the heritability by decomposing the genetic variance