nullDistDoublyTestedEdges      package:ppiStats      R Documentation

_N_u_l_l _d_i_s_t_r_i_b_u_t_i_o_n _o_f _n_u_m_b_e_r _o_f _r_e_c_i_p_r_o_c_a_t_e_d,
_u_n_r_e_c_i_p_r_o_c_a_t_e_d _a_n_d _m_i_s_s_i_n_g _e_d_g_e_s _i_n _s_t_o_c_h_a_s_t_i_c _m_o_d_e_l.

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

     Calculate the null distribution of the number of reciprocated,
     unreciprocated and missing edges in a stochastic model where each
     edge is tested twice.

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

     nullDistDoublyTestedEdges(deltaMax, n, pFP, pFN)

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

deltaMax: Integer. Distributions will be calculated for model parameter
          _delta_'=0, 1, 2, ..., deltaMax'.

       n: Integer. The parameter _n_ of the model.

     pFP: Numeric. The parameter _pFP_ of the model.

     pFN: Numeric. The parameter _pFN_ of the model.

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

     The model is described in the vignette _Stochastic and systematic
     errors in PPI data, by looking at unreciprocated in- or out-edges_
     by W. Huber, T. Chiang and R. Gentleman. 

     This function can be quite slow, its runtime grows quickly with
     'deltaMax' (and is roughly independent of 'n', 'pFP', 'pFN'). The
     example below should take only a few seconds on a reasonable
     computer, though.

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

     3d array with dimensions 'nMax+1' x 'nMax+1' x 'deltaMax+1' whose
     element 'p[nr+1, nu+1, delta+1]' is the corresponding joint
     probability.  'nMax+1' is calculated (probably too conservatively)
     by the function to make sure that no probability leaks out of the
     array.

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

     Wolfgang Huber <URL: http://www.ebi.ac.uk/huber>

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

     p = nullDistDoublyTestedEdges(32, 1000, pFP=0.001, pFN=0.15)

     if(interactive() && require("RColorBrewer"))
       for(k in 1:dim(p)[3]) {
         image(sqrt(p[,,k]), xlab=expression(N[rec]), ylab=expression(N[unrec]),
             main = expression(P(N[rec], N[unrec]~";"~ delta^"*", n, p[FP], p[FN])),
             x = 1:dim(p)[1], y = 1:dim(p)[2], 
             col = colorRampPalette(brewer.pal(9, "GnBu"))(256))
         text(35, 35, paste("delta", k, sep="="))
       }

