Skip to content

Commit df495ca

Browse files
committed
BUG stoch_vol model returns two arguments now.
1 parent c9307f4 commit df495ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyfolio/plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def plot_drawdown_periods(returns, top=10, ax=None, **kwargs):
419419

420420
ax.set_title('Top %i Drawdown Periods' % top)
421421
ax.set_ylabel('Cumulative returns')
422-
ax.legend(['Portfolio'], 'upper left')
422+
ax.legend(['Portfolio'], loc='upper left')
423423
ax.set_xlabel('')
424424
return ax
425425

pyfolio/tears.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,14 +838,14 @@ def create_bayesian_tear_sheet(returns, benchmark_rets=None,
838838

839839
if stoch_vol:
840840
# run stochastic volatility model
841+
returns_cutoff = 400
841842
print(
842843
"\nRunning stochastic volatility model on "
843-
"most recent 400 days of returns."
844+
"most recent {} days of returns.".format(returns_cutoff)
844845
)
845-
returns_cutoff = 400
846846
if df_train.size > returns_cutoff:
847847
df_train_truncated = df_train[-returns_cutoff:]
848-
trace_stoch_vol = bayesian.model_stoch_vol(df_train_truncated)
848+
_, trace_stoch_vol = bayesian.model_stoch_vol(df_train_truncated)
849849
previous_time = timer(
850850
"running stochastic volatility model", previous_time)
851851

0 commit comments

Comments
 (0)