get_gauss_quadrature_rule_from_marginal

pyapprox.surrogates.get_gauss_quadrature_rule_from_marginal(marginal, max_nsamples, canonical=False)[source]

Return the quadrature rule associated with the marginal.

Parameters:
marginalscipy.stats.dist

The 1D variable

max_nsamplesinteger

The maximum number of samples that can be in the generated quadrature rules

canonicalboolean

True - the loc, and scale parameters of the marginal are ignored. The quadrature rules for all bounded variables will be defined on the interval [-1, 1].

Returns:
quad_rulecallable

Function that returns the quadrature samples and weights with the signature

`quad_rule(nsamples) -> x, w

where x : np.ndarray (nsamples) and w : np.ndarray (nsamples) are the quadrature samples and weights respectivelly. Note nsamples <= max_nsamples