summaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/tranche_functions.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R
index 135bfe5..ed7fb91 100644
--- a/R/tranche_functions.R
+++ b/R/tranche_functions.R
@@ -683,7 +683,7 @@ BCtranche.pv <- function(index, protection=FALSE, complement=FALSE){
}
dK <- diff(index$K)
plvec <- diff(pl)/dK
- clvec <- diff(cl)/dK*index$tranche.running
+ clvec <- diff(cl)/dK*index$tranches$running
if(complement){
plvec <- -plvec
clvec <- -clvec
@@ -706,7 +706,7 @@ MFtranche.pv <- function(index, dist, protection=FALSE){
}
dK <- diff(index$K)
plvec <- pl/dK
- clvec <- cl/dK*index$tranche.running
+ clvec <- cl/dK*index$tranches$running
if(protection){
bp <- -plvec-clvec
}else{
@@ -786,7 +786,7 @@ BCtranche.theta <- function(index, shortened=4, complement=FALSE, method="ATM"){
index$defaultprob <- index$defaultprob[,1:N]
temp2 <- BCtranche.pv(index, complement=complement)
temp3 <- BCtranche.delta(index, complement=complement)
- return(list(thetas=temp2$bp-temp$bp+index$tranche.running,
+ return(list(thetas=temp2$bp-temp$bp+index$tranches$running,
forward.deltas=temp3$delta))
}
@@ -796,7 +796,7 @@ BCtranche.delta <- function(index, complement=FALSE){
## if complement is False, then computes deltas bottom-up
## if complement is True, then computes deltas top-down
eps <- 1e-4
- index$Ngrid <- 301 ## for gamma computations we need all the precision we can get
+ index$N <- 301 ## for gamma computations we need all the precision we can get
## we build a lit of 4 indices with various shocks
index.list <- lapply(c(0, eps, -eps, 2*eps), function(x){
if(x==0){