UG                    package:ggm                    R Documentation

_D_e_f_i_n_i_n_g _a_n _u_n_d_i_r_e_c_t_e_d _g_r_a_p_h (_U_G)

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

     A simple way to define an undirected graph by means of a single
     model formula.

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

     UG(f)

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

       f: a single model formula without response

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

     The undirected graph G = (V, E) is defined by a set of nodes V and
     a set of pairs E. The set of pairs is defined by the set of
     interactions in the formula. Interactions  define complete
     subgraphs (not necessarily maximal) of the UG. The best way is to
     specify interactions that match the cliques of the undirected
     graph. This is the standard way to define graphical models for
     contingency tables. Remember that some hierarchical models are not
     graphical, but they imply the same graph.

     The function returns the edge matrix of the graph, i.e.  a square
     Boolean matrix of order equal to the number of nodes of the graph
     and a one in position (i,j) if there is an arrow from j to i and
     zero otherwise. By default this matrix has ones along the main
     diagonal. For UGs this matrix is symmetric. The dimnames of the
     edge matrix are the nodes of the UG.

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

     a Boolean matrix with dimnames,  the adjacency matrix of the
     undirected graph.

_N_o_t_e:

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

     Giovanni M. Marchetti

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

     Lauritzen, S. (1996). _Graphical models_. Oxford: Clarendon Press.

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

     'fitConGraph', 'fitCovGraph', 'DAG'

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

     ## X independent of Y given Z
     UG(~ X*Z + Y*Z)

     # The saturated model
     UG(~ X*Y*Z)

     ## The model without three-way interactions has the same graph
     UG(~ X*Y + Y*Z + Z*X)
     UG(~ (X + Y + Z)^2)

     ## Butterfly model defined from the cliques
     UG(~ mec*vec*alg + alg*ana*sta)

     ## Some isolated nodes
     UG(~x*y*z + a + b) 

