
Generate parameter sets from given ranges, with chosen sampling scheme
parameterSets(par.ranges, samples, method = c("sobol", "innergrid", "grid"))
A named list of minimum and maximum parameter values
Number of samples to generate. For the "grid"
and "innergrid"
method, may be a vector of number of samples for each parameter.
the sampling scheme; see Details
the result is a matrix
, with named columns for each parameter in par.ranges
.
Each row represents one parameter set.
Method "sobol"
generates uniformly distributed Sobol low discrepancy numbers,
using the sobol function in the randtoolbox package.
Method "grid"
generates a grid within the parameter ranges, including its extremes,
with number of points determined by samples
Method "innergrid"
generates a grid within the parameter ranges, with edges
of the grid offset from the extremes. The offset is calculated as half
of the resolution of the grid diff(par.ranges)/samples/2
.
delsa
, which uses this function
# NOT RUN {
X.grid <- parameterSets(par.ranges=list(V1=c(1,1000),V2=c(1,4)),
samples=c(10,10),method="grid")
plot(X.grid)
X.innergrid<-parameterSets(par.ranges=list(V1=c(1,1000),V2=c(1,4)),
samples=c(10,10),method="innergrid")
points(X.innergrid,col="red")
# }
# NOT RUN {
library(randtoolbox)
X.sobol<-parameterSets(par.ranges=list(V1=c(1,1000),V2=c(1,4)),
samples=100,method="sobol")
plot(X.sobol)
# }
Run the code above in your browser using DataLab