SPB Git forge

spb/wp12_uqo

Public
5commits 1branches 0releases
1.2 MBsize
maindefault branch
1 mo agolast push
Python 75.9% TeX 24%

WP12 skeleton: UQO series layout + LaTeX template + config.yaml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Simon-Pierre Boucher committed 1 mo ago (Aug 10, 2026)

17 changed files +415 −0

added .gitignore +22 −0
@@ -0,0 +1,22 @@
1 +# Raw & processed data — downloaded market data are NOT committed
2 +data/raw/*.parquet
3 +data/raw/*.csv
4 +data/processed/*.parquet
5 +
6 +# Python
7 +__pycache__/
8 +*.pyc
9 +.pytest_cache/
10 +
11 +# LaTeX build artifacts (paper/main.pdf IS committed)
12 +paper/*.aux
13 +paper/*.log
14 +paper/*.out
15 +paper/*.fls
16 +paper/*.fdb_latexmk
17 +paper/*.bbl
18 +paper/*.blg
19 +paper/*.synctex.gz
20 +
21 +# macOS
22 +.DS_Store
added config.yaml +129 −0
@@ -0,0 +1,129 @@
1 +# ================================================================
2 +# Auteur : Simon-Pierre Boucher
3 +# Contact : contact@spboucher.ai
4 +# Projet : Prévision de volatilité réalisée multi-actifs
5 +# (HAR-RV vs GARCH vs Machine Learning)
6 +# Fichier : config.yaml
7 +# Description : Configuration centrale du pipeline — univers d'actifs,
8 +# fenêtres d'estimation, horizons, seeds, chemins.
9 +# ================================================================
10 +
11 +api:
12 + base_url: "https://www.hfmarketdata.io"
13 + rate_limit_per_sec: 4 # requests per second (polite default)
14 + max_retries: 5
15 + backoff_base_sec: 1.0 # exponential backoff: base * 2**attempt
16 + timeout_sec: 60
17 + page_limit: 50000 # max rows per request page
18 + cache_dir: "data/raw" # parquet cache, one file per (asset, ticker, timeframe)
19 +
20 +# ---------------------------------------------------------------- universe
21 +# Validated against /v1/{asset}/tickers on 2026-08-10.
22 +# NOTE: BNB is NOT available in the API -> replaced by ADA.
23 +universe:
24 + equity: # asset class in API: stock / etf
25 + - {ticker: SPY, asset: etf}
26 + - {ticker: QQQ, asset: etf}
27 + - {ticker: IWM, asset: etf}
28 + - {ticker: GLD, asset: etf}
29 + - {ticker: TLT, asset: etf}
30 + - {ticker: AAPL, asset: stock}
31 + - {ticker: MSFT, asset: stock}
32 + - {ticker: NVDA, asset: stock}
33 + - {ticker: JPM, asset: stock}
34 + - {ticker: XOM, asset: stock}
35 + fx:
36 + - {ticker: EURUSD, asset: fx}
37 + - {ticker: USDJPY, asset: fx}
38 + - {ticker: GBPUSD, asset: fx}
39 + - {ticker: USDCAD, asset: fx}
40 + - {ticker: AUDUSD, asset: fx}
41 + crypto:
42 + - {ticker: BTC, asset: crypto}
43 + - {ticker: ETH, asset: crypto}
44 + - {ticker: SOL, asset: crypto}
45 + - {ticker: ADA, asset: crypto} # BNB unavailable in API
46 + - {ticker: XRP, asset: crypto}
47 + futures: # continuous, back-adjusted (ratio)
48 + - {ticker: ES, asset: futures}
49 + - {ticker: NQ, asset: futures}
50 + - {ticker: CL, asset: futures}
51 + - {ticker: GC, asset: futures}
52 + - {ticker: ZN, asset: futures}
53 +
54 +predictors: # used as features only, not forecast targets
55 + index:
56 + - {ticker: VIX, asset: index}
57 +
58 +adjustment: # per asset class
59 + stock: adj_splitdiv
60 + etf: adj_splitdiv
61 + futures: contin_adj_ratio
62 + crypto: none
63 + index: none
64 + fx: none
65 +
66 +sample:
67 + start: "2013-01-01" # common start (BTC begins 2013-04)
68 + end: "2026-07-31"
69 + timeframes: ["1min", "5min"] # intraday inputs for RV
70 + trading_hours: # local exchange time as served by the API
71 + equity: {open: "09:30", close: "16:00"} # RTH only for RV
72 + futures: {open: "00:00", close: "23:59"} # near-24h; sessions handled in code
73 + fx: {open: "00:00", close: "23:59"} # Sun 17:00 -> Fri 17:00 ET
74 + crypto: {open: "00:00", close: "23:59"} # 24/7, day = calendar day UTC
75 + min_intraday_bars: 30 # drop days with fewer valid 1-min bars (equity RTH)
76 +
77 +realized_vol:
78 + base_frequency_min: 5 # headline RV: 5-min subsampled
79 + subsample_offsets: 5 # number of 1-min offset grids averaged
80 + kernel: parzen # realized kernel (BNHLS 2008)
81 + jump_test_alpha: 0.001 # BNS test size for jump detection
82 + annualization_days: 252
83 +
84 +models:
85 + har_lags: [1, 5, 22]
86 + garch:
87 + dists: ["normal"]
88 + rescale: true
89 + ml:
90 + seed: 20260810
91 + tuning: walk_forward # strict temporal CV
92 + n_splits: 4
93 + feature_sets: ["har", "extended"]
94 + lstm: {seq_len: 22, hidden: 64, layers: 1, epochs: 50, patience: 8}
95 + transformer: {seq_len: 22, d_model: 32, heads: 4, blocks: 2, epochs: 50, patience: 8}
96 +
97 +evaluation:
98 + estimation_window_days: 1000
99 + reestimation_freq_days: 22 # monthly
100 + horizons: [1, 5, 22]
101 + losses: ["qlike", "mse"]
102 + mcs_alpha: 0.10
103 + mcs_bootstrap: 5000
104 +
105 +robustness:
106 + subperiods:
107 + pre2020: ["2013-01-01", "2019-12-31"]
108 + covid: ["2020-01-01", "2020-12-31"]
109 + inflation: ["2021-01-01", "2022-12-31"]
110 + recent: ["2024-01-01", "2026-07-31"]
111 + window_sizes: [500, 1000, 2000]
112 + frequencies: ["rv1min", "rv5min_ss", "rkernel"]
113 +
114 +backtest:
115 + vol_target_ann: 0.10
116 + leverage_cap: 3.0
117 + tc_bps: 5.0
118 + tc_grid_bps: [0, 5, 10, 20]
119 + var_levels: [0.01, 0.05]
120 + risk_aversion: 5.0
121 +
122 +paths:
123 + raw: "data/raw"
124 + processed: "data/processed"
125 + figures: "figures"
126 + tables: "results/tables"
127 + reproduced: "results/reproduced"
128 +
129 +seed: 20260810
added paper/.latexmkrc +6 −0
@@ -0,0 +1,6 @@
1 +# Author: Simon-Pierre Boucher — contact@spboucher.ai
2 +$pdf_mode = 1;
3 +$pdflatex = 'pdflatex -interaction=nonstopmode -halt-on-error -synctex=1 %O %S';
4 +$bibtex_use = 2;
5 +$clean_ext = 'synctex.gz run.xml bbl bcf fdb_latexmk fls log aux out toc lof lot blg';
6 +@default_files = ('main.tex');
added paper/Makefile +9 −0
@@ -0,0 +1,9 @@
1 +# Author: Simon-Pierre Boucher — contact@spboucher.ai
2 +all:
3 + latexmk -pdf main.tex
4 +
5 +clean:
6 + latexmk -c
7 +
8 +distclean:
9 + latexmk -C
added paper/main.tex +103 −0
@@ -0,0 +1,103 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : main.tex
7 +% Description : Document maître du papier — préambule, métadonnées,
8 +% inclusion des sections. Build: latexmk -pdf main.tex
9 +% ================================================================
10 +% UQO Working Paper No. 12
11 +% Figures are read from ../figures/, tables from ../results/tables/.
12 +% ============================================================================
13 +\documentclass[12pt,letterpaper]{article}
14 +
15 +\usepackage[utf8]{inputenc}
16 +\usepackage[T1]{fontenc}
17 +\usepackage[english]{babel}
18 +
19 +\usepackage[letterpaper,margin=1in]{geometry}
20 +\usepackage{setspace}
21 +\onehalfspacing
22 +
23 +\usepackage{mathptmx}
24 +\usepackage{microtype}
25 +
26 +\usepackage{amsmath,amssymb,amsthm}
27 +
28 +\usepackage{booktabs}
29 +\usepackage{threeparttable}
30 +\usepackage{makecell}
31 +
32 +\usepackage{graphicx}
33 +\usepackage{subcaption}
34 +\graphicspath{{../figures/}{./}}
35 +
36 +\usepackage[font=small,labelfont=bf,labelsep=period,justification=justified,singlelinecheck=false]{caption}
37 +
38 +\usepackage[dvipsnames]{xcolor}
39 +\usepackage[colorlinks=true,linkcolor=NavyBlue,citecolor=NavyBlue,urlcolor=NavyBlue,breaklinks=true]{hyperref}
40 +
41 +\usepackage[authoryear,round,semicolon]{natbib}
42 +\bibliographystyle{aer}
43 +
44 +\usepackage{titlesec}
45 +\titleformat{\section}{\large\bfseries}{\thesection.}{0.5em}{}
46 +\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection.}{0.5em}{}
47 +\titleformat{\subsubsection}{\normalsize\itshape}{\thesubsubsection.}{0.5em}{}
48 +\usepackage{fancyhdr}
49 +\pagestyle{fancy}\fancyhf{}
50 +\renewcommand{\headrulewidth}{0pt}
51 +\fancyfoot[C]{\thepage}
52 +\usepackage{enumitem}
53 +\setlist{nosep,leftmargin=*}
54 +
55 +% ============================================================================
56 +% METADATA
57 +% ============================================================================
58 +\newcommand{\WPnumber}{12}
59 +\newcommand{\WPtitle}{Forecasting Realized Volatility Across Asset Classes}
60 +\newcommand{\WPsubtitle}{HAR, GARCH, and Machine Learning in a Unified
61 + Multi-Asset Horse Race, 2013--2026}
62 +\newcommand{\WPdate}{August 2026}
63 +\newcommand{\WPversion}{0.1 (draft)}
64 +\newcommand{\WPkeywords}{Realized volatility, HAR-RV, GARCH, Machine
65 + learning, Volatility forecasting, Model confidence set, Volatility timing}
66 +\newcommand{\WPjel}{C22, C45, C53, G17}
67 +
68 +\newcommand{\WPauthor}{Simon-Pierre Boucher}
69 +\newcommand{\WPaffiliation}{D\'epartement des sciences administratives\\
70 + Universit\'e du Qu\'ebec en Outaouais}
71 +\newcommand{\WPemail}{contact@spboucher.ai}
72 +\newcommand{\WPaddress}{Gatineau -- Pavillon Alexandre-Tach\'e\\
73 + 283, boulevard Alexandre-Tach\'e\\ Gatineau, Qu\'ebec, Canada J9A 1L8}
74 +
75 +% PLACEHOLDER — the abstract is written LAST, from the actual pipeline results.
76 +\newcommand{\WPabstract}{%
77 +[TO BE WRITTEN AFTER THE EMPIRICAL PIPELINE HAS RUN --- 150 words,
78 +summarising the multi-asset comparison of HAR-type, GARCH-type and
79 +machine-learning forecasts of realized volatility, the evaluation design
80 +(rolling out-of-sample, QLIKE/MSE, Diebold--Mariano, Model Confidence Set),
81 +the headline empirical findings, and the economic-value results.]}
82 +
83 +\begin{document}
84 +
85 +\input{sections/titlepage}
86 +
87 +\setcounter{page}{1}
88 +\input{sections/introduction}
89 +\input{sections/literature}
90 +\input{sections/data}
91 +\input{sections/methodology}
92 +\input{sections/results}
93 +\input{sections/robustness}
94 +\input{sections/economic_value}
95 +\input{sections/conclusion}
96 +
97 +\newpage
98 +\bibliography{references}
99 +
100 +\appendix
101 +\input{sections/appendix}
102 +
103 +\end{document}
added paper/references.bib +0 −0
added paper/sections/appendix.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : appendix.tex
7 +% Description : Section « appendix » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/conclusion.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : conclusion.tex
7 +% Description : Section « conclusion » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/data.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : data.tex
7 +% Description : Section « data » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/economic_value.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : economic_value.tex
7 +% Description : Section « economic_value » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/introduction.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : introduction.tex
7 +% Description : Section « introduction » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/literature.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : literature.tex
7 +% Description : Section « literature » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/methodology.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : methodology.tex
7 +% Description : Section « methodology » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/results.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : results.tex
7 +% Description : Section « results » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/robustness.tex +8 −0
@@ -0,0 +1,8 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : robustness.tex
7 +% Description : Section « robustness » — à rédiger après exécution du pipeline.
8 +% ================================================================
added paper/sections/titlepage.tex +74 −0
@@ -0,0 +1,74 @@
1 +% ================================================================
2 +% Auteur : Simon-Pierre Boucher
3 +% Contact : contact@spboucher.ai
4 +% Projet : Prévision de volatilité réalisée multi-actifs
5 +% (HAR-RV vs GARCH vs Machine Learning)
6 +% Fichier : titlepage.tex
7 +% Description : Page titre et page résumé (format série UQO WP).
8 +% ================================================================
9 +\thispagestyle{empty}
10 +
11 +\begin{center}
12 +
13 +\includegraphics[width=4cm]{uq_logo.jpg}
14 +
15 +\vspace{0.6cm}
16 +
17 +{\footnotesize\textsc{Universit\'e du Qu\'ebec en Outaouais}}\\[0.15cm]
18 +{\footnotesize\textsc{D\'epartement des sciences administratives}}
19 +
20 +\vspace{0.8cm}
21 +
22 +{\footnotesize\textsc{Working Paper No.~\WPnumber}}
23 +
24 +\vspace{1.2cm}
25 +
26 +{\LARGE\bfseries \WPtitle\par}
27 +
28 +\vspace{0.4cm}
29 +{\large\itshape \WPsubtitle\par}
30 +
31 +\vspace{1.2cm}
32 +
33 +{\large \WPauthor}\\[0.3cm]
34 +{\normalsize \WPaffiliation}\\[0.15cm]
35 +{\normalsize \href{mailto:\WPemail}{\WPemail}}\\[0.15cm]
36 +{\small \WPaddress}
37 +
38 +\vspace{0.8cm}
39 +
40 +{\normalsize \WPdate}\\[0.1cm]
41 +{\small Version~\WPversion}
42 +
43 +\end{center}
44 +
45 +\vfill
46 +
47 +\newpage
48 +
49 +% ---------------------------------------------------------------- abstract
50 +\thispagestyle{empty}
51 +
52 +\vspace*{1cm}
53 +
54 +\noindent\rule{\textwidth}{0.4pt}
55 +\vspace{0.3cm}
56 +
57 +\noindent\textbf{Abstract}
58 +
59 +\vspace{0.15cm}
60 +
61 +\noindent\WPabstract
62 +
63 +\vspace{0.4cm}
64 +
65 +\noindent\textbf{Keywords:} \WPkeywords
66 +
67 +\vspace{0.15cm}
68 +
69 +\noindent\textbf{JEL Classification:} \WPjel
70 +
71 +\vspace{0.3cm}
72 +\noindent\rule{\textwidth}{0.4pt}
73 +
74 +\newpage
added paper/uq_logo.jpg +0 −0

Binary file not shown.