Skip to main content

Spherical statistics in Python

Project description

spherical_stats

Spherical statistics in Python with a focus on accuracy and speed. Unlike many other implementations of spherical distributions, all probability distributions in spherical_stats are fitted exactly using numerical optimization and root-finding techniques and do not rely on approximations. Computationally intensive parts are accelerated using numba.

Installation

pip install spherical_stats

Documentation

Refer to the online documentation for examples and API reference.

Features:

  • Visualization helper functions to quickly generate data to be plotted with plotly/matplotlib/ipyvolume:
    • Sphere creation and evaluation of a function over its surface
    • Spherical histogram
  • Descriptive statistics:
    • Spherical mean and spherical variance
    • Orientation tensor
  • Parametric distributions with scipy.stats like API:
    • Modeling axial data: Watson distribution, Angular central gaussian distribution (ACG)
    • Modeling vector data: Von Mises-Fisher distribution (VMF), Elliptically symmetrical angular gausian distribution (ESAG),

Example usage of the distributions:

from spherical_stats import ESAG
import numpy as np

esag_params = np.array([1,3,5,2,6])

#Instantiate ESAG class with known parameters
esag_known = ESAG(esag_params)

#generate 500 ESAG samples and calculate their PDF vals
samples = esag_known.rvs(500)
pdf_vals = esag.pdf(samples)

#Instantiate ESAG class and fit distribution parameters given samples
esag_unknown = ESAG()
esag_unknown.fit(samples, verbose = True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

spherical_stats-1.3-py3-none-any.whl (17.3 kB view hashes)

Uploaded Python 3

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