API reference¶
Each class has a page with its attributes and methods, and the function sample has a
page. Each module listed here has a page with the rest of its public names, its functions
and, for telescopic.plotting, its three colors, and a table of its classes.
Running¶
Unbiased estimates of expectations under a target, in one call. |
|
Unbiased MCMC with coupled chains: tuning, pilot meeting times and runs. |
Results¶
The output of a run of coupled chains. |
|
An unbiased estimate of \(\pi(h)\) with its Monte Carlo error. |
|
Estimates per parameter and the diagnostics of a run, printable as a table. |
|
The signed measures \(\hat\pi_r\) of \(R\) replicates. |
Targets and initial distributions¶
A log-density \(\log\pi\) known up to a constant, with an optional gradient. |
|
Initial distributions: where each pair of chains starts. |
|
Multivariate normal initial distribution \(\mathcal N(\mu, \Sigma)\). |
|
Uniform initial distribution on the box |
|
The uniform distribution over a set of points, such as the last state of an ensemble. |
Kernels and couplings¶
Markov kernels with their couplings. |
|
A Markov kernel with its coupling. |
|
The states of |
|
Random numbers for a set of chains: row |
|
Random-walk Metropolis-Hastings with a Gaussian proposal. |
|
The Metropolis-adjusted Langevin algorithm. |
|
Hamiltonian Monte Carlo with a random-walk meeting step. |
|
Independence Metropolis-Hastings. |
|
Multivariate Student-\(t\) proposal with location |
|
A Gibbs sampler that draws blocks of coordinates from their full conditionals. |
|
A mixture of kernels. |
|
A Metropolis-Hastings kernel from a proposal, coupled by a coupling of that proposal. |
|
A Metropolis-Hastings proposal for a batch of chains: its draw, its evaluation and its log acceptance ratio. |
|
The Gaussian random-walk proposal \(x' = x + Bz\), \(z \sim \mathcal N(0, I)\). |
|
The Langevin proposal \(x' = x + B(h/2 + z)\), with \(h = B^\top\nabla\log\pi(x)\). |
|
The independence proposal \(x' \sim q\), whatever the current state. |
|
Couplings of pairs of distributions: the primitives that coupled kernels build on. |
|
A coupling of the proposals of two chains under one proposal. |
|
The coupled proposals of |
|
The reflection-maximal coupling of two Gaussian proposals with a shared covariance. |
|
The rejection maximal coupling of two random-walk proposals. |
|
The coupling of two independence proposals that gives both chains one proposal. |
Diagnostics, plots and checks¶
Diagnostics: bounds on the distance to stationarity, tail indices, warnings, gradient checks. |
|
What the gradient check of a sampler built with a gradient compared. |
|
A condition that applies to a result and makes it warn. |
|
Plots of results: meeting times, the TV bound and signed histograms (needs matplotlib). |
|
Helpers for testing kernels and couplings. |
|
The checks of |
Examples¶
Targets with exact answers, for tests, tutorials and benchmarks. |
|
A target with exact answers. |
Building blocks¶
The engine: replicates of coupled chains, run in lockstep lanes with refill. |
|
The outputs of a set of replicates, sorted by replicate index, and their run's settings. |
|
The settings of a run. |
|
The progress of a run, given to its monitor after every iteration. |
|
Estimator weights and the estimators derived from signed measures. |
|
Tuning on pilot runs: adaptive Metropolis chains, and the choice of k. |
|
The second halves of the pilot chains of |
|
What a tuning pilot found. |
Warnings¶
Warning classes of telescopic. |
|
Base class of the warnings that telescopic emits. |
|
A result may be unreliable. |
|
An input is legal but questionable, such as an initial draw with zero density. |