modelSearch | R Documentation |
Four model search strategies are implemented combining
SEMdag()
, SEMbap()
, and resizeGraph()
functions.
All strategies estimate a new graph by 1) adjusting (BAP deconfounding) the
the data matrix and 2) re-sizing the output DAG.
modelSearch(
graph,
data,
gnet = NULL,
d = 2,
search = "basic",
beta = 0,
method = "BH",
alpha = 0.05,
verbose = FALSE,
...
)
graph |
Input graph as an igraph object. |
data |
A matrix or data.frame. Rows correspond to subjects, and columns to graph nodes (variables). |
gnet |
Reference directed network used to validate and import nodes and interactions. |
d |
Maximum allowed geodesic distance for directed or undirected
shortest path search. A distance |
search |
Search strategy. Four model search strategies are available:
|
beta |
Numeric value. Minimum absolute LASSO beta coefficient for
a new interaction to be retained in the estimated DAG backbone. Lower
|
method |
Multiple testing correction method. One of the values
available in |
alpha |
Significance level for false discovery rate (FDR) used
for local d-separation tests. This argument is used to
control data de-correlation. A higher |
verbose |
If TRUE, it shows intermediate graphs during the execution (not recommended for large graphs). |
... |
Currently ignored. |
Search strategies can be ordered by decreasing conservativeness
respect to the input graph, as: "direct", "inner", "outer", and "basic".
The first three strategies are knowledge-based, since they require an
input graph and a reference network, together with data, for
knowledge-assisted model improvement. The last one does not require
any reference and the output model structure will be data-driven.
Output model complexity can be limited using arguments d
and
beta
.
While d is fixed to 0 or 1 in "basic" or "direct", respectively;
we suggest starting with d = 2
(only one mediator)
for the other two strategies.
For knowledge-based strategies, we suggest to to start with
beta = 0
. Then, beta can be relaxed (0 to < 0.1) to improve
model fitting, if needed. Since data-driven models can be complex,
we suggest to start from beta = 0
when using the "basic" strategy.
The beta
value can be relaxed until a good model fit is obtained.
Argument alpha determines the extent of data adjustment: lower alpha
values for FDR correction correspond to a smaller number of significant
confounding factors, hence a weaker correction
(default alpha = 0.05
).
The output model as well as the adjusted dataset are returned as a list of 2 objects:
"graph", the output model as an igraph object;
"data", the adjusted dataset.
Mario Grassi mario.grassi@unipv.it
# Comparison among different model estimation strategies
# Nonparanormal(npn) transformation
als.npn <- transformData(alsData$exprs)$data
# Models estimation
m1 <- modelSearch(graph = alsData$graph, data = als.npn, gnet = kegg,
search = "direct", beta = 0, alpha = 0.05)
m2 <- modelSearch(graph = alsData$graph, data = als.npn, gnet = kegg,
d = 2, search = "inner", beta = 0, alpha = 0.05)
m3 <- modelSearch(graph = alsData$graph, data = als.npn, gnet = kegg,
d = 2, search = "outer", beta = 0, alpha = 0.05)
m4 <- modelSearch(graph = alsData$graph, data = als.npn, gnet = NULL,
search = "basic", beta = 0.1, alpha = 0.05)
# Graphs
#old.par <- par(no.readonly = TRUE)
#par(mfrow=c(2,2), mar= rep(1,4))
gplot(m1$graph, main = "direct graph")
gplot(m2$graph, main = "inner graph")
gplot(m3$graph, main = "outer graph")
gplot(m4$graph, main = "basic graph")
#par(old.par)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.