Learn R Programming

sensitivity (version 1.28.0)

parameterSets: Generate parameter sets

Description

Generate parameter sets from given ranges, with chosen sampling scheme

Usage

parameterSets(par.ranges, samples, method = c("sobol", "innergrid", "grid"))

Value

the result is a matrix, with named columns for each parameter in par.ranges. Each row represents one parameter set.

Arguments

par.ranges

A named list of minimum and maximum parameter values

samples

Number of samples to generate. For the "grid" and "innergrid" method, may be a vector of number of samples for each parameter.

method

the sampling scheme; see Details

Author

Joseph Guillaume, based on similar function by Felix Andrews

Details

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.

See Also

delsa, which uses this function

Examples

Run this code

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

# \donttest{
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