diff options
| -rw-r--r-- | R/cds_functions_generic.R | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/R/cds_functions_generic.R b/R/cds_functions_generic.R index 9d6d7ae0..1527c367 100644 --- a/R/cds_functions_generic.R +++ b/R/cds_functions_generic.R @@ -532,8 +532,8 @@ bondhazardrate.shaped <- function(collateral, shape, R=0.4, alpha=0.25, beta=15, return( shapedtodpc(cs, sc, startdate) )
}
- while(abs(bondpv(cs, sc, R) - collateral$price/100) > eps){
- dh <- (collateral$price/100 - bondpv(cs, sc, R, startdate))/dbondpv(cs, sc, R, ,startdate)
+ while(abs(bondpv(cs, sc, R, startdate) - collateral$price/100) > eps){
+ dh <- (collateral$price/100 - bondpv(cs, sc, R, startdate))/dbondpv(cs, sc, R, startdate)
while(sc@h+dh<0){
dh <- 0.5 * dh
}
|
