Description Usage Arguments Value See Also Examples
Testing conditional independence hypothesis for a gaussian graphical model.
1 2 3 4 5 6 7 8 9 |
data |
Dataset: either matrix or dataframe |
edges |
Matrix of edges for testing: each row specifies an edge |
nuisance_estimaton |
Method for nuisance parameter estimation from 'lasso', 'post-lasso' or 'sqrt-lasso' |
method |
Method for point estimation, either 'root' or 'partialling out' |
DML_method |
Method for point estimation, either 'DML2' or 'DML1' |
k_fold |
Parameter for K-fold estimation. Default is k_fold = 1. |
penalty |
Additional coefficient for the penalty term. Default value is c = 1.1. |
A list with components
estimates |
A vector of point estimates. |
edge_list |
The matrix containing the corresponding edges (equal to input). |
sigma_est |
Estimates of the standard deviation. |
psi_est |
Estimates of the score vector. |
additional_parameters |
Additional parameters. |
confint.GGMtest
for confidence intervals, plot_GGMtest
for plotting options
and adj_GGMtest
for the adjacency matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library("huge")
library("igraph")
library("GGMtest")
set.seed(42)
# generate data (different graph structures: "random", "hub", "cluster", "band" and "scale-free")
L <- huge.generator(n = 100, d = 10, graph = "cluster", g = 4)
# true Graph
true_graph <- graph_from_adjacency_matrix(as.matrix(L$theta), mode='undirected', diag=FALSE)
plot(true_graph, usearrows = FALSE, label=1:10, displaylabels=TRUE, main = "True Graph",layout= layout.fruchterman.reingold, edge.width = 2, edge.color = "black")
# index pairs for inference
S <- matrix(c(1,2,2,3,4,5), byrow = TRUE, ncol = 2)
# perform test
ggm_model <- GGMtest2(data = L$data,edges = S,nuisance_estimaton = "lasso")
# Create Confidence Region:
create_CR(ggm_model)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.