From 2f0b3880a13c684b951986ce723ba8ec65932f54 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 28 Aug 2014 15:10:49 -0400 Subject: cap the skew --- R/tranche_functions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'R') 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 -- cgit v1.2.3-70-g09d2