René's URL Explorer Experiment


Title: Sample a posterior with NumPyro’s NUTS - FlatPPL for Python

direct link

Domain: flatppl.org

IPv4 address: 185.199.110.153

color-schemelight dark

Links:

Skip to contenthttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#furo-main-content
FlatPPL for Pythonhttps://flatppl.org/flatppl-python/index.html
FlatPPL for Python https://flatppl.org/flatppl-python/index.html
Installationhttps://flatppl.org/flatppl-python/installation.html
Compile your first functionhttps://flatppl.org/flatppl-python/quickstart.html
Worked tutorialshttps://flatppl.org/flatppl-python/examples/index.html
Sample a posterior with BlackJAX NUTShttps://flatppl.org/flatppl-python/examples/nuts.html
Sample and approximate a posterior with BlackJAXhttps://flatppl.org/flatppl-python/examples/blackjax_nuts_vi.html
Sample a posterior with NumPyro’s NUTShttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html
Fit maximum a posteriori and maximum likelihood points with Optaxhttps://flatppl.org/flatppl-python/examples/optax_fit.html
Diagnose draws with ArviZhttps://flatppl.org/flatppl-python/examples/arviz_diagnostics.html
Sample a posterior with nutpiehttps://flatppl.org/flatppl-python/examples/nutpie_nuts.html
Fit with optimistix BFGS and Levenberg-Marquardthttps://flatppl.org/flatppl-python/examples/optimistix_fit.html
Fit with iminuit and read Hesse and Minos errorshttps://flatppl.org/flatppl-python/examples/iminuit_errors.html
Fit a mixed model with automatic coordinate transformshttps://flatppl.org/flatppl-python/examples/formula.html
From a model file and a dataframe to checked posterior drawshttps://flatppl.org/flatppl-python/examples/regression_workflow.html
A published Belle II likelihood: pyhf to FlatPPL to JAXhttps://flatppl.org/flatppl-python/examples/belle2.html
Fit a three-pion decay with Monte Carlo normalizationhttps://flatppl.org/flatppl-python/examples/amplitude_fit.html
Fit a Gaussian regression with runtime datahttps://flatppl.org/flatppl-python/examples/regression.html
Save a regression, reload it, and fit MAPhttps://flatppl.org/flatppl-python/examples/zip_map.html
Read histograms from ROOT files with uproot and histhttps://flatppl.org/flatppl-python/examples/uproot_hist.html
A discovery fit from ROOT histograms with cabinetryhttps://flatppl.org/flatppl-python/examples/cabinetry_discovery.html
Export a compiled density with jax.exporthttps://flatppl.org/flatppl-python/examples/jax_export.html
Evaluate batched toys on CPU and GPUhttps://flatppl.org/flatppl-python/examples/gpu_toys.html
Query any binding of a modelhttps://flatppl.org/flatppl-python/examples/query.html
Inspect a model’s graphhttps://flatppl.org/flatppl-python/examples/inspection.html
Check a model from the example corpushttps://flatppl.org/flatppl-python/examples/corpus.html
Import a pyhf modelhttps://flatppl.org/flatppl-python/pyhf.html
Coordinate transforms for inferencehttps://flatppl.org/flatppl-python/transforms.html
Incremental query executionhttps://flatppl.org/flatppl-python/incremental.html
Log densities for inference packageshttps://flatppl.org/flatppl-python/inference.html
Modules and contextshttps://flatppl.org/flatppl-python/modules.html
Python values and signatureshttps://flatppl.org/flatppl-python/values.html
Regression formulashttps://flatppl.org/flatppl-python/formula.html
JAX and differentiationhttps://flatppl.org/flatppl-python/jax.html
Numerical integrationhttps://flatppl.org/flatppl-python/integration.html
API referencehttps://flatppl.org/flatppl-python/api.html
Example corpus qualificationhttps://flatppl.org/flatppl-python/corpus.html
Development and documentationhttps://flatppl.org/flatppl-python/development.html
Changeloghttps://flatppl.org/flatppl-python/changelog.html
Back to top https://flatppl.org/flatppl-python/examples/numpyro_nuts.html
Go to the endhttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#sphx-glr-download-examples-numpyro-nuts-py
https://flatppl.org/flatppl-python/examples/numpyro_nuts.html#sample-a-posterior-with-numpyro-s-nuts
flatppl.Module.logdensity()https://flatppl.org/flatppl-python/api.html#flatppl.Module.logdensity
Sample and approximate a posterior with BlackJAXhttps://flatppl.org/flatppl-python/examples/blackjax_nuts_vi.html
lgammahttps://docs.python.org/3/library/math.html#math.lgamma
loghttps://docs.python.org/3/library/math.html#math.log
pihttps://docs.python.org/3/builtins/functions.html#float
NUTShttps://docs.python.org/3/library/abc.html#abc.ABC
flatpplhttps://flatppl.org/flatppl-python/api.html#flatppl.flatppl
flatpplhttps://flatppl.org/flatppl-python/api.html#flatppl.flatppl
https://flatppl.org/flatppl-python/examples/numpyro_nuts.html#the-model-and-its-closed-form-posterior
datahttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
np.arrayhttps://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array
modelhttps://flatppl.org/flatppl-python/api.html#flatppl.Module
flatpplhttps://flatppl.org/flatppl-python/api.html#flatppl.flatppl
datahttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
densityhttps://flatppl.org/flatppl-python/api.html#flatppl.inference.LogDensity
model.logdensityhttps://flatppl.org/flatppl-python/api.html#flatppl.Module.logdensity
a0https://docs.python.org/3/builtins/functions.html#float
b0https://docs.python.org/3/builtins/functions.html#float
k0https://docs.python.org/3/builtins/functions.html#float
m0https://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
data.sizehttps://docs.python.org/3/builtins/functions.html#int
meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
datahttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
knhttps://docs.python.org/3/builtins/functions.html#float
anhttps://docs.python.org/3/builtins/functions.html#float
k0https://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
a0https://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
mnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
k0https://docs.python.org/3/builtins/functions.html#float
m0https://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
knhttps://docs.python.org/3/builtins/functions.html#float
bnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
b0https://docs.python.org/3/builtins/functions.html#float
datahttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
k0https://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
m0https://docs.python.org/3/builtins/functions.html#float
knhttps://docs.python.org/3/builtins/functions.html#float
exacthttps://docs.python.org/3/builtins/stdtypes.html#dict
mnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
bnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
knhttps://docs.python.org/3/builtins/functions.html#float
anhttps://docs.python.org/3/builtins/functions.html#float
anhttps://docs.python.org/3/builtins/functions.html#float
bnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
anhttps://docs.python.org/3/builtins/functions.html#float
bnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
log_evidencehttps://docs.python.org/3/builtins/functions.html#float
lgammahttps://docs.python.org/3/library/math.html#math.lgamma
anhttps://docs.python.org/3/builtins/functions.html#float
lgammahttps://docs.python.org/3/library/math.html#math.lgamma
a0https://docs.python.org/3/builtins/functions.html#float
a0https://docs.python.org/3/builtins/functions.html#float
loghttps://docs.python.org/3/library/math.html#math.log
b0https://docs.python.org/3/builtins/functions.html#float
anhttps://docs.python.org/3/builtins/functions.html#float
loghttps://docs.python.org/3/library/math.html#math.log
bnhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
loghttps://docs.python.org/3/library/math.html#math.log
k0https://docs.python.org/3/builtins/functions.html#float
knhttps://docs.python.org/3/builtins/functions.html#float
nhttps://docs.python.org/3/builtins/functions.html#int
loghttps://docs.python.org/3/library/math.html#math.log
pihttps://docs.python.org/3/builtins/functions.html#float
https://flatppl.org/flatppl-python/examples/numpyro_nuts.html#check-the-normalization
jnp.linspacehttps://docs.jax.dev/en/latest/_autosummary/jax.numpy.linspace.html#jax.numpy.linspace
jnp.linspacehttps://docs.jax.dev/en/latest/_autosummary/jax.numpy.linspace.html#jax.numpy.linspace
jax.vmaphttps://docs.jax.dev/en/latest/_autosummary/jax.vmap.html#jax.vmap
jax.vmaphttps://docs.jax.dev/en/latest/_autosummary/jax.vmap.html#jax.vmap
densityhttps://flatppl.org/flatppl-python/api.html#flatppl.inference.LogDensity
totalhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float32
np.trapezoidhttps://numpy.org/doc/stable/reference/generated/numpy.trapezoid.html#numpy.trapezoid
np.trapezoidhttps://numpy.org/doc/stable/reference/generated/numpy.trapezoid.html#numpy.trapezoid
np.exphttps://numpy.org/doc/stable/reference/generated/numpy.ufunc.html#numpy.ufunc
np.asarrayhttps://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy.asarray
np.asarrayhttps://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy.asarray
np.asarrayhttps://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy.asarray
np.loghttps://numpy.org/doc/stable/reference/generated/numpy.ufunc.html#numpy.ufunc
totalhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float32
log_evidencehttps://docs.python.org/3/builtins/functions.html#float
np.loghttps://numpy.org/doc/stable/reference/generated/numpy.ufunc.html#numpy.ufunc
totalhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float32
log_evidencehttps://docs.python.org/3/builtins/functions.html#float
https://flatppl.org/flatppl-python/examples/numpyro_nuts.html#run-nuts
chainshttps://docs.python.org/3/builtins/functions.html#int
startshttps://docs.python.org/3/builtins/stdtypes.html#dict
jax.vmaphttps://docs.jax.dev/en/latest/_autosummary/jax.vmap.html#jax.vmap
jax.tree.maphttps://docs.jax.dev/en/latest/_autosummary/jax.tree.map.html#jax.tree.map
jax.random.normalhttps://docs.jax.dev/en/latest/_autosummary/jax.random.normal.html#jax.random.normal
jnp.shapehttps://docs.jax.dev/en/latest/_autosummary/jax.numpy.shape.html#jax.numpy.shape
density.inithttps://docs.python.org/3/builtins/stdtypes.html#dict
jax.random.splithttps://docs.jax.dev/en/latest/_autosummary/jax.random.split.html#jax.random.split
jax.random.keyhttps://docs.jax.dev/en/latest/_autosummary/jax.random.key.html#jax.random.key
chainshttps://docs.python.org/3/builtins/functions.html#int
NUTShttps://docs.python.org/3/library/abc.html#abc.ABC
densityhttps://flatppl.org/flatppl-python/api.html#flatppl.inference.LogDensity
chainshttps://docs.python.org/3/builtins/functions.html#int
jax.random.keyhttps://docs.jax.dev/en/latest/_autosummary/jax.random.key.html#jax.random.key
startshttps://docs.python.org/3/builtins/stdtypes.html#dict
freehttps://docs.python.org/3/builtins/stdtypes.html#dict
sampleshttps://docs.python.org/3/builtins/stdtypes.html#dict
jax.vmaphttps://docs.jax.dev/en/latest/_autosummary/jax.vmap.html#jax.vmap
jax.vmaphttps://docs.jax.dev/en/latest/_autosummary/jax.vmap.html#jax.vmap
density.constrainhttps://flatppl.org/flatppl-python/api.html#flatppl.CompiledFunction
freehttps://docs.python.org/3/builtins/stdtypes.html#dict
https://flatppl.org/flatppl-python/examples/numpyro_nuts.html#compare-with-the-closed-form
namehttps://docs.python.org/3/builtins/stdtypes.html#str
exact_meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
exact_variancehttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
exacthttps://docs.python.org/3/builtins/stdtypes.html#dict
chain_drawshttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
np.asarrayhttps://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy.asarray
sampleshttps://docs.python.org/3/builtins/stdtypes.html#dict
namehttps://docs.python.org/3/builtins/stdtypes.html#str
esshttps://docs.python.org/3/builtins/functions.html#float
chain_drawshttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
rhathttps://docs.python.org/3/builtins/functions.html#float
chain_drawshttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
estimatehttps://docs.python.org/3/builtins/functions.html#float
chain_drawshttps://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
errorhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
np.sqrthttps://numpy.org/doc/stable/reference/generated/numpy.ufunc.html#numpy.ufunc
exact_variancehttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
esshttps://docs.python.org/3/builtins/functions.html#float
namehttps://docs.python.org/3/builtins/stdtypes.html#str
estimatehttps://docs.python.org/3/builtins/functions.html#float
exact_meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
errorhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
esshttps://docs.python.org/3/builtins/functions.html#float
rhathttps://docs.python.org/3/builtins/functions.html#float
estimatehttps://docs.python.org/3/builtins/functions.html#float
exact_meanhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
errorhttps://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.float64
rhathttps://docs.python.org/3/builtins/functions.html#float
Download Jupyter notebook: numpyro_nuts.ipynbhttps://flatppl.org/flatppl-python/_downloads/b9660c5b51a81f4c45a7423d0f6dd565/numpyro_nuts.ipynb
Download Python source code: numpyro_nuts.pyhttps://flatppl.org/flatppl-python/_downloads/d9cffbce88cfa9dd57866e0b7c5ad499/numpyro_nuts.py
Download zipped: numpyro_nuts.ziphttps://flatppl.org/flatppl-python/_downloads/d72e2d5f2361aa99ae14d99a6cb9d81f/numpyro_nuts.zip
Gallery generated by Sphinx-Galleryhttps://sphinx-gallery.github.io
Next Fit maximum a posteriori and maximum likelihood points with Optax https://flatppl.org/flatppl-python/examples/optax_fit.html
Previous Sample and approximate a posterior with BlackJAX https://flatppl.org/flatppl-python/examples/blackjax_nuts_vi.html
Sphinxhttps://www.sphinx-doc.org/
@pradyunsghttps://pradyunsg.me
Furohttps://github.com/pradyunsg/furo
Sample a posterior with NumPyro’s NUTShttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html
The model and its closed-form posteriorhttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#the-model-and-its-closed-form-posterior
Check the normalizationhttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#check-the-normalization
Run NUTShttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#run-nuts
Compare with the closed formhttps://flatppl.org/flatppl-python/examples/numpyro_nuts.html#compare-with-the-closed-form

Response headers:
ServerGitHub.com
Content-Typetext/html; charset=utf-8
Via1.1 varnish
Cache-Controlmax-age=600
Last-ModifiedFri, 20 Nov 2026 16:47:24 GMT

Viewport: width=device-width, initial-scale=1


URLs of crawlers that visited me.