quant             package:BayesValidate             R Documentation

_C_a_l_c_u_l_a_t_e _e_m_p_i_r_i_c_a_l _q_u_a_n_t_i_l_e _o_f _t_h_e _f_i_r_s_t _e_n_t_r_y _i_n _a _v_e_c_t_o_r

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

     'quant' inputs a vector and returns the empirical quantile of the
     first  argument in the vector with respect to all entries in the
     vector.  Used as  part of the function validate for Bayesian
     software validation, this function  is used to calculate the
     empirical quantile of a "true" parameter value with  respect to a
     collection of posterior draws of that parameter.

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

     quant(draws)

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

   draws: Vector of parameter draws, with entry of interest, i.e., the 
          value whose quantile is being calculated, at the beginning. 

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

     Calculates the rank of the first entry of the vector with respect
     to all other entries,  subtracts .5, and divides by the length of
     the vector.

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

     The empirical quantile of the first entry of the vector, a scalar
     between 0 and 1.

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

     Samantha Cook cook@stat.columbia.edu

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

             set.seed(314)
             x<-rnorm(1000)
             quant(x)

