qis 3.0.8__tar.gz → 3.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qis-3.0.8 → qis-3.0.10}/PKG-INFO +1 -1
- {qis-3.0.8 → qis-3.0.10}/pyproject.toml +1 -1
- {qis-3.0.8 → qis-3.0.10}/qis/plots/scatter.py +1 -1
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/multi_portfolio_data.py +2 -1
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/strategy_benchmark_factsheet.py +37 -8
- {qis-3.0.8 → qis-3.0.10}/qis/settings.yaml +1 -0
- {qis-3.0.8 → qis-3.0.10}/LICENSE.txt +0 -0
- {qis-3.0.8 → qis-3.0.10}/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/best_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/bond_futures_portfolio.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/bootstrap_analysis.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/boxplot_conditional_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/btc_asset_corr.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/constant_notional.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/constant_weight_portfolios.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/core/perf_bbg_prices.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/core/price_plots.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/core/us_election.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/credit_spreads.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/credit_trackers.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/europe_futures.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/factsheets/multi_assets.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/factsheets/multi_strategy.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/factsheets/pyblogs_reports.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/factsheets/strategy.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/factsheets/strategy_benchmark.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/generate_option_rolls.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/interpolation_infrequent_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/leveraged_strategies.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/long_short.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/momentum_indices.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/oakmark_analysis.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/ohlc_vol_analysis.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/overnight_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/perf_external_assets.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/perp_pricing.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/readme_performances.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/risk_return_frontier.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/rolling_performance.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/seasonality.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/sharpe_vs_sortino.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/simulate_quant_strats.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/test_ewm.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/test_scatter.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/try_pybloqs.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/universe_corrs.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/vix_beta_to_equities_bonds.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/vix_conditional_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/vix_spy_by_year.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/vix_tenor_analysis.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/examples/vol_without_weekends.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/file_utils.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/local_path.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/auto_corr.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/corr_cov_matrix.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/ewm.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/ewm_convolution.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/ewm_factors.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/ewm_winsor_outliers.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/pca.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/plot_correlations.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/linear/ra_returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/stats/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/stats/bootstrap.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/stats/ohlc_vol.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/stats/rolling_stats.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/models/stats/test_bootstrap.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/cond_regression.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/config.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/desc_table.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/fx_ops.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/perf_stats.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/regime_classifier.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/returns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/perfstats/timeseries_bfill.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/bars.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/boxplot.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/contour.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/data_timeseries.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/desc_table.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/drawdowns.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/perf_table.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/prices.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/regime_class_table.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/regime_data.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/regime_pdf.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/regime_scatter.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/returns_heatmap.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/derived/returns_scatter.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/errorbar.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/heatmap.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/histogram.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/histplot2d.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/lineplot.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/pie.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/qqplot.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/reports/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/reports/econ_data_single.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/reports/gantt_data_history.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/reports/price_history.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/reports/utils.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/stackplot.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/table.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/time_series.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/plots/utils.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/backtester.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/ewm_portfolio_risk.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/portfolio_data.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/brinson_attribution.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/config.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/multi_assets_factsheet.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/multi_strategy_factseet_pybloqs.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/multi_strategy_factsheet.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/strategy_benchmark_factsheet_pybloqs.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/strategy_factsheet.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/reports/strategy_signal_factsheet.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/strats/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/strats/quant_strats_delta1.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/portfolio/strats/seasonal_strats.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/sql_engine.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/test_data.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/README.md +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/__init__.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/dates.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_agg.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_cut.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_freq.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_groups.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_melt.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_ops.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_str.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_to_scores.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/df_to_weights.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/generic.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/np_ops.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/ols.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/sampling.py +0 -0
- {qis-3.0.8 → qis-3.0.10}/qis/utils/struct_ops.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: qis
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.0.10
|
4
4
|
Summary: Implementation of visualisation and reporting analytics for Quantitative Investment Strategies
|
5
5
|
License: LICENSE.txt
|
6
6
|
Keywords: quantitative,investing,portfolio optimization,systematic strategies,volatility
|
@@ -92,7 +92,7 @@ def plot_scatter(df: pd.DataFrame,
|
|
92
92
|
hue_ids = df[hue].unique()
|
93
93
|
for idx, hue_id in enumerate(hue_ids):
|
94
94
|
# estimate model equation
|
95
|
-
data_hue = df[df[hue] == hue_id].sort_values(by=x)
|
95
|
+
data_hue = df[df[hue] == hue_id].replace([np.inf, -np.inf], np.nan).dropna().sort_values(by=x)
|
96
96
|
x_ = data_hue[x].to_numpy()
|
97
97
|
y_ = data_hue[y].to_numpy()
|
98
98
|
x1 = qu.get_ols_x(x=x_, order=order, fit_intercept=fit_intercept)
|
@@ -1002,6 +1002,7 @@ class MultiPortfolioData:
|
|
1002
1002
|
regime_benchmark: str = None,
|
1003
1003
|
regime_params: BenchmarkReturnsQuantileRegimeSpecs = REGIME_PARAMS,
|
1004
1004
|
time_period: TimePeriod = None,
|
1005
|
+
title: Optional[str] = 'Tracking error',
|
1005
1006
|
var_format: str = '{:.2%}',
|
1006
1007
|
ax: plt.Subplot = None,
|
1007
1008
|
**kwargs
|
@@ -1012,7 +1013,7 @@ class MultiPortfolioData:
|
|
1012
1013
|
pts.plot_time_series(df=tre,
|
1013
1014
|
var_format=var_format,
|
1014
1015
|
legend_stats=pts.LegendStats.AVG_NONNAN_LAST,
|
1015
|
-
title=
|
1016
|
+
title=title,
|
1016
1017
|
ax=ax,
|
1017
1018
|
**kwargs)
|
1018
1019
|
if regime_benchmark is not None:
|
@@ -513,6 +513,7 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
513
513
|
add_benchmarks_to_navs: bool = True,
|
514
514
|
figsize: Tuple[float, float] = (11.7, 8.3),
|
515
515
|
var_format: str = '{:.1%}',
|
516
|
+
add_titles: bool = True,
|
516
517
|
**kwargs
|
517
518
|
) -> Tuple[Dict[str, plt.Figure], Dict[str, pd.DataFrame]]:
|
518
519
|
"""
|
@@ -528,13 +529,17 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
528
529
|
# navs + ra table
|
529
530
|
fig, ax = plt.subplots(1, 1, figsize=figsize, tight_layout=True)
|
530
531
|
figs['navs'] = fig
|
532
|
+
if add_titles:
|
533
|
+
title = f"Cumulative performance with background colors using bear/normal/bull "
|
534
|
+
f"regimes of {regime_benchmark} {regime_params.freq}-returns"
|
535
|
+
else:
|
536
|
+
title = None
|
531
537
|
multi_portfolio_data.plot_nav(regime_benchmark=regime_benchmark,
|
532
538
|
time_period=time_period,
|
533
539
|
perf_params=perf_params,
|
534
540
|
regime_params=regime_params,
|
535
541
|
add_benchmarks_to_navs=add_benchmarks_to_navs,
|
536
|
-
title=
|
537
|
-
f"regimes of {regime_benchmark} {regime_params.freq}-returns",
|
542
|
+
title=title,
|
538
543
|
ax=ax,
|
539
544
|
**kwargs)
|
540
545
|
|
@@ -567,9 +572,11 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
567
572
|
**weight_kwargs)
|
568
573
|
|
569
574
|
# plot strategy and benchmark weights by ac
|
570
|
-
kwargs = qis.update_kwargs(kwargs, dict(strategy_ticker=strategy_ticker,
|
575
|
+
kwargs = qis.update_kwargs(kwargs, dict(strategy_ticker=f"(B) {strategy_ticker}",
|
576
|
+
benchmark_ticker=f"(A) {benchmark_ticker}"))
|
571
577
|
fig, axs = plt.subplots(1, 2, figsize=figsize, tight_layout=True)
|
572
|
-
|
578
|
+
if add_titles:
|
579
|
+
qis.set_suptitle(fig, title=f"Time series of weights by asset classes")
|
573
580
|
figs['strategy_benchmark_weights_stack'] = fig
|
574
581
|
plot_exposures_strategy_vs_benchmark_stack(strategy_exposures=strategy_exposures_ac,
|
575
582
|
benchmark_exposures=benchmark_exposures_ac,
|
@@ -579,20 +586,24 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
579
586
|
|
580
587
|
# boxplot by subac
|
581
588
|
fig, axs = plt.subplots(1, 2, figsize=figsize, tight_layout=True)
|
582
|
-
|
589
|
+
if add_titles:
|
590
|
+
qis.set_suptitle(fig, title=f"Boxplot of weights")
|
583
591
|
figs['strategy_benchmark_weights_box'] = fig
|
584
592
|
plot_exposures_strategy_vs_benchmark_boxplot(strategy_exposures=strategy_exposures_ac,
|
585
593
|
benchmark_exposures=benchmark_exposures_ac,
|
586
594
|
ax=axs[0],
|
587
595
|
ylabel='Weights',
|
588
596
|
title='(A) Weights by asset classes',
|
597
|
+
hue_var_name='Asset Class',
|
589
598
|
var_format=var_format,
|
599
|
+
allow_negative=True,
|
590
600
|
**kwargs)
|
591
601
|
plot_exposures_strategy_vs_benchmark_boxplot(strategy_exposures=strategy_exposures_subac,
|
592
602
|
benchmark_exposures=benchmark_exposures_subac,
|
593
603
|
ax=axs[1],
|
594
604
|
ylabel='Weights',
|
595
605
|
title='(B) Weights by sub-asset classes',
|
606
|
+
hue_var_name='Sub-Asset Class',
|
596
607
|
var_format=var_format,
|
597
608
|
**kwargs)
|
598
609
|
# risk contributions
|
@@ -617,7 +628,8 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
617
628
|
|
618
629
|
# stack for ac
|
619
630
|
fig, axs = plt.subplots(1, 2, figsize=figsize, tight_layout=True)
|
620
|
-
|
631
|
+
if add_titles:
|
632
|
+
qis.set_suptitle(fig, title=f"Time Series of risk contributions by asset classes")
|
621
633
|
figs['time_series_risk_contrib'] = fig
|
622
634
|
plot_exposures_strategy_vs_benchmark_stack(strategy_exposures=strategy_risk_contributions_ac,
|
623
635
|
benchmark_exposures=benchmark_risk_contributions_ac,
|
@@ -627,13 +639,16 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
627
639
|
|
628
640
|
# box plots for subac
|
629
641
|
fig, axs = plt.subplots(1, 2, figsize=figsize, tight_layout=True)
|
630
|
-
|
642
|
+
if add_titles:
|
643
|
+
qis.set_suptitle(fig, title=f"Boxplot of risk contributions")
|
631
644
|
figs['risk_contributions_boxplot'] = fig
|
632
645
|
plot_exposures_strategy_vs_benchmark_boxplot(
|
633
646
|
strategy_exposures=strategy_risk_contributions_ac,
|
634
647
|
benchmark_exposures=benchmark_risk_contributions_ac,
|
635
648
|
ax=axs[0],
|
636
649
|
title='(A) Risk contributions by asset classes',
|
650
|
+
hue_var_name='Asset Class',
|
651
|
+
ylabel='Risk contributions',
|
637
652
|
var_format=var_format,
|
638
653
|
allow_negative=True,
|
639
654
|
**kwargs)
|
@@ -642,6 +657,8 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
642
657
|
benchmark_exposures=benchmark_risk_contributions_subac,
|
643
658
|
ax=axs[1],
|
644
659
|
title='(B) Risk contributions by sub-asset classes',
|
660
|
+
hue_var_name='Sub-Asset Class',
|
661
|
+
ylabel='Risk contributions',
|
645
662
|
var_format=var_format,
|
646
663
|
allow_negative=True,
|
647
664
|
**kwargs)
|
@@ -649,10 +666,15 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
649
666
|
# tracking error
|
650
667
|
fig, ax = plt.subplots(1, 1, figsize=figsize, tight_layout=True)
|
651
668
|
figs['tre_time_series'] = fig
|
669
|
+
if add_titles:
|
670
|
+
title = 'Tracking Error'
|
671
|
+
else:
|
672
|
+
title = None
|
652
673
|
multi_portfolio_data.plot_tre_time_series(strategy_idx=strategy_idx,
|
653
674
|
benchmark_idx=benchmark_idx,
|
654
675
|
regime_benchmark=regime_benchmark,
|
655
676
|
regime_params=regime_params,
|
677
|
+
title=title,
|
656
678
|
ax=ax,
|
657
679
|
time_period=time_period,
|
658
680
|
**kwargs)
|
@@ -672,8 +694,13 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
672
694
|
|
673
695
|
fig, ax = plt.subplots(1, 1, figsize=figsize, tight_layout=True)
|
674
696
|
figs['brinson_total_time_series'] = fig
|
697
|
+
if add_titles:
|
698
|
+
title = 'Active total return'
|
699
|
+
else:
|
700
|
+
title = None
|
675
701
|
qis.plot_time_series(df=active_total.cumsum(axis=0),
|
676
|
-
title=
|
702
|
+
title=title,
|
703
|
+
legend_stats=qis.LegendStats.LAST,
|
677
704
|
var_format='{:.0%}',
|
678
705
|
ax=ax, **kwargs)
|
679
706
|
if regime_benchmark is not None:
|
@@ -684,6 +711,7 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
684
711
|
figs['brinson_grouped_allocation_return'] = fig
|
685
712
|
qis.plot_time_series(df=grouped_allocation_return.cumsum(axis=0),
|
686
713
|
title='Grouped allocation return',
|
714
|
+
legend_stats=qis.LegendStats.LAST,
|
687
715
|
var_format='{:.0%}',
|
688
716
|
ax=ax, **kwargs)
|
689
717
|
if regime_benchmark is not None:
|
@@ -694,6 +722,7 @@ def weights_tracking_error_report_by_ac_subac(multi_portfolio_data: MultiPortfol
|
|
694
722
|
figs['brinson_grouped_selection_return'] = fig
|
695
723
|
qis.plot_time_series(df=grouped_selection_return.cumsum(axis=0),
|
696
724
|
title='Grouped selection return',
|
725
|
+
legend_stats=qis.LegendStats.LAST,
|
697
726
|
var_format='{:.0%}',
|
698
727
|
ax=ax, **kwargs)
|
699
728
|
if regime_benchmark is not None:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|