Skip to content

Add c17: model-comparison table generator (Table 2 source of record) - #4

Open
Murad Farzulla (studiofarzulla) wants to merge 1 commit into
mainfrom
add-c17-model-comparison
Open

Add c17: model-comparison table generator (Table 2 source of record)#4
Murad Farzulla (studiofarzulla) wants to merge 1 commit into
mainfrom
add-c17-model-comparison

Conversation

@studiofarzulla

Copy link
Copy Markdown
Collaborator

Tabulates the frozen _archive/.../model_parameters/*.json model-selection run into results/c17-model-comparison.csv under the k=10 mean-profiled convention. Output verified to match the corrected manuscript's Table 2 cell-for-cell (incl. the XRP AIC dead heat and BNB's GARCH(1,1) preference on the unrounded criterion).

🤖 Generated with Claude Code

…selection JSONs

Closes the one paper<->code gap with no active generating script: the
manuscript's model-comparison table (AIC/BIC/LogLik per asset/model) now
tabulates reproducibly from the archived model-selection run, under the
k=10 (mean-profiled) convention the corrected manuscript states.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 5, 2026 01:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reproducible “source of record” generator for the manuscript’s Table 2 model-comparison table by extracting AIC/BIC from the frozen archived model-selection JSON artifacts and committing the resulting CSV to results/.

Changes:

  • Add code/c17_model_comparison.py to tabulate _archive/.../model_parameters/*.json into a model-comparison CSV.
  • Add generated output results/c17-model-comparison.csv containing AIC/BIC/loglik per (asset, model) under the k=10 mean-profiled convention for the X specification.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
code/c17_model_comparison.py New script to regenerate Table 2 from archived JSONs and write the canonical comparison CSV.
results/c17-model-comparison.csv Committed generated table output (one row per asset/model).
Suppressed comments (1)

code/c17_model_comparison.py:33

  • The inline comment says “parameter count with mean profiled”, but the MODELS mapping uses k=5/6 for the non-X models (which implies μ is counted). Update the comment to reflect the actual convention used here so readers don’t assume μ is always profiled out.
# model label in JSON -> (manuscript label, parameter count with mean profiled)
MODELS = {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +17
Parameter-count convention (matches the manuscript's ten-parameter statement):
the estimators profile the mean at the sample mean, so the GJR-GARCH-X
information criteria correspond to k = 10 (omega, alpha, gamma, beta, nu + 5
exogenous coefficients); BIC - AIC = k * (ln n - 2). LogLik is recovered from
AIC as (2k - AIC) / 2.
Comment on lines +43 to +49
for asset in ASSETS:
with open(JSON_DIR / f"{asset}_parameters.json") as f:
data = json.load(f)
for json_label, (paper_label, k) in MODELS.items():
block = data[json_label]
aic, bic = float(block["AIC"]), float(block["BIC"])
loglik = (2 * k - aic) / 2
Comment on lines +60 to +64
out = OUT_DIR / "c17-model-comparison.csv"
with open(out, "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=list(rows[0].keys()))
w.writeheader()
w.writerows(rows)
@@ -0,0 +1,19 @@
asset,model,k_params,AIC,BIC,loglik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants