powered by
Generate random realizations from a distribution, constraining these realizations to stay within bounds.
GenerateWithinBounds(dist, par, n = 1, lowerBound = -Inf, higherBound = Inf)
The generated values as a numeric vector.
character, distribution name
numeric vector, parameter vector
integer, number of values to generate
Numeric, lower bound
Numeric, higher bound, should be strictly larger than the lower bound
set.seed(123456) y0=GenerateWithinBounds(dist='GEV',par=c(0,1,-0.2),n=1000) y1=GenerateWithinBounds(dist='GEV',par=c(0,1,-0.2),n=1000,lowerBound=0,higherBound=5) plot(y0);points(y1,col='red')
Run the code above in your browser using DataLab