diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-08-28 15:10:49 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-08-28 15:10:49 -0400 |
| commit | 2f0b3880a13c684b951986ce723ba8ec65932f54 (patch) | |
| tree | 9a9f77cc61a8f2bd947af523111a5314a23aeac8 | |
| parent | 3b827f4cefcf47f45f82fa05716afda11f8ea20c (diff) | |
| download | lossdistrib-2f0b3880a13c684b951986ce723ba8ec65932f54.tar.gz | |
cap the skew
| -rw-r--r-- | R/tranche_functions.R | 4 |
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
|
