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.2.tar.gz (6.7 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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lartillot_gaussian-0.0.2.tar.gz
  • Upload date:
  • Size: 6.7 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.2.tar.gz
Algorithm Hash digest
SHA256 702f4453760882240826a33ed5812852917ea7a05f473168a3d9323a62d283de
MD5 6bcc233c2c151c67325abf18c3f7b338
BLAKE2b-256 34f389426c5521a1364d6078b0f21f78a16830409aa8e85443e6d7c25521b106

See more details on using hashes here.

Provenance

The following attestation bundles were made for lartillot_gaussian-0.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lartillot_gaussian-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99d1b878e42fe935bd331de13879444c637ba6b819f1287fe0017615736c6caa
MD5 0262cc55f361e119a16cf31be1ee2fac
BLAKE2b-256 34ff0b27cac29423a813e6d8d082f608b4d4a0f444d021a012a2ce91cfbd48df

See more details on using hashes here.

Provenance

The following attestation bundles were made for lartillot_gaussian-0.0.2-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