compounding: Create Compounding class

View source: R/compounding-class.R

compoundingR Documentation

Create Compounding class

Description

compound() creates a Compounding object in one of its subclasses: Simple, Discrete, Continuous.

Usage

compounding(x = c("simple", "discrete", "continuous"))

Arguments

x

a character with the name of compounding regime: simple, discrete, continuous

Details

A Compounding object can be instanciated with the compounding function, passing a string with the name of one of the compounding regimes: simple, discrete, continuous.

Value

A subclass of Compounding object.

Examples

compounding("simple")
compounding("discrete")
compounding("continuous")

comp <- compounding("discrete")
compound(comp, 0.06, 2) # equals (1 + 0.06) ^ 2 = 1.1236
implied_rate(comp, 1.1236, 2) # equals 0.06

fixedincome documentation built on July 9, 2023, 7:28 p.m.