diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/exploration/VaR.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/exploration/VaR.py b/python/exploration/VaR.py index f578bf84..50d637f7 100644 --- a/python/exploration/VaR.py +++ b/python/exploration/VaR.py @@ -32,7 +32,7 @@ def hist_var(portf, index_type='IG', quantile=.05, years=5): for k, g in returns.groupby(level='date', as_index=False): shocks = g.reset_index('date', drop=True).stack('tenor') shocks.name = 'shocks' - portf.spread = spreads.spread * (1 + spreads.join(shocks).shocks) - r.append((k, portf.pnl)) + portf.spread = spreads.spread * (1 + spreads.join(shocks).shocks) + r.append((k, portf.pnl)) pnl = pd.DataFrame.from_records(r, columns=['date', 'pnl'], index=['date']) - return pnl.quantile(quantile) * math.sqrt(12)
\ No newline at end of file + return pnl.quantile(quantile) * math.sqrt(20) |
