diff options
| -rw-r--r-- | R/tranche_functions.R | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R index 217a7b3..97fbc83 100644 --- a/R/tranche_functions.R +++ b/R/tranche_functions.R @@ -809,7 +809,7 @@ theta.adjust.skew <- function(index, shortened=4, method="ATM"){ }
BCtranche.theta <- function(index, shortened=4, complement=FALSE, method="ATM"){
- temp <- BCtranche.pv(index, complement=FALSE)
+ temp <- BCtranche.pv(index, complement=complement)
rho.adj <- theta.adjust.skew(index, shortened, method)
if(any(rho.adj[-c(1, length(rho.adj))]<=0)){
print("probable inverted skew: no adjustment")
@@ -920,11 +920,11 @@ BCindex.pv <- function(index, discounted=TRUE, shortened=0){ sizeadj <- 0.5*(c(1, size[-length(size)])+size)
if(!discounted){
pl <- -ELvec[length(ELvec)]
- cl <- as.numeric(crossprod(index$cs$coupons, sizeadj))
+ cl <- as.numeric(crossprod(index$cs$coupons[1:Ncol], sizeadj))
bp <- 1+cl+pl
}else{
pl <- -sum(index$cs$df[1:Ncol]* diff(c(0, ELvec)))
- cl <- as.numeric(crossprod(index$cs$coupons, sizeadj * index$cs$df[1:Ncol] ))
+ cl <- as.numeric(crossprod(index$cs$coupons[1:Ncol], sizeadj * index$cs$df[1:Ncol] ))
bp <- 1+cl+pl
}
bp <- 1+cl*index$quotes$spread+pl
|
