# Sampling from empirical distribution

I have a vector of y (min is > 0, max could be 1), for which, i have no idea what distribution is. But based on the data we have, vector y, we can get the empirical cumulative probability distribution, i.e., ecdf(y).

My question is how to sample new data based on this empirical distribution?

• Sample with replacement giving the same probability to each point. – Zen Dec 17 '18 at 10:31
• Bootstrap sampling. – user2974951 Dec 17 '18 at 10:32

Sampling from the empirical distribution function ecdf is the same as resampling (with replacement, equal probabilities) from the sample $$y$$. $$\text{ecdf}(y)$$ is just a recoding of the sample, the sample points in $$y$$ correspond to the jump points (discontinuity points) in the ecdf. This is just bootstrapping.