Tips

How to get feedback from the visitors?
Google Docs Form can be used to get feedback from the site visitors. Learn more here.

Some useful handy software

HOW to?

Recent site activity

411days since
Nepalese New Year 2068

emprand

emprand: Generates random numbers from empirical distribution of data

Version:1.0
05 Jul 2005 (Updated 17 Oct 2007)
File Size: 3 Bytes
File Format: m-file (MATLAB file)

Download from the link here.

 
File Information
Description EMPRAND generates random numbers from empirical distribution of data. This is useful when you do not know the distribution type (i.e. normal or uniform), but you have the data and you want to generate random numbers form that data.  
The idea is to first construct cumulative distribution function (cdf) from the given data. Then generate uniform random number and interpolate from cdf.  
 
USAGE:  
[xr] = emprand(dist) generates single random number from given vector of data values dist.  
[xr] = emprand(dist,m) generates m by m matrix of random numbers.  
[xr] = emprand(dist,m,n) generates m by n matrix of random numbers.  
 
 
Examples:  
% Generate 1000 random normal numbers as data for EMPRAND  
dist = randn(1000,1);  
% Now generate 2000 random numbers from this data  
xr = emprand(dist,2000,1);
MATLAB release MATLAB 7.0.1 (R14SP1)