
Benchmark wrapper: Pilar 1 – DAG-adjusted OLS + parametric bootstrap
Source:R/benchmark_wosis.R
benchmark_fit_p1_causal.RdRestricts OLS to covariates that appear in the supplied DAG as direct parents of the outcome (falling back to the full covariate set when the DAG has no matching variables) and generates a parametric-bootstrap predictive posterior. Intended for the v3.1.0 WoSIS head-to-head; the exported API is stable enough for use on any regional subset that follows the same schema.
Usage
benchmark_fit_p1_causal(
train,
test,
cov_cols,
dag = NULL,
n_boot = 300L,
seed = 1L,
calibrate = TRUE
)Arguments
- train, test
Data frames with a response column
soc, coord columnslon/lat, and the columns listed incov_cols.- cov_cols
Character vector of candidate covariate names.
- dag
A
dagittyDAG object (orNULLto use the full covariate set).- n_boot
Number of bootstrap resamples. Default
300.- seed
Optional RNG seed.
- calibrate
Logical (default
TRUE). WhenTRUE, an estimate of the in-sample residual standard deviation is added as iid Gaussian noise to every posterior sample so the predictive posterior carries BOTH epistemic (bootstrap-spread) AND aleatoric (residual) uncertainty. Set toFALSEto reproduce the v3.1.0 epistemic-only behaviour.