% Generated by roxygen2: do not edit by hand
% Please edit documentation in
%   R/binary_match_followed_by_rerandomization_search.R
\name{initBinaryMatchFollowedByRerandomizationDesignSearchObject}
\alias{initBinaryMatchFollowedByRerandomizationDesignSearchObject}
\title{Begin a Search for Binary Matching Followed by Rerandomization}
\usage{
initBinaryMatchFollowedByRerandomizationDesignSearchObject(
  X,
  compute_dist_matrix = NULL,
  verbose = TRUE,
  ...
)
}
\arguments{
\item{X}{The design matrix with $n$ rows (one for each subject) and $p$ columns 
(one for each measurement on the subject). This is the design matrix you wish 
to search for a more optimal design.}

\item{compute_dist_matrix}{The function that computes the distance matrix between every two observations in \code{X}, 
its only argument. The default is \code{NULL} signifying euclidean squared distance optimized in C++.}

\item{verbose}{Should the algorithm emit progress output? Default is \code{TRUE}.}

\item{...}{Arguments passed to \code{initGreedyExperimentalDesignObject}. It is recommended to set
\code{max_designs} otherwise it will default to 10,000.}
}
\value{
An object of type \code{binary_experimental_design} which can be further operated upon.
}
\description{
This method creates an object of type binary_then_rerandomization_experimental_design and will find optimal matched pairs which
are then rerandomized in order to further minimize a balance metric. You can then
use the function \code{resultsBinaryMatchThenRerandomizationSearch} to obtain the randomized allocation vectors. For one column
in X, the matching just sorts the values to find the pairs trivially.
}
\examples{
\dontrun{
set.seed(1)
X = matrix(rnorm(16), nrow = 8)
obj = initBinaryMatchFollowedByRerandomizationDesignSearchObject(
  X,
  max_designs = 4,
  num_cores = 1,
  objective = "abs_sum_diff",
  obj_val_cutoff_to_include = Inf,
  start = TRUE,
  wait = TRUE,
  verbose = FALSE
)
obj
}
}
\author{
Adam Kapelner
}
