Skip to main content

Bayesian Optimal Experiment Design

PyPI package GitHub Release 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)

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

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

To run the examples in google colab, select GitHub and enter https://github.com/dkirkby/bayesdesign.

Installation

Install the latest released version from pypi using:

pip install bayesdesign

The only required dependency is numpy. The optional plot module also requires matplotlib.

The changes with each version are documented here.

Upgrade

To upgrade your pip-installed package to the latest released version use:

pip install bayesdesign --upgrade

Contributing

If you have feedback or would like to contribute to this package, please see our contributor's guide.

Metadata

Release files for bayesdesign 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bayesdesign 0.7.1
File Size Uploaded Provenance
bayesdesign-0.7.1.tar.gz 1.2 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bayesdesign 0.7.1
File Interpreter ABI Platform
bayesdesign-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / bayesdesign-0.7.1.tar.gz

Download URL bayesdesign-0.7.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
04d3e1737a65a9e4bd35cfe895d85f8a70f51b9bff547d2400522362047a6ae9
BLAKE2b-256 checksum
How to use checksums
2d35efde0a6a8ac8f803f9e29683891c9320363eef278d0646c182bb504ea133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Release files / bayesdesign-0.7.1-py3-none-any.whl

Download URL bayesdesign-0.7.1-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6f6a2d661782d6e69447752d433e5460eecf5c17dc70ef852435f0671efe869
BLAKE2b-256 checksum
How to use checksums
04326b2b24bada51666a24f9ce8e9486121213cd8c06a7eaed8433ce37de0aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Security for bayesdesign 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bayesdesign-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page