Skip to main content

A simple multi-dimensional Gaussian model from Lartillot et al '06, useful for testing Bayesian applications.

Project description

Lartillot Gaussian model

PyPI

The multidimensional Gaussian model from Lartillot et al '06 is useful for testing Bayesian applications.

The model is parameterised by a vector $\theta = (\theta_1, \theta_2, \ldots, \theta_d)$ of dimension $d$. The prior on $\theta$ is a product of independent normals with a null mean and unit variance. The likelihood function is given by $$\mathcal{L}(\theta, v) = {(2\pi v)^{-d/2}} \prod_{i = 1}^d \text{exp}\bigg[\frac{-\theta_i^2}{2v}\bigg],$$ where $v$ is the common variance for all $d$ dimensions.

The joint posterior is given by $d$ products of $\mathcal{N}(0, v/(1+v))$. Finally, the evidence is given by $$ \mathcal{Z} = (2\pi v)^{-d/2} \left(\frac{v}{1 + v} \right)^{d/2}=\left(2\pi(1+v)\right)^{-d/2}\ . $$

This codebase provides a simple implementation of the Lartillot Gaussian model in Python.

pip install lartillot_gaussian
from lartillot_gaussian import LartillotGaussianModel
import numpy as np

model = LartillotGaussianModel(d=10, v=1.0)
theta = np.array([[0]])
print(model.lnz)

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

lartillot_gaussian-0.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lartillot_gaussian-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file lartillot_gaussian-0.0.1.tar.gz.

File metadata

  • Download URL: lartillot_gaussian-0.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lartillot_gaussian-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5f29d5da4803550cfd2828722ea0e717d691f3cccbc581e7bd6ce023a0aa0622
MD5 41c962a79fb5ff833d515326db2ad88d
BLAKE2b-256 93554faef7376cad8eb7478cebf552ad607360bf457ef2f486510e966072acd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lartillot_gaussian-0.0.1.tar.gz:

Publisher: pypi.yml on avivajpeyi/lartillot_gaussian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lartillot_gaussian-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lartillot_gaussian-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4531443e017fb9c2b324979d1bf3ed90eeaef0ac65c545b1f692a874422d780
MD5 f303579211626c8936fa72167a9f19ef
BLAKE2b-256 5d122567a9ece3639b30e14d2b5249275f37b8b0c32fda76cf5171390af3a6d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lartillot_gaussian-0.0.1-py3-none-any.whl:

Publisher: pypi.yml on avivajpeyi/lartillot_gaussian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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