Skip to main content

Optimized Gauss-Hermite Quadrature

Compute $\mathbb{E}[f(X)]$ for $X \sim \mathcal{N}(\mu, \Sigma)$ using optimized Gauss-Hermite quadrature with adaptive parameter optimization.

Installation

pip install optimized-gauss-hermite

Quick start

import numpy as np
from ogh_integration import ogh_integrate

Ex = np.array([0.5, -0.1])
Cx = np.array([[2.0, 0.5],
               [0.5, 1.0]])

def f(x):
    return np.prod(np.cos(x)**2, axis=0)

result = ogh_integrate(f, Ex, Cx)
print(f"E[f(X)] = {result:.12f}")

Packages

Package Purpose
gauss_hermite_quadrature Nodes, weights, full-grid and sparse-grid Gauss-Hermite rules
optimal_gauss_hermite Optimized quadrature with adaptive parameter optimization
ogh_integration High-level ogh_integrate() convenience wrapper

API

ogh_integrate(
    func,                     # f(X) where X is (dimX, N) → (N,)
    Ex,                       # mean (dimX,)
    Cx,                       # covariance (dimX, dimX), SPD
    *,                        # all remaining args must be named
    sample_num=None,          # sample points for optimization (auto if None)
    num_quad=3,               # quadrature level
    sparse_mode=False,        # True for sparse-grid (high-dim problems)
    poly_type="hermite",      # polynomial basis
    sample_type="latin",      # sampling: "latin", "sobol", "haltonset", "MC"
    algorithm_type="levenberg-marquardt",  # "hybrid" or "hessian"
    decomp_type="Chol",       # "Chol" or "LDL"
)

Requirements

  • Python ≥ 3.9
  • numpy ≥ 1.20
  • scipy ≥ 1.7

Citation

@inproceedings{ogh2024,
  title     = {Optimized Gauss-Hermite Quadrature: A Refined Approach},
  booktitle = {2024 IEEE Conference on Decision and Control (CDC)},
  author    = {Meng, Haozhan},
  year      = {2024},
  publisher = {IEEE},
  url       = {https://ieeexplore.ieee.org/abstract/document/10590620}
}

License

MIT

Metadata

Release files for optimized-gauss-hermite 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optimized-gauss-hermite 0.1.2
File Size Uploaded Provenance Actions
optimized_gauss_hermite-0.1.2.tar.gz 24.8 kB Without provenance Details for optimized_gauss_hermite-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optimized-gauss-hermite 0.1.2
File Interpreter ABI Platform Actions
optimized_gauss_hermite-0.1.2-py3-none-any.whl Python 3 none any Details for optimized_gauss_hermite-0.1.2-py3-none-any.whl

Total release size: 58.2 kB

Release files / optimized_gauss_hermite-0.1.2.tar.gz

Download URL optimized_gauss_hermite-0.1.2.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
838a90fb8356fcaf7de386f8ba9571948d69617f2f5ff9d73996992e0fa7deea
BLAKE2b-256 checksum
How to use checksums
90d21e393dc5e731232b8ee131bbc0622af736975d5f761d40095ce6484aa561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / optimized_gauss_hermite-0.1.2-py3-none-any.whl

Download URL optimized_gauss_hermite-0.1.2-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
818072d199e405f11b2392164105978c8624a932216050207d0c4284ab17cbd9
BLAKE2b-256 checksum
How to use checksums
b9ce86964d290f1a1542a327af9147aeada0082389db959420c6c9fc4805dc6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for optimized-gauss-hermite 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page