summaryrefslogtreecommitdiffstats
path: root/R/tranche_functions.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/tranche_functions.R')
-rw-r--r--R/tranche_functions.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R
index 9f1d70b..97c0c72 100644
--- a/R/tranche_functions.R
+++ b/R/tranche_functions.R
@@ -737,9 +737,9 @@ adjust.skew <- function(index1, index2, method="ATM"){
el2 <- EL(index2)
}
skew <- function(x){
- #we cap the correlation at 0.99
+ #we cap the correlation at 0.99 and 0.01
f <- splinefun(K1, index1$rho[-c(1, length(index1$rho))], "natural")
- return(pmin(f(x), 0.99))
+ return(pmax(pmin(f(x), 0.99), 0.01))
}
if(method=="ATM"){
K1eq <- el1/el2 * K2