tpc.cons.intern {tpc}R Documentation

Utility for Conservative and Majority Rule in tpc

Description

Like pcalg::pc.cons.intern, but takes into account the user-specified partial node/variable ordering.

Usage

tpc.cons.intern(
  sk,
  suffStat,
  indepTest,
  alpha,
  version.unf = c(NA, NA),
  maj.rule = FALSE,
  forbEdges = NULL,
  tiers = NULL,
  context.all = NULL,
  context.tier = NULL,
  verbose = FALSE
)

Arguments

sk

A skeleton object as returned from pcalg::skeleton.

suffStat

Sufficient statistic: List containing all relevant elements for the conditional independence decisions.

indepTest

Pre-defined function for testing conditional independence. The function is internally called as indepTest(x,y,S,suffStat), and tests conditional independence of x and y given S. Here, x and y are variables, and S is a (possibly empty) vector of variables (all variables are denoted by their (integer) column positions in the adjacency matrix). The return value of indepTest is the p-value of the test for conditional independence.

alpha

Significance level for the individual conditional independence tests.

version.unf

Vector of length two. If version.unf[2]==1, the inititial separating set found by the PC/FCI algorithm is added to the set of separating sets; if version.unf[2]==2, it is not added. In the latter case, if the set of separating sets is empty, the triple is marked as unambiguous if version.unf[1]==1, and as ambiguous if version.unf[1]==2.

maj.rule

Logical indicating if the triples are checked for ambiguity using the majority rule idea, which is less strict than the standard conservative method.

forbEdges

A logical matrix of dimension p*p. If [i,j] is TRUE, then the directed edge i -> j is forbidden. If both [i,j] and [j,i] are TRUE, then any type of edge between i and j is forbidden.

tiers

Numeric vector specifying the tier / time point for each variable. A smaller number corresponds to an earlier tier / time point.

context.all

Numeric or character vector. Specifies the positions or names of global context variables. Global context variables have no incoming edges, i.e. no parents, and are themselves parents of all non-context variables in the graph.

context.tier

Numeric or character vector. Specifies the positions or names of tier-specific context variables. Tier-specific context variables have no incoming edges, i.e. no parents, and are themselves parents of all non-context variables in the same tier.

verbose

Logical asking for detailed output.

Details

See pcalg::pc.cons.intern for further information on the majority and conservative approaches to learning v-structures.

Specifying a tier for each variable using the tier argument has the following effects:

1) Only those triples x-y-z are considered as potential v-structures that satisfy t(y)=max(t(x),t(z)). This allows for three constellations: either y is in the same tier as x and both are later than z, or y is in the same tier as z and both are later than x, or all three are in the same tier. Triples where y is earlier than one or both of x and z need not be considered, as y being a collider would be against the partial ordering. Triples where y is later than both x and z will be oriented later in the pc algorithm and are left out here to minimize the number of conditional independence tests.

2) Conditional independence testing is restricted such that if x is in tier t(x) and y is in t(y), only those variables are allowed in the conditioning set whose tier is not larger than t(x).

Context variables specified via context.all or context.tier are not considered as candidate colliders or candidate parents of colliders.

Value

unfTripl

numeric vector of triples coded as numbers (via pcalg::triple2numb) that were marked as ambiguous.

sk

The updated skeleton-object (separating sets might have been updated).

Author(s)

Original code by Markus Kalisch and Diego Colombo. Modifications by Janine Witte.


[Package tpc version 1.0 Index]