preference.game            package:igraph            R Documentation

_T_r_a_i_t-_b_a_s_e_d _r_a_n_d_o_m _g_e_n_e_r_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Generation of random graphs based on different vertex types.

_U_s_a_g_e:

     preference.game(nodes, types, type.dist=rep(1, types),
         pref.matrix=matrix(1, types, types), directed=FALSE, loops=FALSE) 
     asymmetric.preference.game(nodes, types,
         type.dist.matrix=matrix(1,types,types),
         pref.matrix = matrix(1, types, types), loops=FALSE) 

_A_r_g_u_m_e_n_t_s:

   nodes: The number of vertices in the graphs.

   types: The number of different vertex types.

type.dist: The distribution of the vertex types, a numeric vector of
          length 'types' containing non-negative numbers. The vector
          will be normed to obtain probabilities.

type.dist.matrix: The joint distribution of the in- and out-vertex
          types.

pref.matrix: A square matrix giving the preferences of the vertex
          types. The matrix has 'types' rows and columns.

directed: Logical constant, whether to create a directed graph.

   loops: Logical constant, whether self-loops are allowed in the
          graph.

_D_e_t_a_i_l_s:

     Both models generate random graphs with given vertex types. For
     'preference.game' the probability that two vertices will be
     connected depends on their type and is given by the 'pref.matrix'
     argument. This matrix should be symmetric to make sense but this
     is not checked. The distribution of the different vertes types is
     given by the 'type.dist' vector.

     For 'asymmetric.preference.game' each vertex has an in-type and an
     out-type and a directed graph is created. The probability that a
     directed edge is realized from a vertex with a given out-type to a
     vertex with a given in-type is given in the 'pref.matrix'
     argument, which can be asymmetric. The joint distribution for the
     in- and out-types is given in the 'type.dist.matrix' argument.

_A_u_t_h_o_r(_s):

     Tamas Nepusz ntamas@rmki.kfki.hu and Gabor Csardi
     csardi@rmki.kfki.hu for the R interface

_S_e_e _A_l_s_o:

     'establishment.game'. 'callaway.traits.game'

_E_x_a_m_p_l_e_s:

     pf <- matrix( c(1, 0, 0, 1), nr=2)
     g <- preference.game(20, 2, pref.matrix=pf)
     ## Not run: tkplot(g, layout=layout.fruchterman.reingold)

     pf <- matrix( c(0, 1, 0, 0), nr=2)
     g <- asymmetric.preference.game(20, 2, pref.matrix=pf)
     ## Not run: tkplot(g, layout=layout.circle)

