newton                 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:

     Newton-Raphson algorithm for minimizing a function 'f' over the
     parameters specified in the input list 'x'. Note, a Newton-Raphson
     search is very efficient in the 'quadratic region' near the
     optimum. In higher dimensions it tends to be rather unstable and
     may behave chaotically. Therefore, a (local or global) minimum
     should be available to begin with. Use the 'optim' or 'dfp'
     functions to search for optima.

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

     newton(x, f, eps=0.1, itmax=10, relax=0, 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' 

     eps: converges when all (logit-transformed) derivatives are
          smaller 'eps' 

   itmax: maximum number of Newton-Raphson iterations 

   relax: numeric. If 0, take full Newton step, otherwise 'relax' step
          incrementally until a better value is found 

    nfcn: number of function calls 

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

     list with the following components: 

   fmin : the function value f at the minimum 

  label : the labels 

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

    low : lower 95% (Wald) confidence bound 

    upp : upper 95% (Wald) confidence bound 

     The confidence bounds assume that the function 'f' is a negative
     log-likelihood

_N_o_t_e:

     'newton' computes the (logit-transformed) Hessian of 'f' (using
     logit.hessian). This function is part of the Bhat exploration tool

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

     E. Georg Luebeck (FHCRC)

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

     'dfp', 'ftrf', 'btrf', 'logit.hessian', 'plkhci'

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

             # generate some Poisson counts on the fly
               dose <- c(rep(0,100),rep(1,100),rep(5,100),rep(10,100))
               data <- cbind(dose,rpois(400,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))

             # calls:
               r <- dfp(x,f=lkh)
               x$est <- r$est
               results <- newton(x,lkh)

