aboutsummaryrefslogtreecommitdiffstats
path: root/R/load_cf.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/load_cf.R')
-rw-r--r--R/load_cf.R7
1 files changed, 4 insertions, 3 deletions
diff --git a/R/load_cf.R b/R/load_cf.R
index 215e353f..f9c68fc5 100644
--- a/R/load_cf.R
+++ b/R/load_cf.R
@@ -248,17 +248,18 @@ getcusipcf <- function(cusips, cfdata, dist, workdate=Sys.Date()){
cusipdata[[cusip]]$delta <-
compute.delta(dist, cfdata[[dealnames[i]]]$weight,
cusipdata[[cusip]]$fields[,"Cashflow"]/cusipdata[[cusip]]$currbal,
- prevBusDay(workdate))
+ workdate)
}
}
return(cusipdata)
}
-compute.delta <- function(indexdist, dealweight, cusip.pv, workdate=prevBusDay(Sys.Date())){
+compute.delta <- function(indexdist, dealweight, cusip.pv, workdate=Sys.Date()){
indexpv <- c()
+ calibration.date <- prevBusDay(workdate)
cs <- couponSchedule(nextIMMDate(workdate), as.Date("2017-12-20"), "Q",
- "FLOAT", 0, 0.05,workdate)
+ "FLOAT", 0, 0.05, calibration.date)
nT <- dim(indexdist$L)[2]
Ngrid <- dim(indexdist$L)[1]
scenariosl <- matrix(0, length(dealweight), nT)