[R] how to generate a random data from a empirical distribition

Peter Dalgaard pdalgd at gmail.com
Tue Jul 27 08:15:59 CEST 2010


David Winsemius wrote:
> On Jul 26, 2010, at 2:36 PM, xin wei wrote:
> 
>> hi, this is more a statistical question than a R question. but I do  
>> want to
>> know how to implement this in R.
>> I have 10,000 data points. Is there any way to generate a empirical
>> probablity distribution from it (the problem is that I do not know  
>> what
>> exactly this distribution follows, normal, beta?).
> 
> ?ecdf

I'd say ?sample, for sampling w/o replacement. The inverse ecdf method
is not likely to be efficient, unless you want a smoothed version of the
distribution function and ecdf() doesn't help you there.

> 
>> My ultimate goal is to
>> generate addition 20,000 data point from this empirical distribution  
>> created
>> from the existing 10,000 data points.
>> thank you all in advance.
>>


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list