helperTrapezoidRule: Helper function to compute the integrals in each interval.
Description
Computes a vector in which each index i is the integral in the interval (0, p[[i]])
of the function described by the densityVec
Uses the trapezoidal rule # https://en.wikipedia.org/wiki/Trapezoidal_rule
to integrate the values in the interval [0,1]. The x corexponding to the
values (the f(x)) are assumed to be equidistantly distributed in the interval,
where the x corresponding to densitiesVec[[1]] is located in 0.0 andthe x
corresponding to densitiesVec[[length(densitiesVec)]] is located in 1.0
Usage
helperTrapezoidRule(densitiesVec)
Value
a vector in which each index i is the integral in the interval
(0, p[[i]]). Consequently, the first element in the vector returned
will be 0, since p[[1]] = 0 does not exist.