qpAnyGraph              package:qpgraph              R Documentation

_A _g_r_a_p_h

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

     Obtains an undirected graph from a matrix of pairwise measurements

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

     qpAnyGraph(measurementsMatrix, threshold=NULL, remove=c("below", "above"),
                topPairs=NULL, decreasing=TRUE, pairup.i=NULL, pairup.j=NULL,
                return.type=c("incidence.matrix", "edge.list", "graphNEL", "graphAM"))

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

measurementsMatrix: matrix of pairwise measurements.

threshold: threshold on the measurements below or above which pairs of
          variables are assumed to be disconnected in the resulting
          graph.

  remove: direction of the removal with the threshold. It should be
          either '"below"' (default) or '"above"'.

topPairs: number of edges from the top of the ranking, defined by the
          pairwise measurements in 'measurementsMatrix', to use to form
          the resulting graph. This parameter is incompatible with a
          value different from 'NULL' in 'threshold'.

decreasing: logical, only applies when topPairs is set; if 'TRUE' then
          the ranking is made in decreasing order; if 'FALSE' then is
          made in increasing order.

pairup.i: subset of vertices to pair up with subset 'pairup.j'

pairup.j: subset of vertices to pair up with subset 'pairup.i'

return.type: type of data structure on which the resulting undirected
          graph should be returned. Either a logical incidence matrix
          with cells set to TRUE when the two indexing variables are
          connected in the graph (default), or a list of edges in a
          matrix where each row corresponds to one edge and the two
          columns contain the two vertices defining each edge, or a
          'graphNEL-class' object, or a 'graphAM-class' object.

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

     This function requires the 'graph' package when
     'return.type=graphNEL' or 'return.type=graphAM'.

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

     The resulting undirected graph as either an incidence matrix, a
     'graphNEL' object or a 'graphAM' object, depending on the value of
     the 'return.type' parameter. Note that when some gold-standard
     graph is available for comparison, a value for the parameter
     'threshold' can be found by calculating a precision-recall curve
     with 'qpPrecisionRecall' with respect to this gold-standard, and
     then using 'qpPRscoreThreshold'. Parameters 'threshold' and
     'topPairs' are mutually exclusive, that is, when we specify with
     'topPairs=n' that we want a graph with 'n' edges then 'threshold'
     cannot be used.

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

     R. Castelo and A. Roverato

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

     Castelo, R. and Roverato, A. A robust procedure for Gaussian
     graphical model search from microarray data with p larger than n,
     _J. Mach. Learn. Res._, 7:2621-2650, 2006.

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

     'qpNrr' 'qpAvgNrr' 'qpEdgeNrr' 'qpGraph' 'qpGraphDensity'
     'qpClique' 'qpPrecisionRecall' 'qpPRscoreThreshold'

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

     nVar <- 50 # number of variables
     maxCon <- 5  # maximum connectivity per variable
     nObs <- 30 # number of observations to simulate

     I <- qpRndGraph(n.vtx=nVar, n.bd=maxCon)
     K <- qpI2K(I)

     X <- qpSampleMvnorm(K, nObs)

     pcc.estimates <- qpPCC(X)

     # the higher the threshold
     g <- qpAnyGraph(abs(pcc.estimates$R), threshold=0.9,
                     remove="below")

     # the sparser the qp-graph
     (sum(g)/2) / (nVar*(nVar-1)/2)

     # the lower the threshold
     g <- qpAnyGraph(abs(pcc.estimates$R), threshold=0.5,
                     remove="below")

     # the denser the graph
     (sum(g)/2) / (nVar*(nVar-1)/2)

