# Wildlife detection and occupied-site simulation

## Purpose

This teaching model demonstrates one narrow point: when a species is present but is not detected on every survey, repeated visits can increase the number of occupied sites at which it is detected without changing the true number of occupied sites. It is not a reconstruction of the archival wildlife proposal and contains no measurements from a real species or survey.

## Model

Assign 100 sites, of which 40 are occupied throughout the example. Let `p` be the same detection probability on each independent visit. The probability of at least one detection at an occupied site after `k` visits is `1 − (1 − p)^k`. Therefore:

`expected detections = total sites × occupied fraction × [1 − (1 − p)^k]`.

The default is `p = 0.5`. The expected number detected is 20 after one visit, 35 after three, and 38.75 after five, while true occupancy stays at 40 sites. Fractional values are expectations, not partial animals or observed sites.

## Assumptions and limits

The short survey period is treated as closed: no site changes from occupied to unoccupied or vice versa. Visits have equal, independent detection probability; there are no false-positive identifications; and occupied sites share the same `p`. Real studies may need to model season, observer, weather, effort, habitat, false positives, spatial dependence and changing occupancy. The example estimates occupancy, not animal abundance. It does not estimate whether a conservation intervention caused a population change.

## Reproduce

`wildlife-detection-model.js` implements the formula and drives the interactive chart. `wildlife-detection.csv` contains the deterministic expected values for the stated default inputs. Run `node tests/wildlife-detection.test.cjs` from the Site checkout to verify boundary cases and the one-, three- and five-visit values.

## References and real monitoring context

- MacKenzie, D. I. et al. (2002), “Estimating site occupancy rates when detection probabilities are less than one,” *Ecology* 83(8), 2248–2255. [DOI](https://doi.org/10.1890/0012-9658(2002)083%5B2248%3AESORWD%5D2.0.CO%3B2); [USGS ARMI bibliographic record](https://armi.usgs.gov/content/?contentid=190). The paper explains why a non-detection does not prove absence when detection probability is below one and develops a repeated-survey occupancy model.
- U.S. Geological Survey, [2026 North American Breeding Bird Survey data release (1966–2025)](https://www.usgs.gov/data/2026-release-north-american-breeding-bird-survey-dataset-1966-2025). It documents a real long-running standardized bird-monitoring protocol: 50 stops per route, three minutes per stop, birds seen or heard, and annual route surveys. These observations support large-scale monitoring; they are not a complete census of every bird at each stop.

Better monitoring can help conservation teams decide where follow-up is needed and assess trends. A claim that a protection action caused a recovery needs its own outcome measures, time series and justified comparison.
