Skip to content
Snippets Groups Projects
Commit 90d8ba7e authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Move loading to the very end of the calculations

parent c4898212
No related branches found
No related tags found
No related merge requests found
......@@ -68,9 +68,9 @@ setMethod("deathProbabilities","mortalityTable.improvementFactors",
#' life table given the birth year (if needed)
setMethod("deathProbabilities","mortalityTable.mixed",
function (object, ..., YOB = 1975) {
qx1 = deathProbabilities(object@table1, ..., YOB) * (1 + object@loading);
qx2 = deathProbabilities(object@table2, ..., YOB) * (1 + object@loading);
mixedqx = (object@weight1 * qx1 + object@weight2 * qx2)/(object@weight1 + object@weight2);
qx1 = deathProbabilities(object@table1, ..., YOB);
qx2 = deathProbabilities(object@table2, ..., YOB);
mixedqx = (object@weight1 * qx1 + object@weight2 * qx2)/(object@weight1 + object@weight2) * (1 + object@loading);
object@modification(mixedqx)
})
......@@ -62,9 +62,9 @@ setMethod("periodDeathProbabilities", "mortalityTable.improvementFactors",
#' of the life table for a given observation year
setMethod("periodDeathProbabilities", "mortalityTable.mixed",
function (object, ..., Period = 1975) {
qx1 = periodDeathProbabilities(object@table1, ..., Period = Period) * (1 + object@loading);
qx2 = periodDeathProbabilities(object@table2, ..., Period = Period) * (1 + object@loading);
mixedqx = (object@weight1 * qx1 + object@weight2 * qx2) / (object@weight1 + object@weight2);
qx1 = periodDeathProbabilities(object@table1, ..., Period = Period);
qx2 = periodDeathProbabilities(object@table2, ..., Period = Period);
mixedqx = (object@weight1 * qx1 + object@weight2 * qx2) / (object@weight1 + object@weight2) * (1 + object@loading);
object@modification(mixedqx)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment