Skip to main content

Poisson Hyperplane Model Package

Project description

hyperpopy: Poisson Hyperplane Model Package

PyPI version Python 3.8+ License: MIT

A Python package for working with Poisson hyperplane models, providing tools for analytical calculations, generation, visualization, and Monte Carlo simulation of Poisson hyperplane processes.

Features

  • Analytical Calculations: Compute conditional probability functions for color in the Poisson model
  • Generation & Visualization: Generate and plot realizations of the Poisson model
  • Monte Carlo Simulation: Estimate connectivity distributions and color probabilities
  • Probability Landscapes: Visualize conditional probability functions

Installation

pip install --upgrade hyperpopy

Quick Start

import hyperpopy
import numpy as np

# Calculate the arrival rate of a Poisson hyperplane process
rate_2d = hyperpopy.rate(2, 1.0)  # 2D, radius 1.0
print(f"2D Poisson rate: {rate_2d}")

# Generate a 2D visualization of the Poisson hyperplane process
fig = hyperpopy.plot_hyperplanes_color_2d(
    radius=10,
    grid_resolution=100,
    colorcutoffs=np.array([0.5]),
    cmap_list=hyperpopy.frozen_lake_colors
)

# Calculate color distribution for given points
points = np.array([[0, 0], [1, 0], [0, 1]])
colors = (0, 1, 0)  # Known colors for first two points
color_dist = (0.5, 0.5)  # Equal probability for each color

prob_dist = hyperpopy.color_distribution(points, colors, color_dist)
print(f"Color probabilities: {prob_dist}")

Key Functions

Analytical Utilities

  • rate(dimension, radius): Calculate Poisson hyperplane arrival rate
  • color_distribution(points, colors, color_dist): Compute conditional color probabilities
  • hitrate_1d/2d/3d(points): Calculate hit rates for convex hulls
  • slash_rates(points): Return rates of hyperplane partitions

Generation & Visualization

  • sample_from_ball(dimension, num_points): Sample points from unit ball
  • plot_hyperplanes_color_2d(): Generate 2D Poisson hyperplane visualizations
  • hyperplane_partition(points, gridpoints): Partition space using hyperplanes

Monte Carlo Simulation

  • monte_carlo_hyperplane_partitions(): Estimate connectivity distributions
  • plot_mc_colors_with_errorbars(): Plot convergence with error bars
  • probability_landscape(): Visualize probability landscapes in 2D/3D

Examples

See the examples/ directory for comprehensive examples including:

  • Figure generation from research papers
  • Monte Carlo convergence analysis
  • Probability landscape visualization
  • Chord length statistics

Citation

If you use this package in your research, please cite:

@software{hyperpopy2024,
  title={HyperPopy: Poisson Hyperplane Model Package},
  author={Alec Shelley},
  year={2024},
  url={https://github.com/AlecShelley/hyperpopy}
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links

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

hyperpopy-0.1.3.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

hyperpopy-0.1.3-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file hyperpopy-0.1.3.tar.gz.

File metadata

  • Download URL: hyperpopy-0.1.3.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for hyperpopy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1c17cef31e6c5c902396b44865881b20c08063b23aa9d4bfaf92659376383e72
MD5 7f4b02a23dfd1a04436498b49543056c
BLAKE2b-256 3b4d6fd21cad39c75d6546b7d36b782dd928f7609568007dee8ab11d258b68e5

See more details on using hashes here.

File details

Details for the file hyperpopy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: hyperpopy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for hyperpopy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2cc0600a2dbbcc49879bac200c071f8ca2ebf4ec6e634197aef896ce074d1f
MD5 c32cf69285b3fd2a4938938594b9f812
BLAKE2b-256 4a87e0ac37530c6a3f97bf5ef60a1cced16f3e107b89c9cbc69c1a59760130bb

See more details on using hashes here.

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