mean_age_population returns NaN when w has entries equal to zero
>>> cm = mpm.compadre.fetch("COMPADRE")
>>> m = cm.get_from_id(248193)
>>> m
MPM(
S = [[0.43, 0. , 0. , 0. , 0. , 0. ],
[0.29, 0.44, 0. , 0. , 0. , 0. ],
[0.01, 0.42, 0.69, 0. , 0. , 0. ],
[0. , 0. , 0.22, 0.22, 0. , 0. ],
[0. , 0. , 0. , 0. , 0.85, 0. ],
[0. , 0. , 0. , 0.71, 0.06, 0.85]],
F = [[0. , 0. , 0.82, 1.34, 1.93, 2.37],
[0. , 0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. , 0. ]],
...
)
>>> m.mean_age_population
nan
This is because mean_age_population
is implemented as
self._mean_age_population = self.mean_age_class @ self.w
and that when wi, the mean age in class i is nan
-- as should be the case. However, since this class does not contribute to the asymptotic constitution of the population, the fact that the mean age is not defined in it should not matter.
Edited by François Bienvenu