sample_qtls {stochLAB}R Documentation

Generate random draws based on empirical c.d.f.

Description

Generate random draws from a set of quantiles, based on the empirical cumulative density function

Usage

sample_qtls(n, probs, qtls)

Arguments

n

integer, the number of draws to generate

probs

numeric vector, the probabilities

qtls

numeric vector, the quantiles for the probabilities specified in probs

Details

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)

Value

a numeric vector, with random draws of the approximated distribution underpinning the provided quantiles

Examples

 sample_qtls(10,c(0.1,0.2,0.3),qtls=c(0.05,0.1,0.95))

[Package stochLAB version 1.1.2 Index]