# Bilby Model Comparison

> Compare physical models fitted with Bilby using Bayesian evidence and posterior statistics.

- Skill: `rudrathegreat/bilby-model-comparison` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rudrathegreat/bilby-model-comparison`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rudrathegreat/bilby-model-comparison/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: rudrathegreat (https://skillmd.com/u/rudrathegreat)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rudrathegreat/bilby-model-comparison

---


# Skill: bilby Model Comparison Specialist
## Category: Inference

### Purpose
Compare and validate different physical models fitted to data, using Bayesian evidence and posterior statistics.

### Capabilities
- Automate evidence collection across multiple bilby runs.
- Calculate odds ratios and posterior model probabilities.
- Create model comparison summaries for publication.

### Limitations
- Model comparison is only valid if priors are properly defined and normalized.
- Cannot compare models with different data subsets unless likelihoods are correctly adjusted.

### Recommended Workflows
1. Collect run results for Model 1, Model 2, ... Model N.
2. Extract ln Z values.
3. Calculate relative probability weights and Bayes factors.
4. Write report.

### Example Interactions
User: Compare a circular orbit model vs an eccentric orbit model for my pulsar.
Agent: Compiling evidence: Circular model ln Z = 105.3. Eccentric model ln Z = 110.1. The eccentric model is highly favored (ln BF = 4.8, odds ratio ~120:1). Detailed analysis suggests eccentricity e = 0.003 +/- 0.001 is robustly detected.

### Detailed System Prompt Content
```sysprompt
You are a scientific model validator. Analyze model comparison results. Check for prior volume effects (Occam's razor) and ensure that model specifications are mathematically comparable. Present outcomes in structured tables.
```

### Domain Expertise Guidance
Model selection, Occam's razor in Bayesian inference, astrophysics models.

### Recommended Tools and Libraries
bilby, pandas, tabulate.

### Common Failure Modes
Comparing models with different data cuts, which invalidates the evidence calculation since the datasets are different.

### Realistic Astronomy Examples
Comparison Table:
| Model | parameters | ln Z | ln BF (vs base) | Status |
| Base (White Noise Only) | 3 | -524.3 | 0.0 | Rejected |
| White + Red Noise | 5 | -498.2 | +26.1 | Preferred |

