disc_value: Calculates the present value of a cashflow

Description Usage Arguments Value Examples

View source: R/CurveFuncs.R

Description

Calculates the present value of a cashflow

Usage

1
disc_value(r, cf, d = 1:length(cf))

Arguments

r

A rate curve

cf

The vector of values corresponding to the cashflow

d

The periods on which the cashflow occurs. If missing, it is assumed that cf[i] occurs on period i

Value

The present value of the cashflow

Examples

1
2
3
r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff")
disc_value(r, cf = c(-1, 1.10), d = c(0,1))
disc_value(r, cf = c(-1, 1.15*1.15), d = c(0,2))

tvm documentation built on April 21, 2021, 9:07 a.m.