Description Usage Format Value Methods Examples
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.
1 |
R6Class
object.
Object of R6Class
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)
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.