You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #14 , there's a fair amount of code duplication across a few Rage functions:
makeLifeTable, dEntropy, and kEntropy all use the same loop to calculate survivorship. I believe the loop within longevity is mathematically equivalent (it's finding the age where lx = 0.01), though coded a bit differently.
makeLifeTable and dEntropy use the same loops to calculate age-specific fertility (mx) and clonality (cx).
To avoid some of this duplication and make for easier code maintainability, we could perhaps pull some of the duplicated sections into separate internal functions that get called by the user-facing functions when required.
Alternatively, we could keep the lx/mx/cx functions within makeLifeTable, and then re-work dEntropy and kEntropy so that they take a life table or life table components as arguments, instead of transition matrices.
The text was updated successfully, but these errors were encountered:
Related to #14 , there's a fair amount of code duplication across a few Rage functions:
makeLifeTable
,dEntropy
, andkEntropy
all use the same loop to calculate survivorship. I believe the loop withinlongevity
is mathematically equivalent (it's finding the age where lx = 0.01), though coded a bit differently.makeLifeTable
anddEntropy
use the same loops to calculate age-specific fertility (mx) and clonality (cx).To avoid some of this duplication and make for easier code maintainability, we could perhaps pull some of the duplicated sections into separate internal functions that get called by the user-facing functions when required.
Alternatively, we could keep the lx/mx/cx functions within
makeLifeTable
, and then re-workdEntropy
andkEntropy
so that they take a life table or life table components as arguments, instead of transition matrices.The text was updated successfully, but these errors were encountered: