diff options
Diffstat (limited to 'R/calibrate_tranches_BC.R')
| -rw-r--r-- | R/calibrate_tranches_BC.R | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R index a2db8f56..47d0fad4 100644 --- a/R/calibrate_tranches_BC.R +++ b/R/calibrate_tranches_BC.R @@ -114,7 +114,12 @@ for(run in config$runs){ ## compute various risk numbers
index$tranches <- cbind(index$tranches, BCtranche.delta(index))
- index$tranches <- cbind(index$tranches, BCtranche.theta(index, method="TLP"))
+ index$tranches <- cbind(index$tranches, tryCatch(BCtranche.theta(index, method="TLP"),
+ error = function(e) {
+ logerror(e$message)
+ n <- nrow(index$tranches)
+ data.frame(theta=rep(NA, n),
+ fw.delta=rep(NA, n)) }))
index$tranches$corr01 <- BCtranche.corr01(index)
temp <- BCtranche.pv(index, protection=TRUE)
index$tranches$duration <-
|
