swap_treatment.optim {minMSE} | R Documentation |
This function calls swap_treatment, but since optim requires fn and gr to have the same parameters, it has an additional one.
swap_treatment.optim(current_treatment, data = NULL, change, prev_index_list = NULL, mse_weights = NULL)
current_treatment |
a treatment vector to be changed. |
data |
the parameter is only needed for optim, it does not play any role. |
change |
number of elements that will be changed in the treatment vector. |
prev_index_list |
index list of the elements that can be changed. The current treatment vector may belong to a previous, unchangeable assignment. |
mse_weights |
the parameter is only needed for optim, it does not play any role. |
Returns a new treatment vector.
Sebastian Schneider sschneider@coll.mpg.de; sebastian@sebastianschneider.eu, Giulia Baldini giulia.baldini@uni-bonn.de
swap_treatment.optim(current_treatment = c(0, 2, 0, 1, 1, 0, 2, 1, 1, 0), change = 2) swap_treatment.optim(current_treatment = c(0, 2, 0, 1, 1, 0, 2, 1, 1, 0), change = 2, prev_index_list = c(1, 2, 3, 4))