npv: NPV

View source: R/npv.R

npvR Documentation

NPV

Description

Computes NPV with discount factor interpolation. This function is used for teaching NPV and NPV at Risk and needs to be customized.

Usage

npv(
  init.cost = -375,
  C = 50,
  cf.freq = 0.25,
  TV = 250,
  T2M = 2,
  disc.factors = us.df,
  BreakEven = FALSE,
  BE.yield = 0.01
)

Arguments

init.cost

Initial investment cost. numeric

C

Periodic cash flow. numeric

cf.freq

Cash flow frequency in year fraction e.g. quarterly = 0.25. numeric

TV

Terminal Value. numeric

T2M

Time to Maturity in years. numeric

disc.factors

Data frame of discount factors using ir.df.us() function. numeric

BreakEven

TRUE when using a flat discount rate assumption. logical

BE.yield

Set the flat IR rate when BreakEven = TRUE. logical

Value

List of NPV and NPV Data frame. list

Author(s)

Philippe Cote

Examples

npv(
  init.cost = -375, C = 50, cf.freq = .5, TV = 250, T2M = 2,
  disc.factors = RTL::usSwapCurves, BreakEven = FALSE, BE.yield = .0399
)$npv
npv(
  init.cost = -375, C = 50, cf.freq = .5, TV = 250, T2M = 2,
  disc.factors = RTL::usSwapCurves, BreakEven = FALSE, BE.yield = .0399
)$df

risktoollib/RTL documentation built on April 17, 2024, 1:35 p.m.