Repository navigation
Fix honest sample splitting - #46
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the NetworkCausalTree estimation step to compute effects on the estimation (non-discovery) clusters only, and adjusts plot-related tests to use the newer function arguments/settings.
Changes:
- Compute
compute_effects_nct()inputs onest_unitsonly (clusters not in the discovery set). - Update plot tests to pass
K,effect_weights, and usemethod = "singular". - Increase simulated data size in plot tests.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/testthat/test-plot_NCT.R | Updates test inputs/arguments for NetworkCausalTree() and larger generated data. |
| R/NetworkCausalTree.R | Changes effect estimation to run on the estimation subset rather than the full sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fit <- NetworkCausalTree( | ||
| Y = d$Y, W = d$W, X = d$X, A = d$A, p = d$p, | ||
| method = "OF", depth = 1, minsize = 20, | ||
| ratio_disc = 0.5, | ||
| output = "detection" | ||
| K = d$K, | ||
| effect_weights = c(1,0,0,0), | ||
| method = "singular", depth = 1, minsize = 20, | ||
| ratio_disc = 0.5 | ||
| ) |
There was a problem hiding this comment.
@charliewang123 could you please provide this fix? You can detail this also in the first answer to the reviewer question.
| N = length(est_units), | ||
| W = W[est_units], | ||
| G = G[est_units], | ||
| Y = Y[est_units], | ||
| X = X[est_units, , drop = FALSE], | ||
| p = p[est_units], | ||
| Ne = Ne[est_units], | ||
| Ne_list = Ne_list_est, |
There was a problem hiding this comment.
@charliewang123 could you please provide this fix? You can detail this also in the first answer to the reviewer question.
| Ne_list_est <- lapply(est_units, function(id) { | ||
| neigh <- intersect(Ne_list[[id]], est_units) | ||
| match(neigh, est_units) | ||
| }) |
There was a problem hiding this comment.
@charliewang123 I would opt for option (B) here, could you please implement it?
| N = length(est_units), | ||
| W = W[est_units], | ||
| G = G[est_units], |
There was a problem hiding this comment.
@charliewang123 I would opt for option (B) here, could you please implement it?
| Ne = Ne[est_units], | ||
| Ne_list = Ne_list_est, |
There was a problem hiding this comment.
@charliewang123 I would opt for option (B) here, could you please implement it?
|
Fixing honest estimation from JOSS reviewer’s request. |
Uh oh!
There was an error while loading. Please reload this page.