Skip to main content

Module likelihood

Module likelihood 

Source
Expand description

Likelihoods as programs

The inference layer’s conditioning side. A GenomeLikelihood is an observation program p(data | genome) — not merely a scalar score. It may contain:

  • observe statements over real data (per-datum log-likelihoods land in the trace’s log_likelihood accumulator with genuine structure),
  • latent nuisance parameters (sample sites — e.g. an unknown observation noise σ — which are then jointly inferred with the genome; their posteriors are read straight off the particle traces),
  • factor statements for soft constraints or black-box scores.

The black-box case — an arbitrary fitness f entering as factor(β·f) — is the FactorFitness adapter. That target is a generalized-Bayes / Gibbs posterior (Bissiri, Holmes & Walker 2016): perfectly legitimate, but now one mode among many rather than the only one.

Structs§

FactorFitness
The black-box adapter: a scalar Fitness entering as factor(β·f(g)).
MemoizedFitness
A memoizing wrapper around an expensive Fitness.
NoLikelihood
Convenience: a ()-like likelihood that conditions on nothing (the posterior is the prior). Useful for testing priors through the inference drivers.

Traits§

GenomeLikelihood
An observation program p(data | genome), possibly tempered.

Functions§

tempered_observe
A tempered observation: at β = 1 this is exactly observe(addr, dist, value) (the log-density lands in log_likelihood); at other β it is factor(β · log p(value)) (landing in log_factors). Both accumulators are tempered together by fugue’s SMC, so the two forms are interchangeable under tempering — the β = 1 form is preferred because it keeps the likelihood/prior decomposition visible in the trace.