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, 4 insertions, 4 deletions
diff --git a/R/calibration.R b/R/calibration.R
index 405587a3..b4f65ccb 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -59,12 +59,11 @@ set.singlenamesdata <- function(index, tradedate){
set.tranchedata <- function(index, tradedate){
if(is.null(index)){
- return( NULL )
+ stop("index is NULL")
}
temp <- get.tranchequotes(index$name, index$tenor, tradedate)
if(is.null(temp)){
- loginfo(paste(index$name, "no quote for day", as.character(tradedate)))
- return(NULL)
+ stop(paste(index$name, "no quote for day", as.character(tradedate)))
}
index$quotes <- data.frame(maturity=index$maturity,
refspread=temp$indexrefspread[1],
@@ -75,11 +74,12 @@ set.tranchedata <- function(index, tradedate){
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,
0.4, tradedate)
}
if(length(indexpv(index, tradedate=tradedate, check=TRUE))==1){
- return(NULL)
+ stop("why am I stopping?")
}
tweak <- tweakcurves(index, tradedate)
index$portfolio <- NULL