dfp                   package:Bhat                   R Documentation

_F_u_n_c_t_i_o_n _m_i_n_i_m_i_z_a_t_i_o_n _w_i_t_h _b_o_x-_c_o_n_s_t_r_a_i_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     This Davidon-Fletcher-Powell optimization algorithm has been
     `hand-tuned' for minimal setup configuration and for efficency. It
     uses an internal logit-type transformation based on the
     pre-specified box-constraints. Therefore, it usually does not
     require rescaling (see help for the R optim function). 'dfp'
     automatically computes step sizes for each parameter to operate
     with sufficient sensitivity in the functional output. Performance
     is comparable to the BFGS algorithm in the R function 'optim'.
     'dfp' interfaces with 'newton' to ascertain convergence, compute
     the eigenvalues of the Hessian, and  provide 95% confidence
     intervals when the function to be minimized is a negative
     log-likelihood.

     The dfp function minimizes a function 'f' over the parameters
     specified in the input list 'x'. The algorithm is based on
     Fletcher's "Switching Method" (Comp.J. 13,317 (1970))

_U_s_a_g_e:

     dfp(x, f, tol=1e-05, nfcn=0)

_A_r_g_u_m_e_n_t_s:

       x: a list with components 'label' (of mode character), 'est'
          (the parameter vector with the initial guess), 'low' (vector
          with lower bounds), and 'upp' (vector with upper bounds) 

       f: the function that is to be minimized over the parameter 
          vector defined by the list 'x' 

     tol: a tolerance used to indicate when convergence 

    nfcn: number of function calls 

_D_e_t_a_i_l_s:

     the code has been 'transcribed' from Fortran source code into R

_V_a_l_u_e:

     list with the following components: 

   fmin : the function value f at the minimum 

  label : the labels taken from list 'x' 

    est : a vector of the estimates at the minimum. dfp does not
          overwrite 'x' 

 status : 0 indicates convergence, 1 indicates non-convergence 

   nfcn : no. of function calls 

_N_o_t_e:

     This function is part of the Bhat exploration tool

_A_u_t_h_o_r(_s):

     E. Georg Luebeck (FHCRC)

_R_e_f_e_r_e_n_c_e_s:

     Fletcher's Switching Method (Comp.J. 13,317, 1970)

_S_e_e _A_l_s_o:

     optim, 'newton', 'ftrf', 'btrf', 'logit.hessian'

_E_x_a_m_p_l_e_s:

             # generate some Poisson counts on the fly
               dose <- c(rep(0,50),rep(1,50),rep(5,50),rep(10,50))
               data <- cbind(dose,rpois(200,20*(1+dose*.5*(1-dose*0.05))))

             # neg. log-likelihood of Poisson model with 'linear-quadratic' mean: 
               lkh <- function (x) { 
               ds <- data[, 1]
               y  <- data[, 2]
               g <- x[1] * (1 + ds * x[2] * (1 - x[3] * ds)) 
               return(sum(g - y * log(g)))
               }

             # for example define
               x <- list(label=c("a","b","c"),est=c(10.,10.,.01),low=c(0,0,0),upp=c(100,20,.1))

             # call:
               results <- dfp(x,f=lkh)

