dr. Richard Dwight

Aerodynamics, TU Delft

sparse grid and Sobol index code (Python)

Sparse grid (Smolyak) and Sobol index code written for uncertainty quantification in the course of my research. It is available here under the LGPL in the hope that it will be useful.


The "index-set" construction allows definition of arbetrary sparse-grid fill-patterns by hand. Automatic adaptivity should be added in due course.

Other freely available sparse-grid implementations:



Tar file: smobol.v1.0.tar.gz


Only documentation is the inline comments, see especially sparse.py. For example usage see the functions: unittest_integration(), unittest_interpolation(), and unittest_sobol(). For an example of coupling to an external code see "Example: typical use" at the end of sparse.py. The algorithms follow pretty closely those described in the citations below.

Please email me if you find bugs, extend the code in some way, or just find the code useful.


  1. Sergey Smolyak, Quadrature and Interpolation Formulas for Tensor Products of Certain Classes of Functions, Doklady Akademii Nauk SSSR, Volume 4, 1963, pp. 240-243.
  2. Gerstner and Griebel, Dimension-Adaptive Tensor-Product Quadrature, Computing 71(1), 2003.
  3. Sobol, I.M. Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates. Mathematics and computers in simulation, 55(1-3), 2001, pp. 271-280.
  4. Tang, G., Eldred, M. and Swiler, L.P. Global sensitivity analysis for stochastic collocation expansion. CSRI Summer Proceeding 2009, 100.
  5. Alan Genz, A Package for Testing Multiple Integration Subroutines, in Numerical Integration: Recent Developments, Software and Applications, edited by Patrick Keast, Graeme Fairweather, Reidel, 1987, pp. 337-340, ISBN: 9027725144.


Richard Dwight and Andrea Resmini