diff options
Diffstat (limited to 'R/tranche_functions.R')
| -rw-r--r-- | R/tranche_functions.R | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R index 5fa954a..b575c33 100644 --- a/R/tranche_functions.R +++ b/R/tranche_functions.R @@ -718,13 +718,14 @@ BCtranche.delta <- function(portfolio, index, coupon, K1, K2, rho1, rho2, Z, w, return( delta )
}
-BCstrikes <- function(portfolio, index, coupon, K, rho, N=101) {
+BCstrikes <- function(defaultprob, issuerweights, recov, cs, Kmodified, rho, Z, w, N=101) {
## computes the strikes as a percentage of expected loss
+ ## Kmodified is the current attachment points (adjusted for losses)
EL <- c()
for(i in 2:length(K)){
- EL <- c(EL, -BCtranche.pv(portfolio, index, coupon, K[i-1], K[i], rho[i-1], rho[i], N)$pl)
+ EL <- c(EL, -BCtranche.pv(defaultprob, issuerweights, recov, cs,
+ K[i-1], K[i], rho[i-1], rho[i], Z, w, N)$pl)
}
- Kmodified <- adjust.attachments(K, index$loss, index$factor)
return(cumsum(EL*diff(Kmodified))/sum(EL*diff(Kmodified)))
}
|
