Lab 10 · When Assumptions Break: Robust Analysis & Reporting

Worth: 20 points  |  Due: end of Day 5  |  Files to submit: R scripts, bias_plot.png, your prompts.md, and a 2-page "methods + results" PDF written as if for a journal supplement.
Pre-reading: Lab 9 (you'll extend its simulator), and one of: Royle & Nichols (2003) heterogeneity in occupancy; Rota et al. (2009) closure violations.

Biological motivation

In Lab 9 you proved that unmarked::occu recovers unbiased estimates when its assumptions are met. They are never fully met in the field. This lab is about how to quantify and honestly report the bias introduced when an assumption is broken — and about your responsibility, as the AI-assisted scientist, to defend your model.

The three break-it scenarios

You will pick one of the following to study in depth (or invent your own and get instructor approval):

  1. Closure violation. During the season, the true z[i] is not fixed: animals colonise / leave 5–25% of sites between visits. Does ψ̂ from a single-season model bias high or low?
  2. Heterogeneity in detection. Detection probability is not constant across sites: p ~ Beta(α, β) with mean 0.3 but a heavy tail. What does the model report when you fit constant-p?
  3. Classifier-induced misclassification. Your camera-trap species classifier (e.g., Lab 5) has 90% recall and 95% precision for your focal species. Detections from other species get mis-labeled into the focal class at the corresponding rate. What does the resulting occupancy estimate look like, and how does it depend on the "ambient density" of the other species?

Tasks

Task 1 — project setup (2 pts)

Continue from your Lab 9 project (or start fresh and copy your Lab 9 code in). Update CLAUDE.md to describe which scenario you picked and the null model you'll contrast against.

Task 2 — extend the simulator (6 pts)

Ask Claude Code to modify your Lab-9 simulate_occu() to take a parameter controlling the assumption violation (e.g., turnover_rate, p_dispersion, or classifier_recall + classifier_precision + ambient_prevalence). Carefully write the math of the violation into a comment block at the top of the function — you must understand it, not just have Claude write it.

Task 3 — bias sweep (4 pts)

Run 500 simulations at each of 6 levels of your violation parameter (e.g., turnover 0, 0.05, 0.1, 0.15, 0.2, 0.25). Plot mean estimated ψ vs the true ψ as a function of the violation level (bias_plot.png), with 95% empirical envelopes.

Task 4 — pick the right alternative model (3 pts)

Choose a model that explicitly relaxes the assumption you broke (e.g., dynamic occupancy for closure violations, occupancy with a logit-normal random effect on p for heterogeneity, a measurement-error occupancy model for misclassification). Fit it to one mid-level violation dataset. Does it recover the truth?

Task 5 — write the methods + results (5 pts)

In 2 pages (no more), write the methods and results section as if for a journal supplement. Required sections:

About the writing: the "Recommendation for practitioners" and the interpretive narrative must be in your own voice. You may use Claude to copy-edit your prose. You may not have Claude draft the interpretation.

Rubric

ComponentPoints
Project setup and CLAUDE.md2
Extended simulator with documented math4
Bias sweep with plot4
Alternative model fit and comparison3
2-page methods + results (writing quality, honesty)7
Total20

This lab also doubles as a final project pitch: the same scenario you studied here is a fine starting point for the final project if you want to extend it.