payoff_rollup: Roll-up of premiums payoff class

Description Usage Format Value Methods Examples

Description

Class providing a roll-up of premium payoff object. The payoff is the maximum between the account value and the roll-up of the premium at a given rate.

Usage

1

Format

R6Class object.

Value

Object of R6Class

Methods

new

Initialize method. The arguments are a non negative scalar with the premium and a constant_parameters object with the roll-up rate.

set_premium

Stores the premium in a private field. The argument is a non negative scalar

get_premium

Returns the premium as non negative scalar

set_rate

Sets the roll-up rate into a private field. The argument is a constant_parameters object

get_payoff

Gets the payoff. The arguments are a numeric vector with the amounts and a vector of timeDate objects with the start and end dates to calculate the roll-up amount (see Examples)

Examples

1
2
3
4
5
6
rate <- constant_parameters$new(0.01)
premium <- 100
rollup <- payoff_rollup$new(premium, rate)
t1 <- timeDate::timeDate("2016-01-01")
t2 <- timeDate::timeDate("2016-12-31")
rollup$get_payoff(c(120,100), c(t1,t2))

valuer documentation built on May 2, 2019, 3:43 p.m.