pDistr {soundgen} | R Documentation |
Proportion of total
Description
Internal soundgen function.
Usage
pDistr(x, quantiles)
Arguments
x |
numeric vector of non-negative real numbers |
quantiles |
quantiles of the cumulative distribution |
Details
Calculates the values in the input distribution that contain particular proportions of the sum of all values in the input distribution.
Examples
x = rnorm(100)
x = x - min(x) # must be non-negative
hist(x)
v = soundgen:::pDistr(x, quantiles = c(.5, .8, .9))
sum(x[x > v['0.5']]) / sum(x)
sum(x[x > v['0.9']]) / sum(x)
[Package soundgen version 2.7.3 Index]