Add c17: model-comparison table generator (Table 2 source of record) - #4
Open
Murad Farzulla (studiofarzulla) wants to merge 1 commit into
Open
Add c17: model-comparison table generator (Table 2 source of record)#4Murad Farzulla (studiofarzulla) wants to merge 1 commit into
Murad Farzulla (studiofarzulla) wants to merge 1 commit into
Conversation
…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 started reviewing on behalf of
Murad Farzulla (studiofarzulla)
August 5, 2026 01:09
View session
There was a problem hiding this comment.
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.pyto tabulate_archive/.../model_parameters/*.jsoninto a model-comparison CSV. - Add generated output
results/c17-model-comparison.csvcontaining 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 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tabulates the frozen
_archive/.../model_parameters/*.jsonmodel-selection run intoresults/c17-model-comparison.csvunder 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