InducedGraphs              package:ggm              R Documentation

_G_r_a_p_h_s _i_n_d_u_c_e_d _b_y _m_a_r_g_i_n_a_l_i_z_a_t_i_o_n _o_r _c_o_n_d_i_t_i_o_n_i_n_g

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

     Functions to find the induced covariance or concentration graphs
     after conditioning on a set of variables and marginalizing over
     another set.

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

     inducedCovGraph(amat, sel = rownames(amat), cond = NULL)
     inducedConGraph(amat, sel = rownames(amat), cond = NULL)

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

    amat: a square Boolean matrix, the adjacency matrix of a directed
          acyclic graph. The names of rows and of the columns are the
          nodes of the DAG.

     sel: a character vector representing a subset of selected
          variables.  The elements of the  vector must be a subset of
          the names of the nodes i.e. of 'rownames(A)'.  By default
          'sel' is the set of the nodes of the DAG. 

    cond: a character vector representing the variables on which you
          want to condition. 'cond' must be disjoint from 'sel' and
          their union must be a subset of the set of nodes. The set
          difference between the set of nodes and the union of 'sel'
          and 'cond' are  the variables over which we marginalize.
          'cond' may be the null vector (the default), meaning that you
          want to condition on the empty set. 

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

     Given a directed acyclic graph representing a set of conditional
     independencies it is possible to obtain other graphs of
     conditional independence implied after marginalizing over and
     conditionig on sets of nodes. Two such graphs are the covariance
     graph and the concentration graph (Cox & Wermuth, 1996, 2003).

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

     'inducedCovGraph' returns the adjacency matrix of the covariance
     graph of the variables in set 'sel' given the variables in set
     'cond', implied by the original directed acyclic graph with
     adjacency matrix 'amat'. 

     'inducedConGraph' returns the adjacency matrix of the
     concentration graph of the variables in set 'sel' given the
     variables in set 'cond', implied by the original directed acyclic
     graph with adjacency matrix 'amat'.

     If 'sel' is 'NULL' the functions return  the null matrix. If
     'cond' is 'NULL', the conditioning set is empty and the functions
     return the overall induced covariance or concentration matrices of
     the selected variables.

_N_o_t_e:

     If you do not specify 'sel' you cannot specify a non 'NULL' value
     of 'cond'.

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

     Giovanni M. Marchetti

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

     Cox, D. R. & Wermuth, N. (1996). _Multivariate dependencies_.
     London: Chapman & Hall.

     Wermuth, N. & Cox, D.R. (2003). Joint response graphs and
     separation induced by triangular systems. Submitted and available
     at <URL: http://psystat.sowi.uni-mainz.de>.

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

     'DAG', 'UG','isAcyclic'

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

     ## Define a DAG
     dag <- DAG(a ~ x, c ~ b+d, d~ x)
     dag
     ## Induced covariance graph of a, b, d given the empty set.
     inducedCovGraph(dag, sel=c("a", "b", "d"), cond=NULL)

     ## Induced concentration graph of a, b, c given x
     inducedConGraph(dag, sel=c("a", "b", "c"), cond="x")

     ## Overall covariance graph
     inducedCovGraph(dag)

     ## Overall concentration graph
     inducedConGraph(dag)

     ## Induced covariance graph of x, b, d given c, x.
     inducedCovGraph(dag, sel=c("a", "b", "d"), cond=c("c", "x"))

     ## Induced concentration graph of a, x, c given d, b.
     inducedConGraph(dag, sel=c("a", "x", "c"), cond=c("d", "b"))

     ## The DAG on p. 198 of Cox & Wermuth (1996)
     dag <- DAG(y1~ y2 + y3, y3 ~ y5, y4 ~ y5)

     ## Cf. figure 8.7 p. 203 in Cox & Wermuth (1996)
     inducedCovGraph(dag, sel=c("y2", "y3", "y4", "y5"), cond="y1")
     inducedCovGraph(dag, sel=c("y1", "y2", "y4", "y5"), cond="y3")
     inducedCovGraph(dag, sel=c("y1", "y2", "y3", "y4"), cond="y5")

     ## Cf. figure 8.8 p. 203 in Cox & Wermuth (1996)
     inducedConGraph(dag, sel=c("y2", "y3", "y4", "y5"), cond="y1")
     inducedConGraph(dag, sel=c("y1", "y2", "y4", "y5"), cond="y3")
     inducedConGraph(dag, sel=c("y1", "y2", "y3", "y4"), cond="y5")

     ## Cf. figure 8.9 p. 204 in Cox & Wermuth (1996)
     inducedCovGraph(dag, sel=c("y2", "y3", "y4", "y5"), cond=NULL)
     inducedCovGraph(dag, sel=c("y1", "y2", "y4", "y5"), cond=NULL)
     inducedCovGraph(dag, sel=c("y1", "y2", "y3", "y4"), cond=NULL)

     ## Cf. figure 8.10 p. 204 in Cox & Wermuth (1996)
     inducedConGraph(dag, sel=c("y2", "y3", "y4", "y5"), cond=NULL)
     inducedConGraph(dag, sel=c("y1", "y2", "y4", "y5"), cond=NULL)
     inducedConGraph(dag, sel=c("y1", "y2", "y3", "y4"), cond=NULL)

