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)
            

