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, 2 insertions, 6 deletions
diff --git a/R/calibration.R b/R/calibration.R
index b6b5b5c6..9eeb03b5 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -13,7 +13,7 @@ buildSC <- function(quote, cs, cdsdates){
get.cdsSchedule <- function(tradedate){
cdsdates <- as.Date(character(0))
- for(tenor in paste0(c(1:5, 7), "y")){
+ for(tenor in paste0(c(1:5, 7, 10), "y")){
newdate <- cdsMaturity(tenor, date=tradedate)
cdsdates <- c(cdsdates, newdate)
}
@@ -32,10 +32,6 @@ set.singlenamesdata <- function(index, tradedate){
quotes$upfront_curve[i,] <- rep(0,8)
quotes$recovery[i,] <- rep(0.4,8)
}
-
- if(quotes$ticker[i] == "PLCOAL" && is.na(quotes$upfront_curve[i, "5y"])){
- quotes$upfront_curve[i, "5y"] = 85
- }
quotes$upfront_curve[i, tenor] <- pmax(-yearFrac(tradedate+2,cds.cs$cdsdates)*
quotes$spread_curve[i, tenor]*1e-2,
quotes$upfront_curve[i, tenor])
@@ -72,7 +68,7 @@ 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