I used the Distributions package in order to generate a beta distribution, which works quite nicely:
using Distributions
d = Beta(10,15)
However - is it possible to integrate over an interval of the distribution? I’m looking for a Julia equivalent to R’s integrate function which allows something like:
To clarify, it’s not just faster, it should also be more accurate and more ‘correct’.
The cumulative distribution function is defined to be the integral of the probability density function. The QuadGK code is using numerical quadrature to approximate the CDF. It’s of course better to directly use the known analytical expression for the CDF, which is what the cdf function does.
As a bonus, you don’t need to import an extra package.
BTW, I’m not familiar with R, but I’m pretty sure this is how you should do it in R too.