I have a vector of discrete data and I want to simulate from the empirical distribution associated to this data, I was simulating with the function rlogspline after doing fit<-logspline(vector_of_data) where vector_of_data is data that is suppose to be coming from a continuous distribution, that’s why I used logspline, but with this vector I have the certainty that the values in it are of discrete nature so I can’t use logspline to adjust a “fit” for it.
Basically what I want to do is to adjust a “fit” of the observed data and then use that fit to simulate those values. Do you think this can be done in R?
Thank you very much for your help.
I think
sample(x,...,replace=TRUE)(sampling with replacement) should simulate from the empirical distribution …