# Estimating Error in a Quadrature

• Teg Veece
In summary, the conversation discusses the use of quadrature to estimate the integral of a function. It is mentioned that the accuracy of the quadrature depends on the smoothness of the function, with more complex functions requiring a higher order quadrature for the same level of accuracy. Gaussian Quadrature is mentioned as being exact for degree 2n-1 polynomials, while Clenshaw-Curtis quadrature has an error bounded by O([2N]^{-k}/k) for a k-times differentiable integrand. The conversation also touches on the difficulty of estimating the error for Gaussian Quadrature and suggests increasing the number of nodes for better accuracy. Lastly, the conversation briefly discusses the relationship between the width of a function and the
Teg Veece
Hey,
I'm using a quadrature to estimate the integral of a function.
Intuitively, I know that if the function is a very smooth function, the quadrature will perform well at a low order (few samples).
If however, the function in more complex, I'll need to sample it more frequently for the quadrature to be as accurate.

I'm wondering if there's some equation that expresses this intuition. Something that I can point to and use to explain why more complex functions require a higher order quadrature for the same level of accuracy.

I think the expression should contain some reference to the function's derivative.

Thanks.

Last edited:
Well, Gaussian Quadrature, is (i'm pretty sure) order 2n accurate, meaning that the error is less than

$$\frac{k}{(2n)!}||f^{2n}||_{\infty}$$

where $f$ is the function being interpolated, and $k$ is constant. So, if $f$ is a degree $2n-1$ polynomial, then Gaussian Quadrature is exact.

Does this help?

Last edited:
It does actually. Thanks for that.

Do you know what the error is for a Clenshaw-Curtis quadrature?

Not off hand, but google probably does :) .

I found something on the wikipedia page saying it's error is bounded by
O([2N]^{-k}/k) for a k-times differentiable integrand.

I'm not sure what a k-times differentiable integrand is exactly but, at a guess, is a function like x^2+2x+5 differentiable 3 times and x^9+2 differentiable 10 times so it's a proxy to complexity?The function I'm trying to integrate is exp(-x^2/L) with respect to x between the limits, -1 and 1.
I'm finding though that the smaller I make L, the worse the quadrature gets. I don't think I'm changing the number of times it can be differentiated, so why does the approximation get worse?
My intuition is that by making L smaller, the width of this function (Gaussian) becomes smaller and a higher order quadrature is needed to accurately probe it but I'm not sure if any equation backs this up.

Last edited:
As a side note, one of the drawbacks of Gaussian Quadrature is that it is kind of difficult to get a good grasp on the error. For this reason, people estimate the error by $I_m - I_n$ where $m > n$ and $I_n$ is the estimated integral with $n$ nodes.

Now, I think that the problem is that as L gets bigger and bigger, the meaty portion of the function bunches up around $0$, right? So, if you are using a few nodes, you probably aren't getting much sampling from the real "meaty" part of this function.

I'd keep increasing the number of nodes until $I_{n+2} - I_n$ is within your tolerance. This will give you better than necessary accuracy, which isn't all that bad.

Teg Veece said:
I found something on the wikipedia page saying it's error is bounded by
O([2N]^{-k}/k) for a k-times differentiable integrand.

I'm not sure what a k-times differentiable integrand is exactly but, at a guess, is a function like x^2+2x+5 differentiable 3 times and x^9+2 differentiable 10 times so it's a proxy to complexity?

You are sort of right. But, $x^9 + 2$ is infinitely times differentiable since the trivial ploynomial $p(x) = 0$ is differentiable.

## 1. What is the purpose of estimating error in a quadrature?

The purpose of estimating error in a quadrature is to determine how accurate the calculated value is compared to the true value. This allows for a better understanding of the reliability of the results and helps in making decisions based on the calculated value.

## 2. How is error estimated in a quadrature?

Error in a quadrature is estimated by comparing the calculated value to the true value and determining the difference between them. This difference is then used to calculate the error, which can be expressed as a percentage or absolute value.

## 3. What factors can affect the accuracy of error estimation in a quadrature?

Some factors that can affect the accuracy of error estimation in a quadrature include the number of intervals used, the choice of quadrature method, and the complexity of the function being integrated. Other factors such as rounding errors and machine precision can also contribute to error in the estimation process.

## 4. How can the accuracy of error estimation in a quadrature be improved?

The accuracy of error estimation in a quadrature can be improved by using a higher number of intervals, choosing a more appropriate quadrature method for the given function, and using methods such as adaptive quadrature to adjust for varying function complexity. Additionally, using higher precision numerical methods and avoiding rounding errors can also improve the accuracy of error estimation.

## 5. Can error be completely eliminated in a quadrature?

No, error cannot be completely eliminated in a quadrature. This is because the true value of an integral is often unknown, and therefore it is impossible to determine the exact error. However, by using appropriate methods and techniques, the error can be minimized and controlled to a certain extent.

Replies
21
Views
887
Replies
3
Views
1K
Replies
5
Views
2K
Replies
53
Views
1K
Replies
7
Views
1K
Replies
4
Views
2K
Replies
3
Views
826
Replies
23
Views
3K
Replies
9
Views
2K
Replies
11
Views
927