Stroud rules

class SpectralToolbox.Stroud.Stroud(weight, params)[source]

Bases: object

Initialization of the Stroud integral points generator.

This method generates an instance of the Stroud class, to be used in order to generate N-dimensional cubature rules with respect to the selected weight. Available weight types can be selected using their string name or by predefined attributes

  • ‘Gaussian’ or Stroud.GAUSSIAN
  • ‘Beta’ or Stroud.BETA
  • ‘Gamma’ or Stroud.GAMMA

Additional parameters are required for some weights.

Weight Parameters
Gaussian None
Beta (alpha,beta)
Gamma alpha

See [Str57] and [Xiu08] for details.

Parameters:
  • weight (Stroud.AVAIL_WEIGHTS) – type of the multidimensional weight for the formula.
  • params (object) – The parameters needed by the selected weight
params = []
stroud2(n)[source]

stroud2(): Generates n+1 equally weighted points for the degree 2 Stroud formula.

Syntax:
x = stroud2(n)
Input:
  • n = (int) number of dimensions of the integration formula.
Output:
  • x = (float, nd-array (n+1,n)) n+1 quadrature nodes.
  • w0 = (float) weight (equal for all the points)
stroud3(n)[source]

stroud2(): Generates 2n equally weighted points for the degree 3 Stroud formula.

Syntax:
x = stroud3(n)
Input:
  • n = (int) number of dimensions of the integration formula.
Output:
  • x = (float, nd-array (n+1,n)) n+1 quadrature nodes.
  • w0 = (float) weight (equal for all the points)
Description:
The method is available only for distributions in symmetric regions, thus only for integrals with Gaussian weights and symmetric Beta weights (alpha=beta) in R^n
weight = []