remp | R Documentation |
Generates random numbers from a distribution created with empirical data
remp(n,obs=NULL)
n |
number of random observations to generate. |
obs |
vector of empirical observations. |
An empirical probability distribution is formed from empirical data with each observation having 1/T probabililty of selection, where T is the number of data points. The cumulative distribution function (cdf) is then created so that cumulative probability of the smallest observation = 0 and the largest observation = 1. Random values are generated by applying the probability integral transform to the empirical cdf using uniformly distributed random variable (U) on the interval[0,1]. If U corresponds directly to the cdf probability of a particular empirical observation, then the actual observation is selected. If U falls between cdf probabilities of empirical observations, then an observation is obtained by linear interpolation.
random observation(s)
Jon Brodziak of the National Marine Fisheries Service, Honolulu, HI described this technique in his AGEPRO program.
Gary A. Nelson, Massachusetts Division of Marine Fisheries gary.nelson@mass.gov
# Striped bass recruits per spawning stock biomass ratios
# for 2001-2011 from 2013 assessment
ratios<-c(799.22,794.78,969.81,1038.80,1101.45,1117.46,1126.16,
1647.51,1882.30,1966.13,2189.25)
# Select new recruits per SSB ratio for projection
remp(1,ratios)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.