presolve_EMD: Solve the earthmover's distance problem

Description Usage Arguments Value

View source: R/presolve_EMD.R

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

1
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.


natstrat documentation built on Oct. 15, 2021, 5:12 p.m.