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="="))
       }

