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

commutationNumbers: Fix missing qx assignment; pension tables need to add qx...

commutationNumbers: Fix missing qx assignment; pension tables need to add qx and ix probabilities for actives
parent 02733659
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ setMethod("commutationNumbers", "mortalityTable", ...@@ -31,6 +31,7 @@ setMethod("commutationNumbers", "mortalityTable",
setMethod("commutationNumbers", "numeric", setMethod("commutationNumbers", "numeric",
function(object, ages, i = 0.03) { function(object, ages, i = 0.03) {
v = 1/(1 + i) v = 1/(1 + i)
qx = object
lx = cumprod(c(100000, 1 - object[-length(object)])) lx = cumprod(c(100000, 1 - object[-length(object)]))
dx = -diff(c(lx, 0)) dx = -diff(c(lx, 0))
Dx = v^ages * lx Dx = v^ages * lx
...@@ -52,7 +53,7 @@ setMethod("commutationNumbers", "pensionTable", ...@@ -52,7 +53,7 @@ setMethod("commutationNumbers", "pensionTable",
probs = transitionProbabilities(object, ...) probs = transitionProbabilities(object, ...)
ages = probs$x ages = probs$x
list( list(
q = commutationNumbers(probs$q, ages = ages, i = i), q = commutationNumbers(probs$q + probs$i, ages = ages, i = i),
qi = commutationNumbers(probs$qi, ages = ages, i = i), qi = commutationNumbers(probs$qi, ages = ages, i = i),
qp = commutationNumbers(probs$qp, ages = ages, i = i), qp = commutationNumbers(probs$qp, ages = ages, i = i),
qw = commutationNumbers(probs$qw, ages = ages, i = i), qw = commutationNumbers(probs$qw, ages = ages, i = i),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment