儲蓄計畫的存款
現在你已經定義好變數 discount_factors、deposits 和 payments,可以利用存款(紅色現金流)與付款(藍色現金流)之間的精算等價關係,來決定每年儲蓄存款的金額 $K$。
本練習屬於課程
以 R 估值人壽保險商品
練習說明
- 將
deposits與discount_factors逐項相乘後再以sum()加總,計算存款型態的現值。 - 將
payments與discount_factors相乘並加總,計算付款型態的現值。 - 依據精算等價的概念,前 4 年的每年存款
K可由PV_payment除以PV_deposit得到。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate the present value of the deposits
PV_deposit <- ___(___ * ___)
# Calculate the present value of the payments
PV_payment <- ___(___ * ___)
# Calculate the yearly deposit K in the first 4 years
K <- ___
K