accrued-methods: Derive the accrued interest of a contract per specific...

accruedR Documentation

Derive the accrued interest of a contract per specific time(s)

Description

Derive the accrued interest of a contract per specific time(s)

Usage

accrued(object, by, model, ...)

## S4 method for signature 'ContractType,timeDate,missing'
accrued(object, by, model)

## S4 method for signature 'ContractType,character,missing'
accrued(object, by, model)

## S4 method for signature 'ContractType,timeDate,RiskFactorConnector'
accrued(object, by, model)

## S4 method for signature 'ContractType,character,RiskFactorConnector'
accrued(object, by, model)

Arguments

object

object The ContractType or EventSeries-object for which to derive the value

by

time as per which to compute accrued interest (can be a vector)

model

(optional) The RiskFactorConnector conditional to which events are computed

Value

A numeric object representing the accrued interest per time

See Also

ContractType, EventSeries, RiskFactorConnector

Examples

# define contract
pam = Pam(what=list(
                    ContractID = "001",
                    Currency = "USD",
                    ContractDealDate = "2012-12-31T00",
                    InitialExchangeDate = "2013-01-01T00",
                    MaturityDate = "2017-12-31T00",
                    StatusDate       = "2012-12-31T00",
                    NotionalPrincipal = 1000,
                    NominalInterestRate = 0.04,
                    CycleOfInterestPayment = "1Y-",
                    ContractRole = "RPA",
                    DayCountConvention = "30E/360"
))

# time-vector
by=timeSequence(from=substring(get(pam, "InitialExchangeDate"), 1, 10),
                to=substring(get(pam,"MaturityDate"), 1, 10),
                by="1 months")

# compute accrued interest for time-vector
accrued(pam, by)


wbreymann/FEMS documentation built on Dec. 8, 2022, 9:43 a.m.