aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibration.R8
1 files changed, 2 insertions, 6 deletions
diff --git a/R/calibration.R b/R/calibration.R
index 3c837296..2f5877ee 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -70,12 +70,8 @@ set.tranchedata <- function(index, tradedate){
if(!is.na(index$quotes$refprice) && index$quotes$refprice != 0){
index$quotes$price <- index$quotes$refprice/100
}else{
- ##rewrite as a snac function
- sc <- new("flatcurve", h=index$quotes$refspread[1]*1e-4/(1-index$recovery))
- startdate <- tradedate + 1
- cds.pv <- couponleg(index$cs, sc, startdate)*index$quotes$spread -
- defaultleg(index$cs, sc, index$recovery, startdate)
- index$quotes$price <- 1 + cds.pv - cdsAccrued(tradedate, index$quotes$spread[1])
+ index$quotes$price <- snacpv(index$cs, index$quotes$refspread[1]*1e-4, index$quotes$spread,
+ 0.4, tradedate)
}
if(length(indexpv(index, tradedate=tradedate, check=TRUE))==1){
return(NULL)