Comments (2)
The problem is that if you integrate from 1e-8
to 1e8
then the initial points are too spread out and it only samples your function PDF where it is close to zero. This kind of thing is an intrinsic limitation of any numerical quadrature scheme.
Simplest solution: if you want to integrate over the whole real line, integrate over the whole real line.
julia> quadgk(x -> pdf(pc, x), -Inf, Inf, rtol=1e-8)
(0.999999999999772, 8.248719550886085e-9)
quadgk
knows how to do something reasonable here (via a coordinate transformation).
Alternatives include increasing the integration order (the order
parameter) to increase the number of sample points, breaking the integral into more subintervals to increase the number of initial sample points, or doing a coordinate transform on your interval to emphasize the origin (this is what the -Inf..Inf
algorithm does internally).
from quadgk.jl.
Thanks a lot for the clarification.
Tomas
from quadgk.jl.
Related Issues (20)
- confusion in kronrod() documentation? HOT 1
- Documentation suggestion
- TagBot trigger issue HOT 13
- AD compatibility HOT 1
- How to cite QuadGK HOT 1
- Compatibility with CUDA.jl HOT 2
- Possible regression using quadgk function and Unitful limits HOT 9
- unitful infinite bounds
- order=1 seems børked HOT 1
- contour integration HOT 1
- documentation build is failing HOT 4
- Autodiff of `quadgk` HOT 2
- Can not catch a JuliaError caused by function blowing up to infinity HOT 2
- misleading error estimate for non-convergent integral (maxevals=10^7 reached) HOT 5
- QuadGK evaluates function at upper bound HOT 4
- No cachedrule for DynamicQuantities types HOT 4
- Regression with [email protected] HOT 6
- spurious underflow in kronrod for large n HOT 1
- infinite limits with units and segbuf broken
- quadgk with identical lower and upper bound is broken HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quadgk.jl.