aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/load_cf.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/R/load_cf.R b/R/load_cf.R
index 652a4b94..4a1b1823 100644
--- a/R/load_cf.R
+++ b/R/load_cf.R
@@ -243,9 +243,11 @@ compute.delta <- function(indexdist, dealdata, cusip.pv, K1=0, K2=1){
for(i in 1:length(dealweight)){
indexpv <- c(indexpv, funded.tranche.pv(scenariosl[i,], scenariosr[i,], cs, K1, K2, TRUE))
}
- model1 <- lm(cusip.pv~dealprice, weights=dealweight)
- model2 <- lm(dealprice~indexpv, weights=dealweight)
- return(model1$coef[2]/model2$coef[2])
+ ## model1 <- lm(cusip.pv~dealprice, weights=dealweight)
+ ## model2 <- lm(dealprice~indexpv, weights=dealweight)
+ ## return(model1$coef[2]/model2$coef[2])
+ model <- lm(cusip.pv~indexpv, weights=dealweight)
+ return( model$coef[2] )
}
if(length(args)>=2){