Description Usage Arguments Value Author(s) Examples
View source: R/optimize_rerand_exact.R
Finds the optimal rerandomization threshold based on a user-defined quantile and a function that generates the non-linear component of the response
1 2 3 4 5 6 7 8 9 10 11 | optimal_rerandomization_exact(
W_base_object,
estimator = "linear",
q = 0.95,
skip_search_length = 1,
smoothing_degree = 1,
smoothing_span = 0.1,
z_sim_fun,
N_z = 1000,
dot_every_x_iters = 100
)
|
W_base_object |
An object that contains the assignments to begin with sorted by |
estimator |
"linear" for the covariate-adjusted linear regression estimator (default). |
q |
The tail criterion's quantile of MSE over z's. The default is 95%. |
skip_search_length |
In the exhaustive search, how many designs are skipped? Default is 1 for
full exhaustive search through all assignments provided for in |
smoothing_degree |
The smoothing degree passed to |
smoothing_span |
The smoothing span passed to |
z_sim_fun |
This function returns vectors of numeric values of size |
N_z |
The number of times to simulate z's within each strategy. |
dot_every_x_iters |
Print out a dot every this many iterations. The default is 100. Set to
|
A list containing the optimal design threshold, strategy, and other information.
Adam Kapelner
1 2 3 4 5 6 7 8 9 10 11 12 13 |
n = 100
p = 10
X = matrix(rnorm(n * p), nrow = n, ncol = p)
X = apply(X, 2, function(xj){(xj - mean(xj)) / sd(xj)})
S = 25000
W_base_obj = generate_W_base_and_sort(X, max_designs = S)
design = optimal_rerandomization_exact(W_base_obj,
z_sim_fun = function(){rnorm(n)},
skip_search_length = 10)
design
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.