diff options
Diffstat (limited to 'R/cds_utils.R')
| -rw-r--r-- | R/cds_utils.R | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/R/cds_utils.R b/R/cds_utils.R index 9017e655..1186f953 100644 --- a/R/cds_utils.R +++ b/R/cds_utils.R @@ -71,8 +71,8 @@ couponSchedule <- function(nextpaydate=NULL, maturity, frequency, coupontype, cu ## inputs:
## nextpaydate: first payment date of the coupon schedule
## maturity: last payment date of the schedule
- ## frequency: letter specifying the frequency amon "Q", "M", "B", or "S"
- ## if startdate is provided, this generates the forward coupon schedule starting from that date.
+ ## frequency: letter specifying the frequency between "Q", "M", "B", "S" or "A"
+ ## if startdate is provided, we generate the forward coupon schedule starting from that date.
bystring <- switch(frequency,
Q = "3 months",
M = "1 month",
@@ -103,6 +103,7 @@ couponSchedule <- function(nextpaydate=NULL, maturity, frequency, coupontype, cu 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
coupons <- pmax(currentcoupon, DC$forwards + margin)
}else{
coupons <- rep(currentcoupon, length(dates))
|
