# computes the logarithm of the integral of exp(logfun) from 0 to Inf under the following assumptions:
integral_peak(logfun, xx = seq(-100, 10, 2), xcutoff = 2,
ycutoff = 40, ymaxthreshold = 1e-12)the logarithm of the function to integrate
the initial set of points on which to evaluate the function
when the maximum has been found among the xx, this parameter sets the width of the interval to find the maximum in
set the threshold below which (on a log scale) the function is deemed negligible, i.e. that it does not contribute to the integral)
sets the deviation allowed in finding the maximum among the xx
the result of the integration
Haegeman, B. & R.S. Etienne (2017). A general sampling formula for community structure data. Methods in Ecology & Evolution. In press.