Skip to contents

Groups PUMAs by balancing sample rates using spectral clustering and information theory. Use to create PUMA groups with similar sample rates and adjacency for weighting.

Usage

entropy_zone_groups(
  seed,
  targets,
  puma_sf,
  k_groups = "auto",
  balanced = TRUE,
  rng_seed = 4321
)

Arguments

seed

data.table. Seed data table.

targets

data.table. Targets data table.

puma_sf

sf object. PUMA geometries.

k_groups

integer or 'auto'. Number of groups to create.

balanced

logical(1). Balance samples in each group (default TRUE).

rng_seed

integer(1). Random seed for reproducibility.

Value

data.table with columns:

  • puma_id — PUMA identifier

  • zone_group — assigned group Rows: one per PUMA. Keys: (puma_id).

Details

  • Constructs graph of PUMAs with adjacency and KL divergence weights.

  • Calculates entropy and information gain for grouping.

  • Uses spectral clustering on Laplacian matrix to partition graph.

  • Returns data.table with PUMA IDs and group assignments.

  • Returns a copy; does not modify by reference.

Settings

None.

See also

scripts/weighting/zone_groups.R

Other clustering utilities: get_kmeans_opt_k(), kmeans_zone_groups(), spectral_zone_groups()

Examples

## Not run:
entropy_zone_groups(seed, targets, puma_sf, k_groups = 3)
#> Error: object 'puma_sf' not found