GGMtest2: GGMtest2

Description Usage Arguments Value See Also Examples

View source: R/GGMtest2.R

Description

Testing conditional independence hypothesis for a gaussian graphical model.

Usage

1
2
3
4
5
6
7
8
9
GGMtest2(
  data = X,
  edges = S,
  nuisance_estimaton = "lasso",
  method = "robust",
  DML_method = "DML2",
  k_fold = 1,
  penalty = list(c = 1.1)
)

Arguments

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.

Value

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.

See Also

confint.GGMtest for confidence intervals, plot_GGMtest for plotting options and adj_GGMtest for the adjacency matrix

Examples

 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)

SvenKlaassen/GGMtest documentation built on May 13, 2021, 9:52 a.m.