Learn R Programming

valuer (version 1.1.2)

penalty_class: Surrender penalty class

Description

Class providing a surrender charge. It supports a constant surrender charge (type 1) and two surrender charges decreasing with time, (type 2 and type 3).

Usage

penalty_class

Arguments

Value

Object of R6Class

Format

R6Class object.

Methods

new

Initialization methods with arguments:

type

type of the surrender charge. It can be 1 (constant) or 2 or 3 (decreasing with time).

const

positive integer between 0 and 1 with the maximum surrender charge.

T

Positive integer with expiry of the VA product.

get

get the surrender penalty. Argument is time a scalar in [0, T].

set

set the maximum surrender penalty.

get_type

get the type of the surrender penalty

Examples

Run this code
# NOT RUN {
#Sets a constant penalty
penalty <- penalty_class$new(type = 1, const = 0.03)
penalty$get()
penalty$set(0.04)
penalty$get()
#Sets a time decreasing penalty of type 2
penalty <- penalty_class$new(type = 2, const = 0.08, T = 10)
penalty$get(time = 0)
penalty$get(time = 2)
penalty$set(0.05)
penalty$get(time = 0)
#Sets a time decreasing penalty of type 3
penalty <- penalty_class$new(type = 3, const = 0.08, T = 10)
penalty$get(time = 0)
penalty$get(time = 2)
penalty$set(0.05)
penalty$get(time = 0)
# }

Run the code above in your browser using DataLab