View source: R/Distributions_lib.R
GenerateWithinBounds | R Documentation |
Generate random realizations from a distribution, constraining these realizations to stay within bounds.
GenerateWithinBounds(dist, par, n = 1, lowerBound = -Inf, higherBound = Inf)
dist |
character, distribution name |
par |
numeric vector, parameter vector |
n |
integer, number of values to generate |
lowerBound |
Numeric, lower bound |
higherBound |
Numeric, higher bound, should be strictly larger than the lower bound |
The generated values as a numeric vector.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.