optbound             package:seqdesphII             R Documentation

Find optimal boundaries

Description:

     This function takes as an input argument the results of a forward
     simulation as returned by "read.forwsim" and finds the optimal
     boundaries. It is possible to constrain the optimization to rules
     satisfying type I and II error rates, and to obtain an smoothed
     estimate of the expected utility before optimizing.

Usage:

     optbound(forwsim, errImax, errIImax, util = "u", max = TRUE, avedraws = TRUE, smooth = FALSE, span = 0.75)

Arguments:

 forwsim: List containing forward simulation results as returned by
          "read.forwsim". 

 errImax: Upper bound of type I error probability. Only boundaries
          satisfying it will be included in the optimization 

errIImax: Same as "errImax" but for type II error. 

    util: Name of the element in "forwsim" containing the expected
          utility that is to be optimized. 

     max: If TRUE the goal is to maximize the utility, otherwise it is
          to minimize it.

avedraws: When set to TRUE, multiple optimal solutions will be averaged
          to give a single solution. 

  smooth: Should the utility surface be loess smoothed previous to
          optimization? 

    span: The parameter alpha which controls the degree of smoothing as
          defined in 'loess'. 

Details:

     When performing constrained optimization it is possible that no
     rules satisfy the constraints. If no rules satisfy the type II
     error constraint, the rule with the lowest type II error rate is
     selected amongst those that satisfy the type I error constraint.
     If no rules satisfy the type I  II error constraint either, the
     rule with the lowest type I error is selected.

Value:

     List with the following components:

      b : Values of b0,b1,b2 maximizing the expected utility. 

      u : Estimated expected utility at the optimum. 

     err: Matrix with estimated type I & II error probabilities at the
          optimum in 1st and 2nd columns, respectively.

      dt: Mean number of patients tested with each treatment at the
          optimum. 

     mse: Estimated mean square error in parameter estimation at the
          optimum. 

    span: If smooth set to TRUE, value of the smoothing parameter. 

Author(s):

     David Rossell

References:

     Rossell D, Mueller P, Rosner G. Screening Designs for Drug
     Development.

See Also:

     read.forwsim

Examples:

     dir <- 'C:/R/R-2.2.1/library/forwsim/data'                                                 #read forward simulation output
     sim1 <- read.forwsim(dir)

     opt1 <- optbound(sim1,errImax=1,errIImax=1,util='u',smooth=FALSE)                          #unconstrained optimization
     opt2 <- optbound(sim1,errImax=.05,errIImax=.2,util='u',smooth=FALSE)                       #constrained optimization

     opt3 <- optbound(sim1,errImax=1,errIImax=1,util='u',smooth=TRUE,span=seq(.02,.15,.01))     #optimize smooth surface
     opt4 <- optbound(sim1,errImax=.1,errIImax=.2,util='u',smooth=TRUE,span=seq(.02,.15,.01))   #constrained optimization of smooth surface

     opt5 <- optbound(sim1,errImax=.05,errIImax=.15,util='dt',max=FALSE,smooth=FALSE)           #minimize E(sample size) s.t. type I&II error constraints

