New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

distribution-algebra

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distribution-algebra

A python package that implements an easy-to-use interface for random variables, statistical distributions, and their algebra.

  • 0.1.26
  • PyPI
  • Socket score

Maintainers
1

distribution-algebra

A python package that implements an easy-to-use interface for random variables, statistical distributions, and their algebra.

This Python package is brought to you by Vaibhav Karve.

distribution-algebra recognizes Normal, Lognormal, Beta and Poisson distributions. The package implements an interface to easily construct user-defined Univariate distributions as well Vectorized distributions.

Additional features include:

  • A plot function for probability density/mass function plotting.
  • A draw function for drawing random samples of specified size from a given distribution.
  • Addition and multiplication operations defined directly on distributions:
    • For example, the sum of two Normal (Poisson) distributions is Normal (Poisson).
    • The product of two Lognormal distributions is Lognormal.
    • The sum of two arbitrary univariate distributions is expressed as a Vectorized distribution.

Example plot

This package is written in Python v3.10, and is publicly available under the GNU-GPL-v3.0 license.

Installation and usage

To get started on using this package,

  1. Install Python 3.10 or higher.

  2. python3.10 -m pip install distribution-algebra

  3. Use it in a python script (or interactive REPL)

    from distribution_algebra import Beta, Lognormal, Normal, Poisson
    
    x: Normal = Normal(mean=1.0, var=9.0)
    y: Normal = Normal(mean=1.0, var=16.0)
    
    assert x + y == Normal(mean=2.0, var=25.0)
    

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc