Compute diagnostics for PopulationSim grid search results
popsim_search_stats.RdCalculates diagnostic statistics (MAPE, mean, SD, CV, ESS, percent capped, max error, dip statistic, top 1% share, etc.) for each PopulationSim run variant from a grid search result. Use to evaluate and compare weighting scenarios.
Value
data.table. One row per search combo with columns:
search_label— combo label (e.g., 'exp3_cap1000')mape,mean,max,sd,cv,pct_capped,ess,max_error,max_error_var,dip_statistic,top_1pct_share,exp_factor,cap
Details
Loads weights, incidence, and target tables for each search combo.
For each combo:
Computes percent of population carried by top 1% of weights.
Calculates MAPE, mean, SD, CV, max, percent capped, effective sample size (ESS), dip statistic, and max error.
Uses helper functions
calc_weight_mapeandcalc_max_errorfor diagnostics.
Splits search label into expansion factor and cap columns if grid search.
Returns a data.table with one row per combo and diagnostic columns.
Assumes settings include
working_dirand valid PopulationSim output files.Error handling: skips missing or failed runs; returns diagnostics for available combos.
See also
popsim_search, calc_weight_mape, calc_max_error
Other PopulationSim IO:
popsim_make_control_config(),
popsim_make_geoxwalk(),
popsim_make_input_data(),
popsim_make_settings(),
popsim_make_weights(),
popsim_search(),
popsim_settings_updates()