aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibration.R6
-rw-r--r--R/cds_functions_generic.R2
-rw-r--r--R/thetas-curve.R3
3 files changed, 4 insertions, 7 deletions
diff --git a/R/calibration.R b/R/calibration.R
index 6f672e85..f1605bd1 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -23,11 +23,7 @@ get.cdsSchedule <- function(tradedate, tenors=c(1:5, 7, 10)) {
}
set.singlenamesdata <- function(index, tradedate, recov=NULL) {
- cds.cs <- if (index$type %in% c("HY", "XO")) { # no need to build the full 10y curve
- get.cdsSchedule(tradedate, 1:5)
- } else {
- get.cdsSchedule(tradedate)
- }
+ cds.cs <- get.cdsSchedule(tradedate)
quotes <- get.singlenamesquotes(index$name, tradedate)
tenor <- names(cds.cs$cdsdates)
index$portfolio <- list()
diff --git a/R/cds_functions_generic.R b/R/cds_functions_generic.R
index 73237276..b343dcde 100644
--- a/R/cds_functions_generic.R
+++ b/R/cds_functions_generic.R
@@ -607,7 +607,7 @@ tweakportfolio <- function(portfolio, epsilon, start.tweak=1L, end.tweak=NA,
x@curve@hazardrates[range] <- x@curve@hazardrates[range] * (1+epsilon)
x
})
- }else{
+ } else {
## we do a tweak to the spread
r <- lapply(portfolio, function(x) {
x@curve@hazardrates <- x@curve@hazardrates + epsilon / (1-x@recovery)
diff --git a/R/thetas-curve.R b/R/thetas-curve.R
index dc912f9e..0d3baf2b 100644
--- a/R/thetas-curve.R
+++ b/R/thetas-curve.R
@@ -39,7 +39,8 @@ if(!interactive()) {
make_option(c("-s", "--series"), help="Index series"))
args <- parse_args(OptionParser(option_list=option_list))
} else {
- args <- list(index="IG", series=27)
+ args <- list(index="HY", series=30)
+ options(error=recover)
}
maturities <- get.maturities(args$index, args$series)