diff options
Diffstat (limited to 'R/tranche_functions.R')
| -rw-r--r-- | R/tranche_functions.R | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R index cf3df0f..fb8a4fa 100644 --- a/R/tranche_functions.R +++ b/R/tranche_functions.R @@ -701,14 +701,16 @@ theta.adjust.skew <- function(index, shortened=4){ return(c(0, rhofun(K), NA))
}
-BCtranche.theta <- function(index, shortened=4){
+BCtranche.theta <- function(index, tradedate=Sys.Date(), shortened=4){
temp <- BCtranche.pv(index)
index$rho <- theta.adjust.skew(index, shortened)
N <- nrow(index$cs)-shortened
index$cs <- index$cs[1:N,]
index$defaultprob <- index$defaultprob[,1:N]
temp2 <- BCtranche.pv(index)
- return(temp2$bp-temp$bp+index$tranche.running)
+ temp3 <- BCtranche.delta(index, tradedate)
+ return(list(theta=temp2$bp-temp$bp+index$tranche.running,
+ delta=temp3$delta))
}
BCtranche.delta <- function(index, tradedate = Sys.Date()){
|
