Description Usage Format Value Methods Examples
Class providing a ratchet payoff object. The payoff will be the highest account value recorded at some specified times.
1 |
R6Class object.
Object of R6Class
newInitialize method. The arguments are a non negative scalar with the premium and the ratchet frequency. Allowed units for the frequency are "m" for 4 weeks, "w" for weeks, "d" for days
set_premiumStores the premium in a private field. The argument is a non negative scalar
get_premiumReturns the premium as non negative scalar
set_freqSets the ratchet frequency. Allowed units for the frequency are "m" for 4 weeks, "w" for weeks, "d" for days
get_payoffGets the payoff.
The arguments are a numeric vector
with the amounts, a vector of timeDate objects
with the start and end dates for the ratchet and a numeric
vector with the account values. (see Examples)
1 2 3 4 5 6 7 | freq <- "1m"
premium <- 100
ratchet <- payoff_ratchet$new(premium, freq)
t1 <- timeDate::timeDate("2016-01-01")
t2 <- timeDate::timeDate("2016-12-31")
account <- 120 * rnorm(365)
ratchet$get_payoff(c(120,100), c(t1,t2), account)
|
Loading required package: orthopolynom
Loading required package: polynom
[1] 210.2018 210.2018
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.