{
  "handle": "LocalSpatialStateDivergence",
  "ref": "LocalSpatialStateDivergence#2b5e",
  "stub": "2b5e",
  "semaId": "sema:LocalSpatialStateDivergence#mh:SHA-256:2b5e93e20a335e9aff9fa14d6d8fc75b3872c759c2e7d331da7af4449062bae3",
  "layer": "Mind",
  "category": "Inference",
  "gloss": "Classify a crowd's collective state from positions alone, by how far its local neighbourhoods depart from random",
  "mechanism": "A model-free (zeroth-order) measure that needs only positions per frame. At random query points, drawing circles kept inside the observation area, find the k nearest agents, split the circle into four quadrants and record the local state omega = (a1, a2, a3, a4), the count per quadrant. The state space has C(k+3, 3) states. Sample many queries per frame (60) over the whole recording to get the empirical distribution P(omega). Build Q(omega) the same way from a {{null_model}} that places the same number of agents uniformly at random in the same bounds at every frame. The {{jensen_shannon_divergence}} D_JS(P, Q) then measures spatial organisation beyond chance. In fire ant colonies with k = 6, roaming scored 0.035 +/- 0.025, trailing 0.113 +/- 0.037 and aggression 0.229 +/- 0.052 (block permutation p = 0.004). k sets the spatial scale: too small is noise-dominated, too large samples too sparsely. Pushing a synthetic crowd with an attractive or repulsive force F = min(F_max, gamma / r_ij) gives a U-shaped D_JS(gamma), confirming sensitivity to order in either direction.",
  "invariants": [
    "Uses positions only, with no interaction model",
    "Empirical and null distributions share the same k, query geometry and agent counts per frame",
    "Higher D_JS means more spatial structure than uniform placement"
  ],
  "failureModes": [
    "Sign ambiguity: clustering and over-dispersion both raise D_JS against a uniform reference",
    "Choosing k by maximum regime separation on the same data, a form of {{instrument_tuning}}; report the full sweep",
    "Treats neighbourhoods as independent samples and ignores persistence and trajectories, so it can rank order but not explain mechanism"
  ],
  "ring": 2,
  "tier": 2,
  "aliases": {
    "instrument_tuning": "MotivatedInstrumentTuning",
    "null_model": "NullModelBaseline",
    "jensen_shannon_divergence": "JensenShannonDivergence"
  },
  "buildsOn": [
    {
      "handle": "MotivatedInstrumentTuning",
      "type": "references",
      "alias": "instrument_tuning",
      "url": "/knowledge-graph/MotivatedInstrumentTuning/",
      "json": "/knowledge-graph/MotivatedInstrumentTuning.json"
    },
    {
      "handle": "NullModelBaseline",
      "type": "references",
      "alias": "null_model",
      "url": "/knowledge-graph/NullModelBaseline/",
      "json": "/knowledge-graph/NullModelBaseline.json"
    },
    {
      "handle": "JensenShannonDivergence",
      "type": "composes_with",
      "alias": "jensen_shannon_divergence",
      "url": "/knowledge-graph/JensenShannonDivergence/",
      "json": "/knowledge-graph/JensenShannonDivergence.json"
    }
  ],
  "usedBy": [
    {
      "handle": "RepresentationDependentOrder",
      "type": "references",
      "alias": "spatial_divergence",
      "url": "/knowledge-graph/RepresentationDependentOrder/",
      "json": "/knowledge-graph/RepresentationDependentOrder.json"
    },
    {
      "handle": "CollectiveInformationArchitecture",
      "type": "composes_with",
      "alias": "spatial_divergence",
      "url": "/knowledge-graph/CollectiveInformationArchitecture/",
      "json": "/knowledge-graph/CollectiveInformationArchitecture.json"
    }
  ],
  "sources": {
    "research": [],
    "works": [
      {
        "kind": "thesis",
        "label": "Kevin Do, PhD thesis on ant collective behaviour (NCSU, 2026)",
        "note": "Ch. 3.1.1, Eqs. 3.1-3.4, Figs. 3.1-3.3; Ch. 4.1, Fig. 4.1; Ch. 5.2",
        "url": ""
      }
    ],
    "homePage": false
  },
  "url": "/knowledge-graph/LocalSpatialStateDivergence/",
  "graphUrl": "/knowledge-graph#LocalSpatialStateDivergence",
  "directory": "/knowledge-graph/patterns.json"
}
