bisearch              package:extRemes              R Documentation

_S_i_m_p_l_e _b_i_s_e_c_t_i_o_n _s_e_a_r_c_h.

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

     Bisection search algorithm to find where a function crosses a
     particular value.

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

     bisearch(x1, x2, f, tol = 1e-07, niter = 25, upcross.level = 0)

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

      x1: Low-end starting value. 

      x2: High-end starting value. 

       f: A function for which to find the crossing value. 

     tol: The tolerance that determines whether to break (early) from
          the algorithm. 

   niter: Number of iterations to try before quitting. 

upcross.level: The level where it is desired to find where 'f' crosses.

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

     This function is shamelessly stolen from the 'fields' package (cf.
     'bisection.search'), but is slightly simpler (i.e., less useful)
     in that it doesn't allow for extra arguments to 'f'. It is used in
     the 'gev.parameterCI' and 'gpd.parameterCI' functions to try to
     find analytically where the profile likelihood crosses the
     chi-square based critical value for obtaining confidence bounds on
     parameter estimates.

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

      x : The estimated crossing.

     fm : The difference between the function value at the found
          crossing and 'upcross.level'.

    iter: Number of iterations used to find the crossing.

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

     Unknown

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

     Fishbane, P.M., Gasiorowicz, S., and S.T. Thornton Physics for
     Scientists and Engineers, 2d ed. (Extended), Upper Saddle River,
     New Jersey: Prentice Hall, 1996.

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

     'gev.parameterCI','gpd.parameterCI'

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

     # Try to solve x^2 = 0.2
     # Initial guess is that it occurs between x=0 and x=1.
     bisearch( 0, 1, function(x) x^2, tol=1e-20, upcross.level=0.2)

