sample_qtls | R Documentation |
Generate random draws from a set of quantiles, based on the empirical cumulative density function
sample_qtls(n, probs, qtls)
n |
integer, the number of draws to generate |
probs |
numeric vector, the probabilities |
qtls |
numeric vector, the quantiles for the probabilities
specified in |
Based on the Inverse Transform Sampling technique, by sampling random probabilities from a uniform distribution and interpolate (cubic) the count samples from the percentiles provided by the user (taken as the empirical cumulative density function)
a numeric vector, with random draws of the approximated distribution underpinning the provided quantiles
sample_qtls(10,c(0.1,0.2,0.3),qtls=c(0.05,0.1,0.95))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.