Computes stochastic discount factors or discounted values based on interest rates and cash flows.

esgdiscountfactor(r, X)

Arguments

r

A numeric vector or time series of interest rates

X

A numeric vector or time series of cash flows or values to be discounted

Value

A time series of discounted values

Details

This function handles various combinations of scalar and time series inputs for both interest rates and cash flows. For scalar inputs, it performs simple exponential discounting. For time series inputs, it computes cumulative discounting over time.

Examples

# Simple scalar discounting
esgdiscountfactor(0.05, 100)
#> [1] 95.12294

# Time series discounting
#r <- ts(rep(0.05, 10), start = 0, deltat = 1)
#X <- ts(rep(100, 10), start = 0, deltat = 1)
#esgdiscountfactor(r, X)