Learn R Programming

minimaxdesign (version 0.1.5)

minimaxdesign-package: An R package for computing Minimax and Minimax Projection Designs

Description

The 'minimaxdesign' package provides functions for generating minimax designs and minimax projection designs.

Arguments

Details

Package: minimaxdesign
Type: Package
Version: 0.1.4
Date: 2019-05-03
License: GPL (>= 2)

Provides two main functions, minimax() and miniMaxPro(), for computing minimax and minimax projection designs using the minimax clustering algorithm in Mak and Joseph (2018) <DOI:10.1080/10618600.2017.1302881>. Current design region options include the unit hypercube ("hypercube"), the unit simplex ("simplex"), the unit ball ("ball"), as well as user-defined constraints on the unit hypercube ("custom"). Minimax designs can also be computed on user-provided images using the function minimax.map(). Design quality can be assessed using the function mMdist(), which computes the minimax (fill) distance of a design.

References

Mak, S. and Joseph, V. R. (2018). Minimax and minimax projection designs using clustering. Journal of Computational and Graphical Statistics, 27(1):166-178.

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
    #20-point minimax design on the hypercube [0,1]^2
    D <- minimax(N=20,p=2)
    plot(NULL,xlim=c(0,1),ylim=c(0,1),xlab="x1",ylab="x2") #set up plot
    polygon(c(0,0,1,1),c(0,1,1,0),col="gray") #design space
    points(D,xlim=c(0,1),ylim=c(0,1),xlab="x1",ylab="x2",pch=16) #design points
    mM <- mMdist(D)
    mM$dist #minimax (fill) distance
    lines(rbind(mM$far.pt,mM$far.despt),col="red",lty=2,lwd=2) #plot farthest point

    #20-point minimax design on custom design space (inequalities on [0,1]^2)
    ineqs <- function(xx){ #user-defined inequalities
      bool.vec <- rep(TRUE,length(xx))
      bool.vec[1] <- (xx[2]<=2-2*xx[1]) #inequality 1: x2 <= 2 - 2*x1
      bool.vec[2] <- (xx[1]>=xx[2]) #inequality 2: x1 >= x2
      return(all(bool.vec))
    }
    D <- minimax(N=20,p=2,region="custom",const=ineqs)
    plot(NULL,xlim=c(0,1),ylim=c(0,1),xlab="x1",ylab="x2") #set up plot
    polygon(c(0,2/3,1),c(0,2/3,0),col="gray") #design space
    points(D,pch=16) #design points
    mM <- mMdist(D,region="custom",const=ineqs)
    mM$dist #minimax (fill) distance
    lines(rbind(mM$far.pt,mM$far.despt),col="red",lty=2,lwd=2) #plot farthest point
  
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab