Learn R Programming

pomp (version 5.11)

design: Design matrices for pomp calculations

Description

These functions are useful for generating designs for the exploration of parameter space.

profile_design generates a data-frame where each row can be used as the starting point for a profile likelihood calculation.

runif_design generates a design based on random samples from a multivariate uniform distribution.

slice_design generates points along slices through a specified point.

sobol_design generates a Latin hypercube design based on the Sobol' low-discrepancy sequence.

Usage

profile_design(
  ...,
  lower,
  upper,
  nprof,
  type = c("runif", "sobol"),
  stringsAsFactors = getOption("stringsAsFactors", FALSE)
)

runif_design(lower = numeric(0), upper = numeric(0), nseq)

slice_design(center, ...)

sobol_design(lower = numeric(0), upper = numeric(0), nseq)

Value

profile_design returns a data frame with nprof points per profile point.

runif_design returns a data frame with nseq rows and one column for each variable named in lower and upper.

slice_design returns a data frame with one row per point. The ‘slice’ variable indicates which slice the point belongs to.

sobol_design returns a data frame with nseq rows and one column for each variable named in lower and upper.

Arguments

...

In profile_design, additional arguments specify the parameters over which to profile and the values of these parameters. In slice_design, additional numeric vector arguments specify the locations of points along the slices.

lower, upper

named numeric vectors giving the lower and upper bounds of the ranges, respectively.

nprof

The number of points per profile point.

type

the type of design to use. type="runif" uses runif_design. type="sobol" uses sobol_design;

stringsAsFactors

should character vectors be converted to factors?

nseq

Total number of points requested.

center

center is a named numeric vector specifying the point through which the slice(s) is (are) to be taken.

Author

Aaron A. King

Details

The Sobol' sequence generation is performed using codes from the NLopt library by S. Johnson.

References

S. Kucherenko and Y. Sytsko. Application of deterministic low-discrepancy sequences in global optimization. Computational Optimization and Applications 30, 297--318, 2005. tools:::Rd_expr_doi("10.1007/s10589-005-4615-1").

S.G. Johnson. The NLopt nonlinear-optimization package. https://github.com/stevengj/nlopt/.

P. Bratley and B.L. Fox. Algorithm 659 Implementing Sobol's quasirandom sequence generator. ACM Transactions on Mathematical Software 14, 88--100, 1988. tools:::Rd_expr_doi("10.1145/42288.214372").

S. Joe and F.Y. Kuo. Remark on algorithm 659: Implementing Sobol' quasirandom sequence generator. ACM Transactions on Mathematical Software 29, 49--57, 2003. tools:::Rd_expr_doi("10.1145/641876.641879").

Examples

Run this code
## Sobol' low-discrepancy design
plot(sobol_design(lower=c(a=0,b=100),upper=c(b=200,a=1),nseq=100))

## Uniform random design
plot(runif_design(lower=c(a=0,b=100),upper=c(b=200,a=1),100))

## A one-parameter profile design:
x <- profile_design(p=1:10,lower=c(a=0,b=0),upper=c(a=1,b=5),nprof=20)
dim(x)
plot(x)

## A two-parameter profile design:
x <- profile_design(p=1:10,q=3:5,lower=c(a=0,b=0),upper=c(b=5,a=1),nprof=200)
dim(x)
plot(x)

## A two-parameter profile design with random points:
x <- profile_design(p=1:10,q=3:5,lower=c(a=0,b=0),upper=c(b=5,a=1),nprof=200,type="runif")
dim(x)
plot(x)

## A single 11-point slice through the point c(A=3,B=8,C=0) along the B direction.
x <- slice_design(center=c(A=3,B=8,C=0),B=seq(0,10,by=1))
dim(x)
plot(x)

## Two slices through the same point along the A and C directions.
x <- slice_design(c(A=3,B=8,C=0),A=seq(0,5,by=1),C=seq(0,5,length=11))
dim(x)
plot(x)

Run the code above in your browser using DataLab