diff options
| -rw-r--r-- | R/calibration.R | 8 | ||||
| -rw-r--r-- | python/analytics/basket_index.py | 6 |
2 files changed, 8 insertions, 6 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?") diff --git a/python/analytics/basket_index.py b/python/analytics/basket_index.py index d3cc035e..9495d28c 100644 --- a/python/analytics/basket_index.py +++ b/python/analytics/basket_index.py @@ -34,10 +34,10 @@ class BasketIndex(CreditIndex): value_date: pd.Timestamp=pd.Timestamp.today().normalize() - BDay()): self.index_type = index_type self.series = series - if index_type == 'IG' or index_type == 'EU': - self.recovery = 0.4 - else: + if index_type == 'HY': self.recovery = 0.3 + else: + self.recovery = 0.4 self.index_desc = pd.read_sql_query("SELECT tenor, maturity, coupon * 1e-4 AS coupon, " \ "issue_date "\ "FROM index_maturity " \ |
