Decompose CATE forest into a parametric regression on treatment and forest-based offset term#309
Open
andrewherren wants to merge 11 commits intomainfrom
Open
Decompose CATE forest into a parametric regression on treatment and forest-based offset term#309andrewherren wants to merge 11 commits intomainfrom
andrewherren wants to merge 11 commits intomainfrom
Conversation
- 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
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.
No description provided.