Learn R Programming

MRPC (version 2.0.0)

MRPCclass-class: Class of MRPC Algorithm Results

Description

This class of objects is returned by the functions ModiSkeleton and MRPC to represent the (ModiSkeleton) of an estimated DAG similarly from pcAlgo-class. Objects of this class have methods for the functions plot, show and summary.

Usage


# S4 method for MRPCclass,ANY
plot(x, y, main = NULL,
     zvalue.lwd = FALSE, lwd.max = 7, labels = NULL, …)
# S3 method for MRPCclass
print(x, amat = FALSE, zero.print = ".", …)

# S4 method for MRPCclass summary(object, amat = TRUE, zero.print = ".", …) # S4 method for MRPCclass show(object)

Arguments

x, object

a "MRPCclass" object.

y

(generic plot() argument; unused).

main

main title for the plot (with an automatic default).

zvalue.lwd

logical indicating if the line width (lwd) of the edges should be made proportional to the entries of matrix zMin (originally) or derived from matrix pMax.

lwd.max

maximal lwd to be used, if zvalue.lwd is true.

labels

if non-NULL, these are used to define node attributes nodeAttrs and attrs, passed to agopen() from package Rgraphviz.

amat

logical indicating if the adjacency matrix should be printed as well.

zero.print

String for printing 0 (‘zero’) entries in the adjacency matrix.

(optional) Further arguments passed from and to methods.

Creation of objects

Objects are typically created as result from skeleton() or pc(), but could be be created by calls of the form new("MRPCclass", ...).

Slots

The slots call, n, max.ord, n.edgetests, sepset, pMax, graph, zMin, test, alpha and R are inherited class.

In addition, "MRPCclass" has slots

call:

a call object: the original function call.

n:

The sample size used to estimate the graph.

max.ord:

The maximum size of the conditioning set used in the conditional independence tests of the first part of the algorithm.

n.edgetests:

The number of conditional independence tests performed by the first part of the algorithm.

sepset:

Separation sets.

pMax:

A square matrix , where the (i, j)th entry contains the maximum p-value of all conditional independence tests for edge i--j.

graph:

Object of class "'>graph": The undirected or partially directed graph that was estimated.

zMin:

Deprecated.

test:

The number of tests that have been performed.

alpha:

The level of significance for the current test.

R:

All of the decisions made so far from tests that have been performed.

Methods

plot

signature(x = "MRPCclass"): Plot the resulting graph. If argument "zvalue.lwd" is true, the linewidth an edge reflects zMin, so that thicker lines indicate more reliable dependencies. The argument "lwd.max" controls the maximum linewidth.

show

signature(object = "MRPCclass"): Show basic properties of the fitted object

summary

signature(object = "MRPCclass"): Show details of the fitted object

See Also

MRPC, ModiSkeleton

Examples

Run this code
# NOT RUN {
showClass("MRPCclass")

# generate a MRPCclass object
data <- simu.data_M1
n <- nrow(data)      # Number of rows
V <- colnames(data)  # Column names

# Classical correlation
suffStat_C <- list(C = cor(data), n = n)

# Robust correlation (Beta = 0.005)
Rcor_R <- RobustCor(data,
                    0.005) 
                    
suffStat_R <- list(C = Rcor_R$RR, n = n)

# Estimated graph by MRPC using gaussCItest and beta = 0.005
MRPC.fit <- MRPC(data, suffStat_R, GV = 1,
                 FDR = 0.05, indepTest ='gaussCItest',
                 labels = V, verbose = TRUE)


# use methods of class MRPCclass
show(MRPC.fit)

plot(MRPC.fit)
summary(MRPC.fit)

# access slots of this object
(g  <- MRPC.fit@graph)
str(ss <- MRPC.fit@sepset, max = 1)
# }

Run the code above in your browser using DataLab