Re-weight a Seed Table to Marginal Controls
ipf(
seed,
targets,
relative_gap = 0.01,
absolute_gap = 1,
max_iterations = 50,
min_weight = 1e-04,
verbose = FALSE
)
A data frame
including a weight
field and necessary
columns for matching to marginal targets.
A named list
of data frames. Each name in the list
defines a marginal dimension and must match a column from the seed table.
The data frame associated with each name must start with an identical
column named cluster
. Each row in the target table defines a new
cluster (these could be TAZs, tracts, districts, etc.), and every target
table must have the same number of rows/clusters. The other column names
define the marginal categories that targets are provided for.
target for convergence. Maximum percent change to allow
any seed weight to move by while considering the process converged. By
default, if no weights change by more than 1
The process is said to be converged if either relative_gap
or
absolute_gap
parameters have been met.
target for convergence. Maximum absolute change to allow
any seed weight to move by while considering the process converged. By
default, if no weights change by more than 10, the process has converged.
The process is said to be converged if either relative_gap
or
absolute_gap
parameters have been met.
maximum number of iterations to perform, even if convergence is not reached.
Minimum weight to allow in any cell to prevent zero weights. Set to .0001 by default. Should be arbitrarily small compared to your seed table weights.
Print details on the maximum expansion factor with each
iteration? Default FALSE
.
the seed data frame
with a column of weights appended for each
row in the target data.frames