-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gauss–Kronrod points and weights? #120
Comments
I thought Gauss–Kronrod tends to be low order eg |
h-adaptive quadrature schemes based on Gauss–Kronrod typically use relatively low order. That's why I don't worry about the O(n²) in QuadGK. For p-adaptive quadrature, one does often go to high order, but in this case you typically want a whole family of nested rules, not just two — either Gauss–Patterson or Clenshaw–Curtis, typically. In principle, however, you can use Gauss–Kronrod at any order if you want an error estimate from your quadrature scheme. Since "FastGaussQuadrature.jl" was originally about O(n) schemes, I mainly wanted to warn you about the O(n²) complexity of Laurie's algorithm in case you felt like it breaks with the spirit of this package. |
Sounds more like a research question (not just a coding one) in the first instance. There would have to be a very strong application for this to be pursued though... |
The application is anyone who wants to use a quadrature rule and have an error estimate - it’s not that mysterious. Personally, I find Gaussian quadrature rules hard to use in practice because they lack error estimates. But if you only want O(n) algorithms in this package, I agree that’s a research problem for Kronrod. |
I don't think we are not religious about I see your point about error estimate. |
It would be nice to have support for generating Gauss–Kronrod points and weights for the weight functions in FastGaussQuadrature, at least when they exist, in order to have an error estimate from the resulting quadrature rule.
JuliaMath/QuadGK.jl/pull/83 should land shortly, and provides an implementation of an O(n²) algorithm by Laurie (1997) that takes as input a
SymTridiagonal
Jacobi matrixJ
for a weight function, and outputs a "Kronrod–Jacobi matrix"QuadGK.kronrodjacobi(J, n)
whose eigenvalues/eigenvectors yield an order-n Gauss–Kronrod rule (exactly as an ordinary Jacobi matrix yields the Gaussian quadrature rule). Arbitrary-precision arithmetic is supported.The two caveats are (a) it's O(n²), and (b) a Gauss–Kronrod rule may not always exist for all weight functions. (If real points and weights don't exist,
kronrodjacobi
throws an error.) Even if the Kronrod rule exists, it may include quadrature points that lie outside of the original interval.The text was updated successfully, but these errors were encountered: