Skip to main content

Generalized Lambda Distribution models for powerful and fast emulation

Project description

PyGLAM

PyGLAM is a high-performance Python framework for emulating probability distributions using Generalized Lambda Distributions (GLD).

Installation

pip install pyglam

Quick Start

Here is a simple example of how to fit a distribution and generate new data using the FKML parameterization:

import numpy as np
from pyglam import GlamFKML

# 1. Generate sample data (e.g., Normal Distribution)
x = np.random.normal(0, 1, 50000)
x_vals = np.linspace(-4, 4, 500)

# 2. Fit the Lambdas (The "Emulator" way)
g = GlamFKML()
sol = g.fit_lambdas(x, method="least_squares") # You can also use method="root"
print(f"Estimated Lambdas: {sol.x}")

# 3. Use the emulated model
# Initialize with the optimized lambdas
emulator = GlamFKML(*sol.x)

rvs_glam = emulator.rvs(size=1000)          # Random variates
pdf_glam = emulator.pdf(x_vals)             # Probability Density Function
cdf_glam = emulator.cdf(x_vals)             # Cumulative Distribution Function
ppf_glam = emulator.ppf(np.linspace(0.01, 0.99, 100)) # Percent Point Function

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

pyglam-0.2.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

pyglam-0.2.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pyglam-0.2.2.tar.gz.

File metadata

  • Download URL: pyglam-0.2.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.17.0-22-generic

File hashes

Hashes for pyglam-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7d97e8c731248e50871959e5bcef036ca801d27ad16c1cff69c69bff5106f4ea
MD5 07820366a5cb7137f5336702c1f9702d
BLAKE2b-256 50713c5afb4c8a19c1ab649740b3c43b5df570805764a5e8d7853f7deeb272fc

See more details on using hashes here.

File details

Details for the file pyglam-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pyglam-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.17.0-22-generic

File hashes

Hashes for pyglam-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 546004dec93ac0a989010258df183fa108040069447b5192002db67bd93c008a
MD5 722846dc1a53d14fd3d5470f37b652f6
BLAKE2b-256 e39296e1ce3d901d1ddb599a8279be7cfa54a051f24dc19d36a5b078e772ba53

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