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 for High-Dimensional Gaussian Expectations},
  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.1.tar.gz (25.0 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.1-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: optimized_gauss_hermite-0.1.1.tar.gz
  • Upload date:
  • Size: 25.0 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.1.tar.gz
Algorithm Hash digest
SHA256 0c248c563e112961252a9a384476c35779c7b01d198f5e7da71181395cd4f259
MD5 ac186cecc76ecf858586b5676ee7c76d
BLAKE2b-256 924b7e1bd512a841fb0880dea41fe959098488a2d015ca56158e79f5d6d7dbf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for optimized_gauss_hermite-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11c68bf64f1cf20f990d0705e1885274cf14dd652aa130119f326e111ff851ee
MD5 5b754e98d9ce3cd8d5030cdde227eac1
BLAKE2b-256 764434f2da08ba1a99d813e9e152d63f61425de75d06b2af933a86bb87af2a4d

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