| 151 |
151 |
json.dump({"counts": counts, "lp": lp, "var5m": var_res, "vol_connectedness": vol}, open(OUT / "irf.json", "w"), indent=1, default=str) |
| 152 |
152 |
# ---------- tables ---------- |
| 153 |
153 |
def f2(x): return f"{x:.2f}".replace("-", "$-$") |
| 154 |
|
−lines = ["\\begin{table}[tp]\\centering\\footnotesize", "\\begin{threeparttable}", "\\caption{Local-projection responses to announcement-window shocks: persistence of the initial move}", "\\label{tab:lp}", |
| 155 |
|
− "\\begin{tabular}{llccccccccc}", "\\toprule", " & & \\multicolumn{4}{c}{Minutes after release} & \\multicolumn{5}{c}{Yield days after release} \\\\", "\\cmidrule(lr){3-6}\\cmidrule(lr){7-11}", |
|
154 |
+lines = ["\\begin{table}[tp]\\centering\\footnotesize", "\\caption{Local-projection responses to announcement-window shocks: persistence of the initial move}", "\\label{tab:lp}", |
|
155 |
+ "\\resizebox{\\textwidth}{!}{%", "\\begin{tabular}{llccccccccc}", "\\toprule", " & & \\multicolumn{4}{c}{Minutes after release} & \\multicolumn{5}{c}{Yield days after release} \\\\", "\\cmidrule(lr){3-6}\\cmidrule(lr){7-11}", |
| 156 |
156 |
"Release & Response & 25 & 60 & 120 & 240 & 0 & 1 & 2 & 5 & 10 \\\\", "\\midrule"] |
| 157 |
157 |
for typ, lab in (("FOMC", "FOMC statement"), ("CPI", "CPI release"), ("EMP", "Employment report")): |
| 158 |
158 |
key = f"{typ}_all"; first = True |
| 163 |
163 |
cells.append("--" if c is None else f"{f2(c['beta'])}{star}") |
| 164 |
164 |
lines.append(f"{lab + f' ($n={lp[key][chr(110)+'_events']}$)' if first else ''} & {vl} & " + " & ".join(cells) + " \\\\"); first = False |
| 165 |
165 |
lines.append("\\addlinespace") |
| 166 |
|
−lines += ["\\bottomrule", "\\end{tabular}", "\\begin{tablenotes}[flushleft]\\footnotesize", "\\item \\textit{Notes:} Each cell is the slope coefficient $\\beta_h$ of the regression, across scheduled events of the given type (2011--2026), of the cumulated change in the response variable from five minutes before the release to horizon $h$ on the change in the implied 2-year yield over the $[-5,+25)$-minute window (both in basis points), so that $\\beta_h$ is in basis points per basis point of the window move. A coefficient of 1 means that the initial 2-year move is fully persistent (for the 2-year yield itself $\\beta_{25}=1$ by construction); values below 1 indicate reversal, above 1 continuation. Intraday horizons use the minute-level futures-based factors; daily horizons cumulate the futures-based factor changes to the end of the yield day of the release (0) and of the following 1, 2, 5 and 10 yield days. $^{*}$ and $^{**}$: $|\\beta_h/\\mathrm{se}|>1.96$ and $>2.58$ with heteroskedasticity-robust (HC0) standard errors; 95\\% bootstrap intervals are in Figure~\\ref{fig:lp}. No multiple-testing adjustment is applied to this descriptive table.", |
| 167 |
|
− "\\end{tablenotes}", "\\end{threeparttable}", "\\end{table}"] |
|
166 |
+lines += ["\\bottomrule", "\\end{tabular}}", "\\begin{minipage}{\\textwidth}\\footnotesize", "\\textit{Notes:} Each cell is the slope coefficient $\\beta_h$ of the regression, across scheduled events of the given type (2011--2026), of the cumulated change in the response variable from five minutes before the release to horizon $h$ on the change in the implied 2-year yield over the $[-5,+25)$-minute window (both in basis points), so that $\\beta_h$ is in basis points per basis point of the window move. A coefficient of 1 means that the initial 2-year move is fully persistent (for the 2-year yield itself $\\beta_{25}=1$ by construction); values below 1 indicate reversal, above 1 continuation. Intraday horizons use the minute-level futures-based factors; daily horizons cumulate the futures-based factor changes to the end of the yield day of the release (0) and of the following 1, 2, 5 and 10 yield days. $^{*}$ and $^{**}$: $|\\beta_h/\\mathrm{se}|>1.96$ and $>2.58$ with heteroskedasticity-robust (HC0) standard errors; 95\\% bootstrap intervals are in Figure~\\ref{fig:lp}. No multiple-testing adjustment is applied to this descriptive table.", |
|
167 |
+ "\\end{minipage}", "\\end{table}"] |
| 168 |
168 |
(TAB / "tab_lp.tex").write_text("\n".join(lines)) |
| 169 |
|
−lines = ["\\begin{table}[tp]\\centering\\footnotesize", "\\begin{threeparttable}", "\\caption{Connectedness of factor changes (five-minute VAR) and of factor volatilities (daily HAR-VAR)}", "\\label{tab:connect}", |
| 170 |
|
− "\\begin{tabular}{llcccccc}", "\\toprule", "\\multicolumn{8}{l}{\\textit{Panel A: five-minute factor changes, US hours (08:00--16:00~ET), generalized FEVD at 12 steps (one hour)}} \\\\", "\\midrule", |
|
169 |
+lines = ["\\begin{table}[tp]\\centering\\footnotesize", "\\caption{Connectedness of factor changes (five-minute VAR) and of factor volatilities (daily HAR-VAR)}", "\\label{tab:connect}", |
|
170 |
+ "\\resizebox{\\textwidth}{!}{%", "\\begin{tabular}{llcccccc}", "\\toprule", "\\multicolumn{8}{l}{\\textit{Panel A: five-minute factor changes, US hours (08:00--16:00~ET), generalized FEVD at 12 steps (one hour)}} \\\\", "\\midrule", |
| 171 |
171 |
"Period & $p$ & $n$ & \\multicolumn{3}{c}{From others (\\%)} & Total & Impact corr. \\\\", " & & & Short rate & Level & Curvature & (\\%) & (SR,L / SR,C / L,C) \\\\", "\\midrule"] |
| 172 |
172 |
for reg, lab in (("full", "2011--2026"), ("2011_2015", "2011--2015"), ("2016_2019", "2016--2019"), ("2020_2021", "2020--2021"), ("2022_2026", "2022--2026")): |
| 173 |
173 |
r = var_res[reg]; rc = r["resid_corr"] |
| 179 |
179 |
lines.append(f"Share of {n} variance due to & & & {th[i][0]:.1f} & {th[i][1]:.1f} & {th[i][2]:.1f} & & \\\\") |
| 180 |
180 |
lines.append(f"To others & & & {vol['to_others_pct'][0]:.1f} & {vol['to_others_pct'][1]:.1f} & {vol['to_others_pct'][2]:.1f} & {vol['total_connectedness_pct']:.1f} & \\\\") |
| 181 |
181 |
lines.append(f"Net & & & {vol['net_pct'][0]:.1f} & {vol['net_pct'][1]:.1f} & {vol['net_pct'][2]:.1f} & & \\\\".replace(" -", " $-$")) |
| 182 |
|
−lines += ["\\bottomrule", "\\end{tabular}", "\\begin{tablenotes}[flushleft]\\footnotesize", |
| 183 |
|
− f"\\item \\textit{{Notes:}} Panel A: VAR($p$) on five-minute changes (bp) in the short rate ($\\Delta L+\\Delta S$), the level and the curvature, estimated on within-day observations only (no lags across days), lag order by BIC (maximum 6); ``from others'' is the share of the 12-step generalized forecast-error variance of each variable due to shocks to the other two \\citep{{pesaran1998generalized,diebold2012better}}; ``Total'' is the Diebold--Yilmaz total connectedness index; the last column gives the contemporaneous residual correlations. Panel B: VAR({vol['p_bic']}) on the daily log realized variances of the three factors ($n={vol['n']:,}$), 10-day generalized FEVD; rows give the decomposition of each variable's forecast-error variance, ``To others'' the column sums excluding own shares, ``Net'' to-minus-from. Rolling 250-day estimates are in Figure~\\ref{{fig:connect}}. No standard errors are reported.", |
| 184 |
|
− "\\end{tablenotes}", "\\end{threeparttable}", "\\end{table}"] |
|
182 |
+lines += ["\\bottomrule", "\\end{tabular}}", "\\begin{minipage}{\\textwidth}\\footnotesize", |
|
183 |
+ f"\\textit{{Notes:}} Panel A: VAR($p$) on five-minute changes (bp) in the short rate ($\\Delta L+\\Delta S$), the level and the curvature, estimated on within-day observations only (no lags across days), lag order by BIC (maximum 6); ``from others'' is the share of the 12-step generalized forecast-error variance of each variable due to shocks to the other two \\citep{{pesaran1998generalized,diebold2012better}}; ``Total'' is the Diebold--Yilmaz total connectedness index; the last column gives the contemporaneous residual correlations. Panel B: VAR({vol['p_bic']}) on the daily log realized variances of the three factors ($n={vol['n']:,}$), 10-day generalized FEVD; rows give the decomposition of each variable's forecast-error variance, ``To others'' the column sums excluding own shares, ``Net'' to-minus-from. Rolling 250-day estimates are in Figure~\\ref{{fig:connect}}. No standard errors are reported.", |
|
184 |
+ "\\end{minipage}", "\\end{table}"] |
| 185 |
185 |
(TAB / "tab_connect.tex").write_text("\n".join(lines)) |
| 186 |
186 |
print(json.dumps(counts)); print("FOMC all 2y persistence:", {h: round(lp["FOMC_all"]["dy2"][h]["beta"], 2) for h in lp["FOMC_all"]["dy2"] if lp["FOMC_all"]["dy2"][h]}) |
| 187 |
187 |
print("FOMC all 10y:", {h: round(lp["FOMC_all"]["dy10"][h]["beta"], 2) for h in lp["FOMC_all"]["dy10"] if lp["FOMC_all"]["dy10"][h]}) |
| 188 |
188 |
|