View source: R/discount_factors.R
esgdiscountfactor | R Documentation |
Computes stochastic discount factors or discounted values based on interest rates and cash flows.
esgdiscountfactor(r, X)
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 |
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.
A time series of discounted values
# Simple scalar discounting
esgdiscountfactor(0.05, 100)
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.