aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/zerorecovery_index.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/zerorecovery_index.R b/R/zerorecovery_index.R
index 897a55c7..27af7d63 100644
--- a/R/zerorecovery_index.R
+++ b/R/zerorecovery_index.R
@@ -43,7 +43,7 @@ upfront <- c()
for(R in seq(0.2, 0.45, 0.01)) {
index <- set.singlenamesdata(index, tradedate, R)
tweak <- tweakcurves(index)
- upfront <- c(upfront, zerorecov.pv(tweak$portfolio))
+ upfront <- c(upfront, zerorecov.pv(tweak$portfolio, index$cs, tradedate))
}
##ITRX
@@ -60,6 +60,6 @@ upfront <- c()
for(R in seq(0.2, 0.45, 0.01)) {
index <- set.singlenamesdata(index, tradedate, R)
tweak <- tweakcurves(index)
- upfront <- c(upfront, zerorecov.pv(tweak$portfolio))
+ upfront <- c(upfront, zerorecov.pv(tweak$portfolio, index$cs, tradedate))
}
plot(seq(0.2, 0.45, 0.01), upfront, type="l", xlab="recovery")