Random Number from Empirical Distribution

Generates random numbers from empirical distribution of data

Sie verfolgen jetzt diese Einreichung

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);

Zitieren als

Durga Lal Shrestha (2026). Random Number from Empirical Distribution (https://de.mathworks.com/matlabcentral/fileexchange/7976-random-number-from-empirical-distribution), MATLAB Central File Exchange. Abgerufen .

Quellenangaben

Inspiriert: Probability Transformation Explorer

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und MATLAB Answers

Allgemeine Informationen

Kompatibilität der MATLAB-Version

  • Kompatibel mit allen Versionen

Plattform-Kompatibilität

  • Windows
  • macOS
  • Linux
Version Veröffentlicht Versionshinweise Action
1.0.0.0

BSD License
Improvement, bug fixes and simplify the code