Skip to main content

Point process model for Bayesian inference with persistence diagrams.

Project description

bayes_tda

This module contains classes to implement a marked Poisson process model for Bayesian inference with persistence diagrams. The model relies on mixed Gaussian assumptions. For a full description of the model, please refer to https://arxiv.org/abs/1901.02034.

Installation

Use the package manager pip to install bayes_tda.

pip install bayes_tda

Classes

Class name Description Methods
WedgeGaussian Gaussian density restricted to upper half of $\mathbb{R}^2$. eval
Prior Mixed Gaussian prior intensity. eval
Posterior Mixed Gaussian posterior intensity. eval

Usage

from bayes_tda import *
import matplotlib.pyplot as plt
import numpy as np

x = [0,0] # a point in birth-persistence coordinates
wg = WedgeGaussian(mu = [0,0], sigma = 1) # Gaussian densities restricted to the upper half plane
d = wg.eval(x) # evaluates the Gaussian density at x

means = np.array([[0,0],[6,6]])
ss = [1,1]
ws = [1,1]

pri  = Prior(weights = ws,mus = means, sigmas = ss)
d_pri = pri.eval(x)

b = np.linspace(0,10,50)
p = np.linspace(0,10,50)

B,P = np.meshgrid(b,p)

Z = list()
for ind in range(len(P)):
    l = list()
    for i in range(len(P)):
        l.append(pri.eval([B[ind][i],P[ind][i]]))
    Z.append(l)
        
plt.style.use('seaborn-white')
plt.contourf(B,P,Z, 20, cmap = 'twilight')
plt.colorbar()
plt.show()

noise = Prior(weights = [0], mus = [[30,30]], sigmas = [10])
post = Posterior(prior = pri,clutter = noise,Dy = [[1,5],[5,1]], sy = 1)
peval = post.eval(x)

Z = list()
for ind in range(len(P)):
    l = list()
    for i in range(len(P)):
        l.append(post.eval([B[ind][i],P[ind][i]]))
    Z.append(l)
        
plt.style.use('seaborn-white')
plt.contourf(B,P,Z, 20, cmap = 'twilight')
plt.colorbar()
plt.show()

Reporting Bugs

Report any bugs by opening an issue at https://github.com/coballejr/bayes_tda/.

License

MIT

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

bayes_tda-0.3.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file bayes_tda-0.3.tar.gz.

File metadata

  • Download URL: bayes_tda-0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.4.2 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for bayes_tda-0.3.tar.gz
Algorithm Hash digest
SHA256 769b88d4603704e341c4018fc3f6b354d0db606a138f8120feb4d252e66a75f6
MD5 ccf7a44c8a0b8ad9f6c96c228b25a164
BLAKE2b-256 bac4208c6de76c7ae084149391f47d6a6163a8cdb5e19d20998c7867d644c817

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