intDAG: A DAG function for interventional data

Description Usage Arguments Value Examples

View source: R/intDAG.R

Description

This function allows you to learn the DAG structure from interventional data

Usage

1
2
3
intDAG(X, p, lambda, lambda2, tau = 0.05, rho = 1, A_NZ0 = NULL,
  A0 = NULL, sigma = NULL, Sig = NULL, variance.constraint = TRUE,
  opts.tol = 0.001, maxIter = 1000)

Arguments

X

The n by M data matrix

p

The dimension of the adjacency matrix

lambda

tuning parameter for the first penalty of the adjacency matrix

lambda2

tuning parameter for the sparsity penalty of the intervention matrix

tau

tuning parameter of the TLP function, default is 0.05

rho

the ADMM penalty parameter, default is 1

A_NZ0

An p by M matrix indicating nonzero elements as initial values

A0

An p by M matrix as initial values for (A, B)

sigma

the parameter in the variance constraint, not needed when variance.constraint is set to FALSE

Sig

vector of length p, the error variances of each node, not needed when variance.constraint is set to FALSE

variance.constraint

a flag indicating if the variance constraint is included, default is TRUE

opts.tol

Tolerance for convergence

maxIter

maximum number of iterations in ADMM loop

Value

A list with components

A

Estimated adjacency matrix

B

Estimated intervention matrix

Sig

Estimated vector of error variances of each node

sigma

Estimated paramter in the variance constraint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
p <- w <- 10
s0 <- p # number of edges
lower <- rep(0, (p*(p-1)/2)) # num of possible edges
nz_set <- sample(1:(p*(p-1)/2), s0) # sample a non-zero edge set
lower[nz_set] <- 0.5
amat <- matrix(0, p, p)
amat[lower.tri(amat)] <- lower
bmat <- diag(sqrt(seq(1, 1.5, length=p)))
Sig <- seq(1.5, 1, length = p)
X <- rmvDAG_int(100, amat, bmat, Sig)
Sig0 <- rep(1, p)
sigma0 <- 3
out <- intDAG(X, p, 2, 2, 0.05, rho=10, sigma=sigma0, Sig=Sig0)

intdag documentation built on Oct. 9, 2019, 9:05 a.m.

Related to intDAG in intdag...