presolve_EMD {natstrat}R Documentation

Solve the earthmover's distance problem

Description

Determine how many controls should be chosen from each stratum to minimize the distance between the strata of the chosen controls and those that were desired. Used within generate_qs().

Usage

presolve_EMD(S, desired_qs, max_s, strata_dist_flat)

Arguments

S

the total number of strata.

desired_qs

a named vector containing the number of controls desired in each stratum with names matching the strata names.

max_s

a vector containing the maximum number of controls that should be selected in each stratum. The order of the strata should match that of desired_qs.

strata_dist_flat

a flattened distance matrix between the strata.

Value

A named vector with names identical to those of desired_qs and elements containing the number of controls to select from the given stratum.


[Package natstrat version 2.0.0 Index]