diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-08-15 11:06:01 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-08-15 11:06:01 -0400 |
| commit | 1c0ecf83962dea62b1222c1b419d08fb969e322a (patch) | |
| tree | b4cabbd784e7fcf2625657ff481a7548c70423bb /R/tranche_functions.R | |
| parent | a4c9aa862fbf2891cb8abfae2ac7ef9558ae207b (diff) | |
| download | lossdistrib-1c0ecf83962dea62b1222c1b419d08fb969e322a.tar.gz | |
check for inverted skew
Diffstat (limited to 'R/tranche_functions.R')
| -rw-r--r-- | R/tranche_functions.R | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R index c9b1ee1..83e7199 100644 --- a/R/tranche_functions.R +++ b/R/tranche_functions.R @@ -707,7 +707,12 @@ theta.adjust.skew <- function(index, shortened=4){ BCtranche.theta <- function(index, tradedate=Sys.Date(), shortened=4){
temp <- BCtranche.pv(index)
- index$rho <- theta.adjust.skew(index, shortened)
+ rho.adj <- theta.adjust.skew(index, shortened)
+ if(any(rho.adj[-c(1, length(rho.adj))]<=0)){
+ print("probable inverted skew: no adjustment")
+ }else{
+ index$rho <- rho.adj
+ }
N <- nrow(index$cs)-shortened
index$cs <- index$cs[1:N,]
index$defaultprob <- index$defaultprob[,1:N]
|
