Computes stochastic discount factors or discounted values based on interest rates and cash flows.
esgdiscountfactor(r, X)
A time series of discounted values
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.
# 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)