Skip to main content

Optimized Gauss-Hermite quadrature

Project description

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

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

optimized_gauss_hermite-0.1.2.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

optimized_gauss_hermite-0.1.2-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file optimized_gauss_hermite-0.1.2.tar.gz.

File metadata

  • Download URL: optimized_gauss_hermite-0.1.2.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for optimized_gauss_hermite-0.1.2.tar.gz
Algorithm Hash digest
SHA256 838a90fb8356fcaf7de386f8ba9571948d69617f2f5ff9d73996992e0fa7deea
MD5 7683146afb40b4d48f54985f89473f96
BLAKE2b-256 90d21e393dc5e731232b8ee131bbc0622af736975d5f761d40095ce6484aa561

See more details on using hashes here.

File details

Details for the file optimized_gauss_hermite-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for optimized_gauss_hermite-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 818072d199e405f11b2392164105978c8624a932216050207d0c4284ab17cbd9
MD5 36c13e66fe2a5a37af80f3df802f8821
BLAKE2b-256 b9ce86964d290f1a1542a327af9147aeada0082389db959420c6c9fc4805dc6e

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