Skip to main content

Package for Bayesian optimal experimental design

Project description

Bayesian Optimal Experiment Design

PyPI package version number Actions Status License

Use this package to calculate expected information gain for Bayesian optimal experiment design. For an introduction to this topic, see this interactive notebook. To perform a similar calculation with this package, use:

from bed.grid import Grid, GridStack
from bed.design import ExperimentDesigner

designs = Grid(t_obs=np.linspace(0, 5, 51))
features = Grid(y_obs=np.linspace(-1.25, 1.25, 100))
params = Grid(amplitude=1, frequency=np.linspace(0.2, 2.0, 181), offset=0)

sigma_y=0.1
with GridStack(features, designs, params):
    y_mean = params.amplitude * np.sin(params.frequency * (designs.t_obs - params.offset))
    y_diff = features.y_obs - y_mean
    likelihood = np.exp(-0.5 * (y_diff / sigma_y) ** 2)
    features.normalize(likelihood)

designer = ExperimentDesigner(params, features, designs, likelihood)

prior = np.ones(params.shape)
params.normalize(prior);

designer.calculateEIG(prior)

ax.plot(designs.t_obs, designer.EIG)

Browse the examples folder to learn more about using this package.

This package was generated from this template so refer there for details on how to work with VS code, set python testing versions, etc.

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

bayesdesign-0.2.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

bayesdesign-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file bayesdesign-0.2.0.tar.gz.

File metadata

  • Download URL: bayesdesign-0.2.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for bayesdesign-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a51d9494de291c699f2cd2bb2f6d896997a9b14ff96636eedcdb9c66466dc29
MD5 1afbb5ef80e126108ee40838ffbac6d7
BLAKE2b-256 49a95b2f9e097e011cd111538433cde5f8467afd950acebe3f60065f8ccce2a8

See more details on using hashes here.

File details

Details for the file bayesdesign-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bayesdesign-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for bayesdesign-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf7054de869b2044945d96e9a61bf892242d5884a64bfac2698dba889e183790
MD5 51cf42bbffda213e02480acb1adabb4b
BLAKE2b-256 a792a2e35f13de9d0dee94de08a4cd260c57946a50f32e4a6fa750537a8d679c

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