newConstructor method with arguments:
payoffpayoff_GMWB object with the amount of
the periodic withdrawal
t0timeDate object with
the issue date of the contract
t1timeDate object with the end date of the contract
agenumeric positive scalar with the age
of the policyholder
feeconstant_parameters object with
the fee
barriernumeric positive scalar with the
state-dependent fee barrier
penaltypenalty_class object with the
penalty
typestring with the GMWB contract type:
it can be 'Wa' for withdrawals up to t1 independent
of survival,'Wb' for withdrawals up to t1 only
if the insured is alive, 'Wc' for whole life withdrawals.
freqstring with the frequency of withdrawals
expressed in months (e.g. '12m' stands for yearly withdrawals).
get_timesget method for the product time-line.
Returns a timeDate object
get_ageget method for the age of the insured
set_ageset method for the age of the insured
get_barrierget method for the state-dependent fee barrier.
Returns a positive scalar with the barrier
set_barrierset method for the state-dependent fee barrier.
Argument must be a positive scalar.
set_penalty_objectthe argument penalty is a
penalty_class object which is stored in a private field.
get_penalty_objectgets the penalty_class object.
set_penaltyset method for the penalty applied in case of
surrender. The argument must be a scalar between 0 and 1.
get_penaltyget method for the surrender penalties. It can be
a scalar between 0 and 1 in case the penalty is constant or a numeric vector
in case the penalty varies with time.
set_feeset method for the contract fee. The argument is
a constant_parameters object with the fee.
set_payoffset method for the payoff_guarantee
object.
survival_benefit_timesreturns a numeric vector with
the survival benefit time indexes.
surrender_timesreturns a numeric vector with the
surrender time indexes. Takes as argument a string with the frequency
of the decision if surrendering the contract, e.g. "3m"
corresponds to a surrender decision taken every 3 months.
times_in_yrsreturns the product time-line in
fraction of year
cash_flowsreturns a numeric vector with the
cash flows of the product. It takes as argument: spot_values a
numeric vector which holds the values of the underlying
fund, death_time a time index with the time of death and
discounts a numeric vector with the discount factors
at time of death. These latest are used to calculate the death
benefit for the GMWB of type Wa
survival_benefitReturns a numeric scalar corresponding to
the survival benefit.
The arguments are: spot_values vector which holds the values of
the underlying fund, death_time time index of the time of death
and time the time index of the survival benefit.
The function will return 0 if there's no survival benefit at the
specified time
get_premiumReturns the premium as non negative scalar