This function provides calculation of stochastic discount factors or discounted values

esgdiscountfactor(r, X)

Arguments

r

the short rate, a numeric (constant rate) or a time series object

X

the asset's price, a numeric (constant payoff or asset price) or a time series object

Details

The function result is :

$$X_t exp(-\int_0^t r_s ds)$$

where \(X_t\) is an asset value at a given maturity \(t\), and \((r_s)_s\) is the risk-free rate.

See also

Author

T. Moudiki

Examples


kappa <- 1.5
V0 <- theta <- 0.04
sigma_v <- 0.2
theta1 <- kappa*theta
theta2 <- kappa
theta3 <- sigma_v

# OU
r <- simdiff(n = 10, horizon = 5, 
               frequency = "quart",  
               model = "OU", 
               x0 = V0, theta1 = theta1, theta2 = theta2, theta3 = theta3)

# Stochastic discount factors
esgdiscountfactor(r, 1)
#>       Series 1  Series 2  Series 3  Series 4  Series 5  Series 6  Series 7
#> 0 Q1 0.9900498 0.9900498 0.9900498 0.9900498 0.9900498 0.9900498 0.9900498
#> 0 Q2 0.9917865 1.0023939 0.9945820 0.9724267 0.9800802 0.9949094 0.9777836
#> 0 Q3 0.9946708 1.0124275 0.9989395 0.9676366 0.9624407 0.9898004 0.9858068
#> 0 Q4 0.9615977 1.0382985 1.0256745 0.9680876 0.9549272 0.9883240 0.9984821
#> 1 Q1 0.9351898 1.0693833 0.9949080 0.9862148 0.9341244 0.9914269 1.0095499
#> 1 Q2 0.9121209 1.1022303 0.9469648 1.0183832 0.9214680 1.0104255 0.9755929
#> 1 Q3 0.8622249 1.1622638 0.9342472 1.0312635 0.9037096 1.0214615 0.9630195
#> 1 Q4 0.8189800 1.1807203 0.9305439 1.0272624 0.8687079 1.0429278 0.9468072
#> 2 Q1 0.8092388 1.1860279 0.9342066 1.0201882 0.8351453 1.0921777 0.9313775
#> 2 Q2 0.8117120 1.2146193 0.9186593 0.9927977 0.8158521 1.1328449 0.9367477
#> 2 Q3 0.8184897 1.1988759 0.9068728 0.9304859 0.7812951 1.1359405 0.9389230
#> 2 Q4 0.7998155 1.1739195 0.8913064 0.8963457 0.7404419 1.1482898 0.9095136
#> 3 Q1 0.7788719 1.1606155 0.8785387 0.9140894 0.7032479 1.1386345 0.8786998
#> 3 Q2 0.7560283 1.1266177 0.8679338 0.9043210 0.6732758 1.1674529 0.8547107
#> 3 Q3 0.7366934 1.0803078 0.8337582 0.9082723 0.6600133 1.1853534 0.8434249
#> 3 Q4 0.7298905 1.0284398 0.8123577 0.9213503 0.6307615 1.1811406 0.8697994
#> 4 Q1 0.6963981 0.9769294 0.7705800 0.9078088 0.6172235 1.1671812 0.8648667
#> 4 Q2 0.6651889 0.9292303 0.7652519 0.9011769 0.5790137 1.1515139 0.8855133
#> 4 Q3 0.6695924 0.8961642 0.7499830 0.9170227 0.5349326 1.1526886 0.8833656
#> 4 Q4 0.6607465 0.8770023 0.7354440 0.9216664 0.5075183 1.1705669 0.8446406
#> 5 Q1 0.6591933 0.8682724 0.7200817 0.9246730 0.4985838 1.2049210 0.8415549
#>       Series 8  Series 9 Series 10
#> 0 Q1 0.9900498 0.9900498 0.9900498
#> 0 Q2 0.9658800 0.9587986 1.0022994
#> 0 Q3 0.9518655 0.9557628 0.9813104
#> 0 Q4 0.9708941 0.9761607 0.9712153
#> 1 Q1 1.0127809 0.9224681 0.9789327
#> 1 Q2 1.0748539 0.8922834 0.9860727
#> 1 Q3 1.1287079 0.8639697 0.9920090
#> 1 Q4 1.1998524 0.8312246 0.9701555
#> 2 Q1 1.2295609 0.8151418 0.9507418
#> 2 Q2 1.1927997 0.7931153 0.9200344
#> 2 Q3 1.1963817 0.7699131 0.9061354
#> 2 Q4 1.1755281 0.7554098 0.8898945
#> 3 Q1 1.1392601 0.7422558 0.8821427
#> 3 Q2 1.1037874 0.7315809 0.8723845
#> 3 Q3 1.0996860 0.6905534 0.8793939
#> 3 Q4 1.0961936 0.6719908 0.9060477
#> 4 Q1 1.0968145 0.6727486 0.8841328
#> 4 Q2 1.0809788 0.6706362 0.8558164
#> 4 Q3 1.0752509 0.6627699 0.8564487
#> 4 Q4 1.0463307 0.6493929 0.8652256
#> 5 Q1 1.0317725 0.6445217 0.8904518