aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/build_scenarios.R2
-rw-r--r--R/cds_functions_generic.R4
-rw-r--r--R/tranche_functions.R2
3 files changed, 4 insertions, 4 deletions
diff --git a/R/build_scenarios.R b/R/build_scenarios.R
index 80a37c19..00fd9d9e 100644
--- a/R/build_scenarios.R
+++ b/R/build_scenarios.R
@@ -18,7 +18,7 @@ if(length(args) >=2){
}else{
data <- read.table(file.path(root.dir, "scripts", "scenarios.txt"))
dealnames <- as.character(data$V1)
- reinvflags <- data$V2
+ reinvflags <- as.logical(data$V2)
unlink(file.path(root.dir, "scripts", "scenarios.txt"))
}
diff --git a/R/cds_functions_generic.R b/R/cds_functions_generic.R
index 0e559304..c0a89633 100644
--- a/R/cds_functions_generic.R
+++ b/R/cds_functions_generic.R
@@ -55,7 +55,7 @@ setMethod("couponleg", signature("data.frame", "flatcurve"),
setMethod("couponleg", signature("data.frame", "defaultcurve"),
## computes the pv of the risky coupon leg based on a given coupon schedule
## and a survival curve. Also called premium leg or fixed leg.
- function(cs, sc, stardate=Sys.Date(), accruedondefault=TRUE){
+ function(cs, sc, startdate=Sys.Date(), accruedondefault=TRUE){
stopifnot(class(startdate)=="Date")
stopifnot(is.logical(accruedondefault))
x1T <- yearFrac(Sys.Date(), sc@dates)
@@ -225,7 +225,7 @@ setMethod("defaultleg", signature("data.frame", "defaultprepaycurve", "numeric")
## Computes the pv of the default leg of a cds based on a given
## coupon schedule, hazard rates curve, prepay curves, and recovery.
function(cs, sc, recovery, startdate=Sys.Date()){
- stopifnot(class(stardate)=="Date")
+ stopifnot(class(startdate)=="Date")
x2T <- yearFrac(startdate, cs$dates)
x1T <- yearFrac(Sys.Date(), sc@dates)
dT <- diff(c(0, x2T))
diff --git a/R/tranche_functions.R b/R/tranche_functions.R
index 287310ff..6f228620 100644
--- a/R/tranche_functions.R
+++ b/R/tranche_functions.R
@@ -11,7 +11,7 @@ library(statmod)
## recovery with 0.1-1 support, so it's not clear that there is a big gain.
## - do the correlation adjustments when computing the deltas since it seems to be
## the market standard
-hostname <- system("hostname", intern=T)
+hostname <- system("hostname", intern=TRUE)
lossdistrib <- function(p){
## basic recursive algorithm of Andersen, Sidenius and Basu