aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibrate_tranches_MF.R3
-rw-r--r--python/cds_curve.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/R/calibrate_tranches_MF.R b/R/calibrate_tranches_MF.R
index aa2c49bf..8b070f4a 100644
--- a/R/calibrate_tranches_MF.R
+++ b/R/calibrate_tranches_MF.R
@@ -41,4 +41,5 @@ write.table(data.frame(Z=index$Z, w=index$w.mod),
col.names=T, row.names=F, sep=",")
save(index, dist, file = file.path(data.dir,
- paste0("marketdata-", tradedate, ".RData")), compress="xz")
+ paste0("marketdata-", tradedate, ".RData")),
+ compress="xz")
diff --git a/python/cds_curve.py b/python/cds_curve.py
index ba353269..2e21310d 100644
--- a/python/cds_curve.py
+++ b/python/cds_curve.py
@@ -120,7 +120,6 @@ def calibrate_portfolio(index_type, series):
r = {}
for k, s in index_quotes.iterrows():
trade_date = k[0].date()
- print(trade_date)
sn_quotes = get_singlenames_quotes("{}{}".format(index_type.lower(), series),
trade_date)
Settings().evaluation_date = Date.from_datetime(trade_date)
@@ -148,3 +147,6 @@ def calibrate_portfolio(index_type, series):
d['tweak'].append(eps)
r[trade_date] = pd.DataFrame(d, index=tenors)
return pd.concat(d)
+
+if __name__=="__main__":
+ df = calibrate_portfolio("IG", 27)