From 050e936cbf24c9c89d719522f93162c476f87663 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 7 May 2014 15:31:07 -0400 Subject: update BCstrikes to make sure it works --- R/tranche_functions.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'R') 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))) } -- cgit v1.2.3-70-g09d2