用 R 评估人寿保险产品
Roel Verbelen, Ph.D.
Statistician, Finity Consulting
记:$v(s,t)$ 为在时点 $s$ 收到于时点 $t$ 支付的 1 欧元的价值。
$s < t$:贴现因子

记:$v(s,t)$ 为在时点 $s$ 收到于时点 $t$ 支付的 1 欧元的价值。
$s > t$:累积因子

i <- 0.03
v <- 1 / ( 1 + i)
当 $s<t$:如 $s=2$、$t=4$
s <- 2
t <- 4
# v(2, 4) = value at time 2 of 1 EUR paid at time 4
v ^ (t - s)
0.9425959
(1 + i) ^ - (t - s)
0.9425959
i <- 0.03
v <- 1 / ( 1 + i)
当 $s>t$:如 $s=6$、$t=3$
s <- 6
t <- 3
# v(6, 3) = value at time 6 of
# 1 EUR paid at time 3
v ^ (t - s)
1.092727
(1 + i) ^ - (t - s)
1.092727
$$ \sum_{k=0}^N c_k \cdot v(n,k) $$
$\qquad$ 其中 $0 \leq n \leq N$。





# Define the discount function
discount <- function(s, t, i = 0.03) {(1 + i) ^ - (t - s)}
# Calculate the value at time 3
value_3 <- 500 * discount(3, 0) + 300 * discount(3, 2) + 200 * discount(3, 7)
value_3
1033.061
# Define the discount function
discount <- function(s, t, i = 0.03) {(1 + i) ^ - (t - s)}
# Define the cash flows
cash_flows <- c(500, 0, 300, rep(0, 4), 200)
# Calculate the value at time 3
sum(cash_flows * discount(3, 0:7))
1033.061
用 R 评估人寿保险产品