Skip to content

Decompose CATE forest into a parametric regression on treatment and forest-based offset term#309

Open
andrewherren wants to merge 11 commits intomainfrom
cate_forest_intercept
Open

Decompose CATE forest into a parametric regression on treatment and forest-based offset term#309
andrewherren wants to merge 11 commits intomainfrom
cate_forest_intercept

Conversation

@andrewherren
Copy link
Collaborator

No description provided.

andrewherren and others added 11 commits March 10, 2026 10:25
- predict: fix double-scaling bug (tau_0_samples already in original scale)
- summary: add tau_0 posterior summary block
- extract_parameter: add "tau_0"/"treatment_intercept"/"tau_intercept" aliases
- to_json / from_json: serialize/deserialize tau_0_samples as flattened vector + dim scalar
- from_json_string_list: combine tau_0 matrices across chains via np.hstack
- __str__: include "treatment effect intercept model" in model terms when sample_tau_0=True

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reorder the per-iteration sampling sequence in both R and Python so
that the treatment effect intercept (tau_0) is drawn before the tau(X)
forest and adaptive coding parameters. This treats tau_0 as the
parametric baseline and tau(X) as a heterogeneity offset around it,
which is the conceptually natural ordering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- validate_bcf_term: add "tau_0" to the valid term set
- bcf_model_has_term: return model_params$sample_tau_0 for "tau_0"
- computeBCFPosteriorInterval: separate "tau_0" from predict-able terms,
  fetch its interval directly from stored tau_0_samples (no X/Z needed),
  and merge into the result alongside any other requested terms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The test expected Oxford-comma format ending with "global error variance
model", but tau_0 sampling is now on by default so "treatment effect
intercept model" is appended last. Update assertion and docstring to
match the new expected output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rval

Mirror the R posterior_transformation changes in Python:
- Add "tau_0" to the valid terms set and docstring
- Separate "tau_0" from predict-able terms (no X/Z needed)
- Fetch tau_0 interval directly from stored tau_0_samples
- Merge with predict-based intervals into a unified result dict

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When "all" is requested, predict expands it into multiple named keys
in result — "all" itself is never stored as a key. The single-term
unwrap guard now checks `terms[0] in result` before indexing, so "all"
correctly falls through to returning the full dict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ot tau_x (forest) terms and changed prior calibration for tau terms
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.

1 participant