mercredi 2 septembre 2015

Extract random sample from a unknown distribution (no generate stochastic random deviates)

I have a vector of data. I need build the density / distribution function and from that, extract a random sample, i.e. I need obtain the result that give us a function similar to rnorm(), rpois(), rbinom(), etc, but with a distribution built from a vector of data. All in R. Thank you so much.

It has nothing to do with generate stochastic random deviates.

I know the function sample() do something similar, but not exactly. If I use sample() I obtain only elements from my original data, as a discrete distribution and I need as a continuous distribution.




Aucun commentaire:

Enregistrer un commentaire