~ubuntu-branches/ubuntu/wily/ess/wily-proposed

« back to all changes in this revision

Viewing changes to etc/checkTriple.Rd

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2014-09-13 09:03:04 UTC
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: package-import@ubuntu.com-20140913090304-dvylih9xe0bsg4a4
Tags: upstream-14.09
ImportĀ upstreamĀ versionĀ 14.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\name{checkTriple}
 
2
\title{Check Consistency of Conditional Independence for a Triple of Nodes}
 
3
\usage{
 
4
 "An Rd file exposing an ESS bug in  (ess-next-code-line) :
 
5
 Jump to '\examples{' and the first code line (= all '##...') and
 
6
 use C-c C-n  to send it to R.  It works, *but* point does not advance to
 
7
 the next line; but rather jumps backward to the 50'percent' line.
 
8
 Adding a percent 'o/o' sign here ``fixes'' this bug (so I don't do it) "
 
9
 
 
10
checkTriple(version.unf = c(NA, NA),
 
11
            maj.rule = FALSE, verbose = FALSE)
 
12
}
 
13
\arguments{
 
14
  \item{version.unf}{
 
15
    (integer) vector of length two: .............}
 
16
  \item{maj.rule}{logical indicating that the following majority rule
 
17
    is applied: if \code{b} is in less than
 
18
    50\% of the checked sepsets, we say that \code{b} is in \bold{no} sepset.  If
 
19
    \code{b} is in more than 50\% of the checked sepsets, we say that
 
20
    \code{b} is in \bold{all} sepsets.  If \code{b} is in exactly 50\% of the
 
21
    checked sepsets, the triple is considered \sQuote{ambiguous}.}
 
22
  \item{verbose}{Logical asking for detailed output of intermediate steps.}
 
23
}
 
24
\description{
 
25
  For each subset .........
 
26
}
 
27
\references{
 
28
  D. Colombo and M.H. Maathuis (2013).
 
29
  Order-independent constraint-based causal structure learning,
 
30
  (arXiv:1211.3295v2).
 
31
}
 
32
 
 
33
\examples{
 
34
##################################################
 
35
## Using Gaussian Data
 
36
##################################################
 
37
## Load predefined data
 
38
data(gmG)
 
39
n <- nrow(gmG8$x)
 
40
p <- ncol(gmG8$x)
 
41
 
 
42
## define independence test (partial correlations), and test level
 
43
indepTest <- gaussCItest
 
44
alpha <- 0.01
 
45
## define sufficient statistics
 
46
suffStat <- list(C = cor(gmG8$x), n = n)
 
47
 
 
48
## estimate CPDAG
 
49
pc.fit <- pc(suffStat, indepTest, p=p, alpha=alpha, verbose = TRUE)
 
50
 
 
51
if (require(Rgraphviz)) {
 
52
  ## show estimated CPDAG
 
53
  par(mfrow=c(1,2))
 
54
  plot(pc.fit, main = "Estimated CPDAG")
 
55
  plot(gmG8$g, main = "True DAG")
 
56
}
 
57
 
 
58
checkTriple(a = 6, b = 1, c = 8,
 
59
            nbrsA = c(1,5,7),
 
60
            nbrsC = c(1,5),
 
61
            sepsetA = pc.fit@sepset[[a]][[c]],
 
62
            sepsetC = pc.fit@sepset[[c]][[a]],
 
63
            suffStat=suffStat, indepTest=indepTest, alpha=alpha,
 
64
            version.unf = c(2,2),
 
65
            verbose = TRUE)
 
66
}
 
67
\keyword{manip}