aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibration.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibration.R')
-rw-r--r--R/calibration.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/R/calibration.R b/R/calibration.R
index f1605bd1..a162960b 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -76,14 +76,16 @@ set.tranchedata <- function(index, tradedate){
refspread=temp$indexrefspread[1],
refprice=temp$indexrefprice[1])
index$quotes$spread <- couponfromindex(index$name, index$tenor) * 1e-4
- index$cs <- couponSchedule(IMMDate(tradedate, noadj=TRUE), index$maturity, "Q", "FIXED", 1,
+ index$cs <- couponSchedule(IMMDate(tradedate, noadj=TRUE),
+ index$maturity, "Q", "FIXED", 1,
0, tradedate, IMMDate(tradedate, "prev"))
if(!is.na(index$quotes$refprice) && index$quotes$refprice != 0) {
index$quotes$price <- index$quotes$refprice/100
} else {
- index$quotes$price <- snacpv(index$cs, index$quotes$refspread[1]*1e-4, index$quotes$spread,
- if (index$type %in% c("IG", "EU")) 0.4 else 0.3, tradedate)
+ index$quotes$price <- snacpv(index$cs, index$quotes$refspread[1] * 1e-4,
+ index$quotes$spread,
+ if (index$type == "HY") 0.3 else 0.4, tradedate)
}
if(length(indexpv(index, tradedate=tradedate)) == 1) {
stop("why am I stopping?")