Commit 15e4e74b authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Include global state in pension tables (only transition is to death)

parent 8abb125b
......@@ -71,8 +71,8 @@ pensionTableProbArrange = function(x, q, i, qi, r, ap, api, qp, h, qw, yx, qg, a
if (as.data.frame) {
data.frame(x, q, i, qi, r, ap, api, qp, h, qw, yx, qg)
} else {
states = c("a", "i", "p", "d")
transProb = array(0, dim = c(4,4, length(x)), dimnames = list(states, states, x))
states = c("a", "i", "p", "d", "g")
transProb = array(0, dim = c(5,5, length(x)), dimnames = list(states, states, x))
transProb["a", "a", ] = (1 - i - q) * (1 - ap);
transProb["a", "i", ] = i;
......@@ -89,6 +89,9 @@ pensionTableProbArrange = function(x, q, i, qi, r, ap, api, qp, h, qw, yx, qg, a
transProb["d", "d", ] = 1;
transProb["g", "d", ] = qg;
transProb["g", "g", ] = 1 - qg;
list(transitionProbabilities = transProb, widows = data.frame(x, h, qw, yx))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment