aboutsummaryrefslogtreecommitdiffstats
path: root/R/thetas-durations.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/thetas-durations.R')
-rw-r--r--R/thetas-durations.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/thetas-durations.R b/R/thetas-durations.R
index cf3fef7e..7175877d 100644
--- a/R/thetas-durations.R
+++ b/R/thetas-durations.R
@@ -89,6 +89,7 @@ sqlstr.theta <- paste("UPDATE index_quotes set theta=$1 where date=$2 and index=
"and series=$4 and tenor=$5")
for(index in c('IG', 'HY')){
recov <- if(index=='IG') 0.4 else 0.3
+ coupon <- if(index=='IG') 0.01 else 0.05
for(series in c(18, 19, 20, 21, 22, 23, 24, 25)){
indexquotes <- get.indexquotes.table(index, series, tenors)
if(nrow(indexquotes)==0){
@@ -107,7 +108,7 @@ for(index in c('IG', 'HY')){
quotes <- data.frame(upfront=(100-as.numeric(indexquotes[i,-1]))/100, maturities)
sc <- cdshazardrate(quotes, recov, tradedate, cs)
c(fastduration(sc, cs, tradedate, maturities$maturity),
- fasttheta(sc, cs, recov, tradedate, maturities$maturity, quotes$upfront))
+ fasttheta(sc, cs, recov, tradedate, maturities$maturity, quotes$upfront, coupon))
}
r <- c()
for(i in 1:nrow(indexquotes)){