Technical Thoughts

寿命的概率

在电影《搏击俱乐部》中,有一句著名的台词:On a long enough time line, the survival rate for everyone drops to zero。 事实上,在统计数据的加持下,我们可以计算从任何年龄开始,活到特定年龄的survival rate。也可以在此基础上,进一步计算例如失独,英年早逝,中年丧偶,白发人送黑发人,子欲养而亲不待等等人生悲剧的概率。当我们对多种寿命概率有了清晰的认知,我们就可以适当地调整生活各个阶段的不同工作的优先级。

寿命的概率(附录)

lifetable Life Probability Simulation¶ In [1]: import numpy as np mortality rate from here¶ In [22]: def get_mortality(age, gender): if gender in (“Male”, “male”, “m”, “M”): age_thresholds = [(4, 25.5), (14, 16.1), (24, 121.9), (34, 221.1), (44, 325.5), (54, 601.5), (64, 1323.3), (74, 2581), (84, 5937), (float(‘inf’), 16354)] elif gender in (“Female”, “female”, “f”, “F”): age_thresholds = …

寿命的概率(附录) Read More »

Scroll to Top