QuantileFun              package:glmmAK              R Documentation

_S_a_m_p_l_e _q_u_a_n_t_i_l_e_s

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

     This is (almost) the same as 'quantile(x)', or 'apply(x, 1,
     quantile)' or 'apply(x, 2, quantile)'.

     The motivation to write it was to validate my C++ function.

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

     QuantileFun(x, probs=seq(0, 1, 0.25), vals.in.cols=TRUE)

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

       x: values of the function

   probs: numeric vector of probabilities with values in [0,1]

vals.in.cols: if 'TRUE' then it is assumed that function f evaluated in
          a specific grid point over (MCMC) iterations is stored in a
          column of 'x'. That is (MCMC) iterations correspond to rows. 

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

     A 'data.frame' with 1 row for each 'probs' value.

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

     Arno&#353t Kom&#225rek arnost.komarek[AT]mff.cuni.cz

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

     'quantile'.

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

     probs <- c(0, 0.25, 0.354, 0.5, 0.75, 1)

     x <- rnorm(1001)
     QuantileFun(x, probs=probs)
     quantile(x, probs=probs)

     n <- 1001
     xx <- data.frame(x1=rnorm(n), x2=rgamma(n, shape=1, rate=1), x3=1:n)
     QuantileFun(xx, probs=probs, vals.in.cols=TRUE)
     apply(xx, 2, quantile, probs=probs)

     xx2 <- t(xx)
     QuantileFun(xx2, probs=probs, vals.in.cols=FALSE)
     apply(xx2, 1, quantile, probs=probs)

