Selection conditioning in Bayesian inference (source code)

= Selection conditioning in Bayesian inference
{title2=$p(\theta\mid d,S)=p(\theta\mid d)$ when $S$ depends only on conditioned data}

If inclusion depends only on fully observed data $d$, then $p(S\mid d,\theta)=p(S\mid d)$ cancels from <Bayes' theorem> for that individual's parameters. Selection can still matter for unknown population parameters and for missing or unconditioned features. For independent detected observations conditional on their count and population parameters $\Lambda$, each <likelihood> has normalization $\alpha(\Lambda)=\int S(d)p(d\mid\Lambda)\,dd$. A model for the detected count adds its own count <likelihood>. Do not combine a selected-population <prior> with a truncated-data <likelihood> in a way that counts the same selection twice.