Skip to main content

Sampling with Blackjax on Aesara

Project description

AeX

The following currently works:

import aesara.tensor as at
import aex

srng = at.random.RandomStream(0)

sigma_rv = srng.normal(1.)
mu_rv = srng.normal(0, 1)
Y_rv = srng.normal(mu_rv, sigma_rv)

sampler = aex.prior_sampler(Y_rv, mu_rv)
sampler(rng_key, 1_000_000)

Coming

Sampling from the posterior distribution using Blackjax's NUTS sampler:

sampler = aex.mcmc({Y_rv: 1.}, aex.NUTS())
samples, info = sampler(rng_key, 1000, 1000)

Sampling from the posterior by arbitrarily combining Blackjax step functions:

sampler = aex.mcmc({Y_rv: 1.}, {[mu_rv, sigma_rv]: aex.NUTS(), Y_rv: aex.RMH()})
samples, info = sampler(rng_key, 1000)

Sampling from the posterior predictive distribution:

sampler = aex.posterior_predictive(trace, Y_rv)
sampler(rng_key, 1000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aex-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

aex-0.0.2-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file aex-0.0.2.tar.gz.

File metadata

  • Download URL: aex-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for aex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 31ce5e846ce9391371dbf9dc7708156bcc1d65bea3919c45531b9e7846765baa
MD5 a211921e7560dfe9423e8bffbf4b401c
BLAKE2b-256 fadf89c67c922bdc9ca919794f78964b325c022a7fccdebc614a1749bd13682f

See more details on using hashes here.

File details

Details for the file aex-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aex-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for aex-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b790cb4c58bcf0cf5cbd2b5583245e7d230bdb9197493be6adc34b59acc64a8
MD5 61521a12b34e391ee54533577e5ac432
BLAKE2b-256 0cf2e0784f141aaea1a252ddd8721de60a8eb99e2f66926fb021280f37dbaf23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page