Description Usage Arguments Details Value References Examples
Evaluate the positions (the “knots”) and the weights for
various Gaussian quadrature rules. The quadrature rules are with
respect to a kernel as described in the details section. Optional
arguments a
, b
, alpha
and beta
are used to
generalize the rules.
1 2 3 |
n |
integer - number of quadrature points. |
rule |
character - a partial match to one of the quadrature
rules, defaulting to |
a |
numeric scalar - an optional shift parameter or interval endpoint |
b |
numeric scalar - an optional scale parameter or interval endpoint |
alpha |
numeric scalar - an optional power |
beta |
numeric scalar - another optional power |
The possible values for the rule
character string and the
corresponding integrals are:
int_a^b f(x) dx
int_a^b f(x) ((b-x)*(x-a))^(-0.5) dx
int_a^b f(x) ((b-x)*(x-a))^alpha dx
int_a^b f(x) (b-x)^alpha*(x-a)^beta
int_a^inf f(x)(x-a)^alpha*exp(-b*(x-a))
int_-inf^inf f(x)|x-a|^alpha*exp(-b*(x-a)^2) dx
int_-inf^inf f(x)|x-(a+b)/2.0|^alpha dx
int_a^inf f(x)(x-a)^alpha*(x+b)^beta
int_a^inf f(x)(x-a)^alpha*(x+b)^beta
A list with components
knots |
The positions at which to evaluate the function to be integrated |
weights |
The numeric weights to be applied. |
The original FORTRAN implementation is from Sylvan Elhay, Jaroslav Kautsky (1987), “Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of Interpolatory Quadrature”, ACM Transactions on Mathematical Software, Volume 13, Number 4, December 1987, pages 399–415.
One of the Eispack routines, an implicit QL algorithms from Roger Martin and James Wilkinson (1968), “The Implicit QL Algorithm”, Numerische Mathematik, Volume 12, Number 5, December 1968, pages 377–383, is used in a modified form.
The C++ implementation by John Burkardt was modified to a C++ class by Douglas Bates.
1 2 | do.call(data.frame, GaussQuad(5L, "Hermite")) ## 5-point "physicist" Gauss-Hermite rule
do.call(data.frame, GaussQuad(5L, "H", b=0.5)) ## 5-point "probabilist" Gauss-Hermite rule
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.