liq-methods: Derive the liquidity-vector for 'ContractType'

liquidityR Documentation

Derive the liquidity-vector for ContractType

Description

Different liquidity-concepts can be derived for a financial instrument or the resulting EventSeries, respectively. Currentently, these are Marginal liquidity and Cumulative liquidity.

Usage

liquidity(object, by, type, ...)

## S4 method for signature 'ContractType,timeDate,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'ContractType,timeBuckets,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'ContractType,timeDate,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'ContractType,timeBuckets,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'Portfolio,timeDate,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'Portfolio,timeBuckets,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'Portfolio,timeBuckets,character'
liquidity(object, by, type, ...)

## S4 method for signature 'Portfolio,timeDate,character'
liquidity(object, by, type, digits = 2, ...)

## S4 method for signature 'EventSeries,timeDate,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'EventSeries,timeBuckets,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'EventSeries,timeDate,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'EventSeries,timeBuckets,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'eventList,timeDate,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'eventList,timeBuckets,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'eventList,timeDate,character'
liquidity(object, by, type, ...)

## S4 method for signature 'eventList,timeBuckets,character'
liquidity(object, by, type, ...)

## S4 method for signature 'data.frame,timeDate,character'
liquidity(object, by, type, ...)

## S4 method for signature 'CurrentAccount,timeDate,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'CurrentAccount,timeBuckets,missing'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'CurrentAccount,timeBuckets,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'CurrentAccount,timeDate,character'
liquidity(object, by, type, digits = 2)

## S4 method for signature 'Node,timeBuckets,ANY'
liquidity(object, by, type, scale = 1, digits = 2)

## S4 method for signature 'Operations,timeDate,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'Operations,timeBuckets,missing'
liquidity(object, by, type, ...)

## S4 method for signature 'Operations,timeDate,character'
liquidity(object, by, type, ...)

## S4 method for signature 'Operations,timeBuckets,character'
liquidity(object, by, type, ...)

## S4 method for signature 'Operations,timeDate,character,ANY,ANY'
income(object, by, type, revaluation.gains, method, ...)

Arguments

object

The ContractType or EventSeries-object for which to derive the liquidity-vector

by

A sequence of 'timeDate's providing the target time-axis for the liquidity-vector

type

A character representing the type of liquidity (either 'marginal' or 'cumulative')

...

Currently unused

Details

Marginal liquidity-vector represents the aggregate cash flows within a set of user-defined time-intervals. The time-intervals are defined as a sequence of timeDate-dates. Thereby, the marginal liquidity-vector gives the net cash flows within the specified time-intervals.

Cumulative liquidity-vector is the cumulative sum over time (-intervals) of the marginal liquidity-vector.

Value

A numeric object representing the liquidity-vector on the target time-axis

See Also

ContractType and EventSeries

Examples

pam <- Pam()
set(pam, what=list(
                 ContractID = "001",
                 Currency = "CHF",
                 Calendar = "Weekday",
                 ContractRole = "RPA",               
                 StatusDate       = "2016-05-30T00",
                 ContractDealDate = "2016-05-30T00",
                 InitialExchangeDate = "2016-05-30T00",
                 MaturityDate = "2020-06-01T00",
                 NotionalPrincipal = 1000,
                 NominalInterestRate = 0.05,
                 CycleOfInterestPayment = "1Y-", 
                 PremiumDiscountAtIED = 0.0,
                 DayCountConvention = "30E/360",
                 BusinessDayConvention = "SCF"))
ad <- "2016-06-01T00"

# generate event series
evs = events(pam, ad)

# define target liquidity time axis
by=timeSequence(substring(ad, 1, 10), "2020-06-01", by="1 year")

# derive marginal liquidity for defined time axis
liquidity(evs, by, "marginal")

# derive cumulative liquidity for defined time axis
liquidity(evs, by, "cumulative")


wbreymann/FEMS documentation built on May 6, 2024, 2:19 p.m.