aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/cds_utils.R5
1 files changed, 3 insertions, 2 deletions
diff --git a/R/cds_utils.R b/R/cds_utils.R
index 5369e9bb..9087f340 100644
--- a/R/cds_utils.R
+++ b/R/cds_utils.R
@@ -114,8 +114,9 @@ couponSchedule <- function(nextpaydate=NULL, maturity, frequency, coupontype, cu
B = DiscountCurve(L2m$params, L2m$tsQuotes, yearFrac(L2m$params$tradeDate, dates)),
A = DiscountCurve(L12m$params, L12m$tsQuotes, yearFrac(L12m$params$tradeDate, dates)))
- if(coupontype=="FLOAT" && !is.na(margin)){ #if is.na(margin) probably letter of credit
- #we floor the coupon at the current gross rate
+ if(coupontype=="FLOAT" && !is.na(margin)){
+ ## if is.na(margin) probably letter of credit
+ ## we floor the coupon at the current gross rate
coupons <- pmax(currentcoupon, DC$forwards + margin)
}else{
coupons <- rep(currentcoupon, length(dates))