starr                package:accuracy                R Documentation

_s_t_a_f_f _g_l_o_b_a_l _o_p_t_i_m_u_m _t_e_s_t

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

     Implements the Starr test for identification of the global optimum
     of a likelihood surface.

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

      starr(betas, tol=.0001, dmethod="euclidean")

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

   betas: Vector of parameter values

     tol: Tolerance distance between two parameter vectors to consider
          as "unique" optimum

 dmethod: method used to compute distance between two parameter vectors

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

     _starr_ computes the probability that a local optimum, which may
     or may not be the global optimum, of a likelihood function has not
     been observed.  The probability is generated by counting the
     observed number of ``basins of attraction'' - starting values that
     lead to an local optimum.

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

     _starr_ is a class "double" with value equal to the probability
     than a local optimum is unobserved.

_N_o_t_e:

     _starr_ is given a vector of _betas_ parameter values identifying
     local optima resultant of a search algorithm, such as _mle_ or
     _nls_.  The starting values used to generate _betas_ can be a
     grid, or for larger n-dimenional parameter spaces, may be randomly
     chosen.  The parameter values identifying a local optimum are
     passed to _starr_ for each set of starting values that lead to
     that local optimum.

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

     Micah Altman Micah_Altman@harvard.edu <URL:
     http://www.hmdc.harvard.edu/micah_altman/> , Michael McDonald

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

     Altman, M., J. Gill and M. P. McDonald.  2003.  _Numerical Issues
     in Statistical Computing for the Social Scientist_.  John Wiley &
     Sons. <URL: http://www.hmdc.harvard.edu/numerical_issues/>

     Finch, S. J., Mendell, N. R., Thode, H. C., Jr. 1989.
     ``Probabilistic Measures of Adequacy of a Numerical Search for a
     Global Maximum.'' _Journal of the American Statistical
     Association_ *84*, 1020-3.

     Starr, N. 1979. ``Linear Estimation of the Probability of
     Discovering a New Species.'' _Annals of Statistics_ *7*, 644-52.

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

             x=rbind(c(1,1,1), c(1,2,1), c(1,1.1,1), c(1,2,1), c(3,4,5));
             starr(rbind(1,1,2,2));

           #BODmodel
             
           BOD <-
     structure(list(Time = c(1, 2, 3, 4, 5, 7), demand = c(8.3, 10.3, 
     19, 16, 15.6, 19.8)), .Names = c("Time", "demand"), row.names = c("1", 
     "2", "3", "4", "5", "6"), class = "data.frame", reference = "A1.4, p. 270")

            stval=expand.grid(A = seq(10, 100, 10), lrc = seq(.5, .8, .1))
            llfun<-function(A,lrc,BOD)
                  -sum((BOD$demand - A*(1-exp(-exp(lrc)*BOD$Time)))^2)
            lls=NULL 
            for (i in 1:nrow(stval))  {
               lls = rbind(lls, llfun(stval[i,1], stval[i,2],BOD))
            }
            fm1 <- nls(demand ~ A*(1-exp(-exp(lrc)*Time)),  
                          data = BOD, start = c(A = 20, lrc = log(.35)))
            ss = -sum(resid(fm1)^2)
            dehaan(lls, ss)
            
            llb=NULL
            for (i in 1:nrow(stval))  {
             llb = rbind(llb,coef( 
             nls(demand ~ A*(1-exp(-exp(lrc)*Time)),  
                          data = BOD, start = c(A=stval[i,1], lrc = stval[i,2]))))
           }
            starr(llb)
            

