# Tsnpe Sir Fallback Sampler

> Run deterministic sampling-importance-resampling diagnostics for narrow TSNPE proposals.

- Skill: `yzj623/tsnpe-sir-fallback-sampler` (Agent Skill)
- Install (CLI): `npx get-skill add yzj623/tsnpe-sir-fallback-sampler`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yzj623/tsnpe-sir-fallback-sampler/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yzj623 (https://skillmd.com/u/yzj623)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/yzj623/tsnpe-sir-fallback-sampler

---


# Tsnpe Sir Fallback Sampler

Use this skill when rejection sampling from the truncated proposal is too inefficient and a fixed candidate budget is needed. It computes normalized importance weights from log prior minus log posterior proposal values, seeded systematic resampling indices, and effective sample size. Do not treat SIR as valid if all weights collapse or ESS is not recorded.

Inputs: JSON with `candidate_samples`, `log_prior`, `log_proposal`, `num_samples`, and optional `seed`. Outputs: JSON with selected samples, normalized weights, ESS, and mechanism checks. Validation: run `python tests/test_sir.py`.


