Skip to main content

Evaluation of probability density functions

Project description

Density PDF

Evaluation of univariate density functions defined in the density package.

Install

pip install densitypdf 

Usage

from densitypdf import density_pdf

# Example mixture with one scipy normal and one builtin normal

mixture_spec = {
    "type": "mixture",
    "components": [
        {
            "density": {
                "type": "scipy",
                "name": "norm",
                "params": {"loc": 0, "scale": 1}
            },
            "weight": 0.6
        },
        {
            "density": {
                "type": "builtin",
                "name": "norm",
                "params": {"loc": 2.0, "scale": 1.0}
            },
            "weight": 0.4
        }
    ]
}

val = density_pdf(mixture_spec, x=0.0)

The builtin options are replacements for scipy.stats distributions that are more suitable for single use, when you don't want to incur instantiation overhead in scipy.

Specifying densities or mixtures of the same

One is limited to a finite set of continuous distributions, and mixtures of the same.

See examples of specifying densities.

See the Scipy manifest for a list of densities.

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

densitypdf-0.1.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

densitypdf-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file densitypdf-0.1.1.tar.gz.

File metadata

  • Download URL: densitypdf-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for densitypdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fee03ec98a3e49980e0e79414cb161750bbc01fdff699ca25a39822e798c2aad
MD5 ba9e0b0c9795cacec4f6a50b0ac1d61f
BLAKE2b-256 9d76b159904b00fb26fa9ebb0848845727edd2fdcf4cc32951b0b167dd1aa4f0

See more details on using hashes here.

File details

Details for the file densitypdf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: densitypdf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for densitypdf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4cd70d9b40db107c9cfb261706b00417f98851c135267c958acc8db178ebae5
MD5 21e1ed2ab57662ed67f17781224ab433
BLAKE2b-256 8ac2857b54270ff85904aff44e17ab078022bb78e5dcae6dd312ddd4c55574bc

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