Description Usage Arguments Value References Examples
List balancing similar to ipu
, but using the
Newton-Raphson approach to optimization.
Vignette: http://pbsag.github.io/ipfr/
1 2 3 4 |
primary_seed |
In population synthesis or household survey expansion,
this would be the household seed table (each record would represent a
household). It could also be a trip table, where each row represents an
origin-destination pair. Must contain a |
primary_targets |
A |
secondary_seed |
Most commonly, if the primary_seed describes households, the
secondary seed table would describe a unique person with each row. Must
also contain the |
secondary_targets |
Same format as |
target_priority |
This argument controls how quickly each set of
targets is relaxed. In other words: how important it is to match the target
exactly. Defaults to
|
relative_gap |
After each iteration, the weights are compared to the
previous weights and the
the |
max_iterations |
maximimum number of iterations to perform, even if
|
absolute_diff |
Upon completion, the For example, if if a target value was 2, and the expanded weights equaled 1, that's a 100 is only 1. Defaults to 10. |
weight_floor |
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. |
verbose |
Print iteration details and worst marginal stats upon
completion? Default |
max_ratio |
|
min_ratio |
|
a named list
with the primary_seed
with weight, a
histogram of the weight distribution, and two comparison tables to aid in
reporting.
http://www.scag.ca.gov/Documents/PopulationSynthesizerPaper_TRB.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
hh_seed <- data.frame(
pid = c(1, 2, 3, 4),
siz = c(1, 2, 2, 1),
weight = c(1, 1, 1, 1),
geo_cluster = c(1, 1, 2, 2)
)
hh_targets <- list()
hh_targets$siz <- data.frame(
geo_cluster = c(1, 2),
`1` = c(75, 100),
`2` = c(25, 150)
)
result <- ipu_nr(hh_seed, hh_targets, max_iterations = 10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.