Gauss-Kronrod Integration Rules

Gauss realized that a higher order could be achieved with the same number of function evaluations if the integration points and their weights in the weighted sum could be chosen arbitrarily. Gauss-Kronrod methods use two integration formulas of different orders where the integration points of the lower order formula are also integration points for the higher order formula. This gives a way to estimate the integration error without doing any extra function evaluations.

Another advantage of these methods is that they don't evaluate the function at the limits of the interval. This is of particular importance for integrands that contain singularities. The fixed point methods brake down for these integrands.

Fixed order Gauss-Kronrod integrators

These methods serve primarily as basic integration rules for the adaptive algorithm. Classes are provided for 15, 21, 31, 41, 51, and 61 point Gauss-Kronrod rules. The following table summarizes the classes in this category and the corresponding order.

Class

Description

GaussKronrod15PointRule

7-point Gauss with 15-point Kronrod rule.

GaussKronrod21PointRule

10-point Gauss with 21-point Kronrod rule.

GaussKronrod31PointRule

15-point Gauss with 31-point Kronrod rule.

GaussKronrod41PointRule

20-point Gauss with 41-point Kronrod rule.

GaussKronrod51PointRule

25-point Gauss with 51-point Kronrod rule.

GaussKronrod61PointRule

30-point Gauss with 61-point Kronrod rule.

To create a Gauss-Kronrod integrator of a different order, derive your class from IntegrationRule, and implement the Evaluate(Func<Double, Double>, Interval) method.

Non-adaptive Gauss-Kronrod integrator.

The NonAdaptiveGaussKronrodIntegrator class implements an algorithm that uses a cascade of Gauss-Kronrod points. Starting out with a 10-point Gauss integration formula, successive formulas for 21, 43, and 87 points provide increasing orders of the approximation with estimates of the error. Once the estimated error is within the required tolerance, no further function evaluations are needed. This is an excellent choice for smooth functions over an extended interval.

C#
NonAdaptiveGaussKronrodIntegrator nagk = new NonAdaptiveGaussKronrodIntegrator();
nagk.RelativeTolerance = 1e-5;
nagk.ConvergenceCriterion = ConvergenceCriterion.WithinRelativeTolerance;
double result = nagk.Integrate(Math.Sin, 0, 2);
Console.WriteLine("sin(x) on [0,2]");
Console.WriteLine("Romberg integrator:");
Console.WriteLine("  Value: {0}", result);
Console.WriteLine("  Status: {0}", nagk.Status);
Console.WriteLine("  Estimated error: {0}", nagk.EstimatedError);
Console.WriteLine("  Iterations: {0}", nagk.IterationsNeeded);
Console.WriteLine("  Function evaluations: {0}", nagk.EvaluationsNeeded);
Console.WriteLine("  Order: {0}", nagk.Order);

The Gauss-Kronrod integration rules and the non-adaptive integrator have the property that the order of the method equals the number of function evaluations.

References

R. Piessens, E. de Doncker, C. Uberhuber and D. Kahaner, QUADPACK, A Subroutine Package for Automatic Integration , Springer-Verlag, New York, 1983.