View source: R/select_optimal_m_prop.R
| select_optimal_m_prop | R Documentation |
PTE_bootstrap_inference's m_pow_of_n argument sets each bootstrap
replicate's resample size to m = \lfloor n^{\gamma} \rfloor, which is
required to be less than n (i.e. \gamma < 1) for the bootstrap to be
consistent for our non-smooth policy-value estimands (see PTE_bootstrap_inference).
There is, however, no single population-optimal \gamma – asymptotic theory only
requires m \to \infty and m / n \to 0. Politis, Romano &
Wolf (Subsampling, 1999, Ch. 9) and Bickel & Sakov (2008) address this by proposing the
"minimum volatility" (MV) method: compute the bootstrap answer (here, the width of the
rate-corrected percentile confidence interval for one of the three PTE estimands) over a grid of
candidate \gamma (equivalently m) values, then, for each grid point, measure
how much that answer varies over a small centered neighborhood of adjacent grid points ("volatility").
The chosen \gamma is the one whose neighborhood is most stable, i.e. the region of the
grid where the bootstrap's answer has stopped changing in response to further tuning of m –
this is the practical, data-driven proxy for "m large enough for the CLT-type approximation
underlying the bootstrap to have kicked in, but still small enough relative to n for
consistency."
select_optimal_m_prop(
X,
y,
regression_type = "continuous",
incidence_metric = "odds_ratio",
personalized_model_build_function = NULL,
censored = NULL,
predict_function = NULL,
difference_function = NULL,
cleanup_mod_function = NULL,
y_higher_is_better = TRUE,
pct_leave_out = 0.1,
m_pow_of_n_grid = seq(0.5, 1, by = 0.05),
estimand = "average",
B = 250,
alpha = 0.05,
volatility_window = 3,
num_cores = NULL
)
X |
A |
y |
An |
regression_type |
See |
incidence_metric |
See |
personalized_model_build_function |
See |
censored |
See |
predict_function |
See |
difference_function |
See |
cleanup_mod_function |
See |
y_higher_is_better |
See |
pct_leave_out |
See |
m_pow_of_n_grid |
The grid of candidate |
estimand |
Which of the three PTE estimands' confidence interval width to stabilize: |
B |
The number of bootstrap samples to take at each grid point. Since the total cost is
|
alpha |
Confidence interval size (1 - alpha) used to measure CI width at each grid point. Defaults to 0.05. |
volatility_window |
The number of adjacent grid points (must be odd and |
num_cores |
See |
This function is a calibration step: it runs PTE_bootstrap_inference once per grid
point (so its total cost is roughly length(m_pow_of_n_grid) times that of a single call) and
does not itself return final inference – rerun PTE_bootstrap_inference at the
selected m_pow_of_n_optimal (with a larger B) to get the confidence intervals and
p-values you report.
A list with class "PTE_optimal_m_selection" containing:
m_pow_of_n_optimalThe selected \gamma, ready to pass as
m_pow_of_n to PTE_bootstrap_inference.
m_optimalThe corresponding resample size, round(n^m_pow_of_n_optimal).
grid_tableA data.frame with one row per grid point: m_pow_of_n,
m, the point estimate and ci_width for estimand, and its
volatility (NA for the non-eligible boundary points described above).
estimand, B, alpha, volatility_windowEchoed back for reference.
Adam Kapelner
Politis, D.N., Romano, J.P. and Wolf, M. (1999) Subsampling. Springer Series in Statistics.
Bickel, P.J. and Sakov, A. (2008) On the choice of m in the m out of n bootstrap and confidence bounds for extrema. Statistica Sinica, 18(3), 967-985.
## Not run:
library(PTE)
data(continuous_example)
X = continuous_example$X
y = continuous_example$y
m_selection = select_optimal_m_prop(
X, y,
regression_type = "continuous",
m_pow_of_n_grid = seq(0.5, 1, by = 0.05),
B = 250,
num_cores = 1
)
m_selection$grid_table
m_selection$m_pow_of_n_optimal
#now rerun inference at the selected m_pow_of_n with a production-sized B
pte_results = PTE_bootstrap_inference(
X, y,
regression_type = "continuous",
m_pow_of_n = m_selection$m_pow_of_n_optimal,
B = 3000
)
pte_results
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.