quantstats-pro 0.4.1__py3-none-any.whl
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.
- quantstats/__init__.py +163 -0
- quantstats/_compat.py +431 -0
- quantstats/_montecarlo.py +296 -0
- quantstats/_numpy_compat.py +289 -0
- quantstats/_plotting/__init__.py +0 -0
- quantstats/_plotting/core.py +2173 -0
- quantstats/_plotting/wrappers.py +2109 -0
- quantstats/_reporting/__init__.py +12 -0
- quantstats/_reporting/engine.py +37 -0
- quantstats/_reporting/sections.py +223 -0
- quantstats/alphadecay/__init__.py +25 -0
- quantstats/alphadecay/core.py +712 -0
- quantstats/alphadecay/plotting.py +206 -0
- quantstats/montecarlo/__init__.py +34 -0
- quantstats/montecarlo/analytics.py +291 -0
- quantstats/montecarlo/base.py +92 -0
- quantstats/montecarlo/core.py +175 -0
- quantstats/montecarlo/models/__init__.py +15 -0
- quantstats/montecarlo/models/bayesian.py +88 -0
- quantstats/montecarlo/models/block_bootstrap.py +108 -0
- quantstats/montecarlo/models/bootstrap.py +38 -0
- quantstats/montecarlo/models/garch.py +83 -0
- quantstats/montecarlo/models/gbm.py +44 -0
- quantstats/montecarlo/models/heston.py +103 -0
- quantstats/montecarlo/models/jump_diffusion.py +86 -0
- quantstats/montecarlo/models/shuffle.py +49 -0
- quantstats/montecarlo/models/trimmed.py +50 -0
- quantstats/montecarlo/plotting.py +324 -0
- quantstats/montecarlo/registry.py +34 -0
- quantstats/plots.py +27 -0
- quantstats/py.typed +0 -0
- quantstats/report.html +64 -0
- quantstats/report_alpha_decay.html +43 -0
- quantstats/report_montecarlo.html +62 -0
- quantstats/report_simple.html +58 -0
- quantstats/reports.py +3502 -0
- quantstats/stats.py +3321 -0
- quantstats/utils.py +1011 -0
- quantstats/version.py +1 -0
- quantstats_pro-0.4.1.dist-info/METADATA +509 -0
- quantstats_pro-0.4.1.dist-info/RECORD +43 -0
- quantstats_pro-0.4.1.dist-info/WHEEL +4 -0
- quantstats_pro-0.4.1.dist-info/licenses/LICENSE.txt +202 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- generated by QuantStats Pro (montecarlo) -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
9
|
+
<title>Monte Carlo Tearsheet (generated by QuantStats Pro)</title>
|
|
10
|
+
<meta name="robots" content="noindex, nofollow">
|
|
11
|
+
<style>
|
|
12
|
+
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:30px;background:#fff;color:#000}body,p,table,td,th{font:13px/1.4 Arial,sans-serif}.container{max-width:1024px;margin:auto}img,svg{width:100%}h1,h2,h3,h4{font-weight:400;margin:0}h1 dt{display:inline;margin-left:10px;font-size:14px}h3{margin:30px 0 10px;font-weight:700}h4{color:grey}h4 a{color:#09c;text-decoration:none}h4 a:hover{color:#069;text-decoration:underline}hr{margin:25px 0 30px;height:0;border:0;border-top:1px solid #ccc}table{margin:0 0 30px;border:0;border-spacing:0;width:100%}table td,table th{text-align:right;padding:4px 6px 3px 6px}table th{text-align:right;padding:6px;font-weight:700;background:#2d2d2d;color:#fff}table td:first-of-type,table th:first-of-type{text-align:left}table tbody tr:nth-child(even){background:#f6f6f6}table tbody tr.historical{background:#eef2f7;font-weight:600}table td.risk{background:#fff3e0;font-weight:600}table td.params{text-align:left;font-size:12px;color:#444}table td.params strong{color:#000}.grid{display:flex;flex-wrap:wrap;gap:10px}.cell{width:49%}.cell.full{width:100%}.kpi-row{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0 20px}.kpi-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:15px 0 25px}@media(max-width:640px){.kpi-grid{grid-template-columns:repeat(2,1fr)}}.kpi{border:1px solid #e3e3e3;border-radius:6px;padding:12px 14px;background:#fafafa;box-shadow:0 1px 2px rgba(0,0,0,.04)}.kpi-grid .kpi{border-left:3px solid #9e9e9e;background:#fff}.kpi-grid .kpi.risk{border-left-color:#c62828}.kpi-grid .kpi.upside{border-left-color:#2e7d32}.kpi-grid .kpi.risk .value{color:#c62828}.kpi-grid .kpi.upside .value{color:#2e7d32}.kpi .label{font-size:11px;color:#666;text-transform:uppercase;letter-spacing:.03em}.kpi .value{font-size:22px;font-weight:700;margin-top:4px}.kpi .hint{font-size:11px;color:#999;margin-top:4px}.note{color:#666;font-size:12px;margin:0 0 15px;line-height:1.5}.stress-note{background:#fff8e1;border-left:3px solid #f9a825;padding:10px 14px;margin:0 0 15px;font-size:12px;color:#555}details{margin:15px 0 25px;border:1px solid #ddd;border-radius:4px;padding:0}details summary{cursor:pointer;padding:10px 14px;font-weight:700;background:#f6f6f6}details .inner{padding:10px 14px 14px}footer{margin-top:30px;padding-top:15px;border-top:1px solid #ccc;font-size:11px;color:#888;line-height:1.6}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
|
|
18
|
+
<div class="container">
|
|
19
|
+
|
|
20
|
+
<h1>{{title}} <dt>{{date_range}}</dt></h1>
|
|
21
|
+
<h4>{{params}} Generated by <a href="https://github.com/diegoalvarezmgl/quantstats-pro/" target="quantstats">QuantStats Pro</a> (v. {{v}}) at {{generated_at}}</h4>
|
|
22
|
+
<hr>
|
|
23
|
+
|
|
24
|
+
<h3>Risk Summary</h3>
|
|
25
|
+
<p class="note">Median across Monte Carlo models — robust consensus view of forward risk. Informational only; no pass/fail thresholds.</p>
|
|
26
|
+
{{assessment}}
|
|
27
|
+
|
|
28
|
+
<h3>Monte Carlo Models</h3>
|
|
29
|
+
<p class="note">Historical row shows the empirical distribution of realised outcomes over all overlapping horizon-length windows of the full history — directly comparable with each model's simulated distribution. Hist. Percentile ranks the historical median outcome within each model's simulated terminals.</p>
|
|
30
|
+
<div id="comparison">{{comparison_table}}</div>
|
|
31
|
+
|
|
32
|
+
<h3>Projected Paths</h3>
|
|
33
|
+
<div id="overlay_fan" class="cell full">{{overlay_fan}}</div>
|
|
34
|
+
|
|
35
|
+
<h3>Drawdown Distribution</h3>
|
|
36
|
+
<div id="maxdd_dist" class="cell full">{{maxdd_dist}}</div>
|
|
37
|
+
|
|
38
|
+
<h3>CAGR Scenarios</h3>
|
|
39
|
+
<div id="cagr_quantiles" class="cell full">{{cagr_quantiles}}</div>
|
|
40
|
+
|
|
41
|
+
<h3>Stress Tests</h3>
|
|
42
|
+
<p class="stress-note">Conservative envelope (worst model per metric) and trimmed bootstrap — deliberately pessimistic views for tail-risk stress.</p>
|
|
43
|
+
{{stress_section}}
|
|
44
|
+
|
|
45
|
+
<details>
|
|
46
|
+
<summary>Model Calibration (parameters estimated from full history)</summary>
|
|
47
|
+
<div class="inner" id="calibration">{{calibration_table}}</div>
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<details>
|
|
51
|
+
<summary>Per-Model Detail (fan charts & terminal distributions)</summary>
|
|
52
|
+
<div class="inner">
|
|
53
|
+
<div id="fan_charts" class="grid">{{fan_charts}}</div>
|
|
54
|
+
<div id="terminal_hists" class="grid">{{terminal_hists}}</div>
|
|
55
|
+
</div>
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
<footer>{{assumptions}}</footer>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
</body>
|
|
62
|
+
</html>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!-- generated by QuantStats Pro (simple) -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
9
|
+
<title>Tearsheet (generated by QuantStats Pro)</title>
|
|
10
|
+
<meta name="robots" content="noindex, nofollow">
|
|
11
|
+
<style>
|
|
12
|
+
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:30px;background:#fff;color:#000}body,p,table,td,th{font:13px/1.4 Arial,sans-serif}.container{max-width:960px;margin:auto}img,svg{width:100%}h1,h2,h3,h4{font-weight:400;margin:0}h1 dt{display:inline;margin-left:10px;font-size:14px}h3{margin-bottom:10px;font-weight:700}h4{color:grey}h4 a{color:#09c;text-decoration:none}h4 a:hover{color:#069;text-decoration:underline}hr{margin:25px 0 40px;height:0;border:0;border-top:1px solid #ccc}#left{width:620px;margin-right:18px;margin-top:-1.2rem;float:left}#right{width:320px;float:right}#left svg{margin:-1.5rem 0}table{margin:0 0 40px;border:0;border-spacing:0;width:100%}table td,table th{text-align:right;padding:4px 5px 3px 5px}table th{text-align:right;padding:6px 5px 5px 5px}table td:first-of-type,table th:first-of-type{text-align:left;padding-left:2px}table td:last-of-type,table th:last-of-type{text-align:right;padding-right:2px}td hr{margin:5px 0}table th{font-weight:400}table thead th{font-weight:700;background:#2d2d2d;color:#fff}#eoy table td:after{content:"%"}#eoy table td:first-of-type:after,#eoy table td:last-of-type:after,#eoy table td:nth-of-type(4):after{content:""}#eoy table th{text-align:right}#eoy table th:first-of-type{text-align:left}#eoy table td:after{content:"%"}#eoy table td:first-of-type:after,#eoy table td:last-of-type:after{content:""}#ddinfo table td:nth-of-type(3):after{content:"%"}#ddinfo table th{text-align:right}#ddinfo table td:first-of-type,#ddinfo table td:nth-of-type(2),#ddinfo table th:first-of-type,#ddinfo table th:nth-of-type(2){text-align:left}#ddinfo table td:nth-of-type(3):after{content:"%"}
|
|
13
|
+
|
|
14
|
+
@media print{hr{margin:25px 0}body{margin:0}.container{max-width:100%;margin:0}#left{width:55%;margin:0}#left svg{margin:0 0 -10%}#left svg:first-of-type{margin-top:-30%}#right{margin:0;width:45%}}
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
|
|
18
|
+
<body>
|
|
19
|
+
|
|
20
|
+
<div class="container">
|
|
21
|
+
|
|
22
|
+
<h1>{{title}} <dt>{{date_range}}{{matched_dates}}</dt></h1>
|
|
23
|
+
<h4>{{params}} Generated by <a href="https://github.com/diegoalvarezmgl/quantstats-pro/" target="quantstats">QuantStats Pro</a> (v. {{v}}) at {{generated_at}}</h4>
|
|
24
|
+
<hr>
|
|
25
|
+
|
|
26
|
+
<div id="left">
|
|
27
|
+
|
|
28
|
+
<div>
|
|
29
|
+
{{returns}}
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div id="log_returns">{{log_returns}}</div>
|
|
33
|
+
<div id="vol_returns">{{vol_returns}}</div>
|
|
34
|
+
<div id="eoy_returns">{{eoy_returns}}</div>
|
|
35
|
+
<div id="daily_dist">{{daily_dist}}</div>
|
|
36
|
+
<div id="rolling_vol">{{rolling_vol}}</div>
|
|
37
|
+
<div id="dd_periods">{{dd_periods}}</div>
|
|
38
|
+
<div id="dd_plot">{{dd_plot}}</div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div id="right">
|
|
43
|
+
<h3>Key Performance Metrics</h3>
|
|
44
|
+
{{metrics}}
|
|
45
|
+
|
|
46
|
+
<div id="eoy">{{eoy_title}}
|
|
47
|
+
{{eoy_table}}</div>
|
|
48
|
+
|
|
49
|
+
<div id="ddinfo">
|
|
50
|
+
<h3>Worst 5 Drawdowns</h3>
|
|
51
|
+
{{dd_info}}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
<style>*{white-space:auto !important;}</style>
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|