MLEdag: MLE/LRT of a Gaussian directed acyclic graph

Description Usage Arguments Value Author(s) References Examples

Description

Computes the MLE/LRT of a Gaussian directed acyclic graph using difference convex programming and alternating direction method of multipliers.

Usage

1
2
3
MLEdag(X, A = NULL, Lambda = NULL, D = NULL, tau, mu, rho, 
        tol_abs = 1e-04, tol_rel = 1e-04, 
        dc_max_iter = 20, admm_max_iter = 1000, trace_obj = TRUE)

Arguments

X

An n by p data matrix, where n is the number of observations and p is the dimension.

A, Lambda

Initial estimate. A is a p by p adjacency matrix, Lambda is a p by p dual matrix in acyclicity condition. A must be a DAG! If A is NULL (default), the initial estimate is provided automatically (Be careful!).

D

A p by p matrix indicating hypothesized edges. For the entries equal to one, no sparse penalty is imposed. If D is not provided, or if all off-diagonal entries of D are zero, no test is performed.

tau

A positive real number. tau is the threshold parameter in TLP.

mu

A positive real number. mu is the sparsity parameter.

rho

A positive real number. rho is the ADMM dual parameter.

tol_abs, tol_rel

Positive real. The absolute and relative tolerance.

dc_max_iter, admm_max_iter

Positive integer. The maximum iteration number of DC and ADMM.

trace_obj

Logical. If TRUE, the objective values are printed after each iteration.

Value

The function returns a LIST containing the following components.

X

The input data matrix.

A

The final estimate of adjacency matrix. Returned if no test is performed.

A.H1, A.H0

The final estimates of adjacency matrix under alternative and null. Returned if a test is performed.

Lambda

The final estimate of dual variables in the acyclicity condition. Returned if no test is performed.

Lambda.H1

The final estimate of dual variables in the acyclicity condition under alternative. Returned if a test is performed.

D

A matrix indicating hypothesized edges. Returned if a test if performed.

tau

The input threshold parameter in TLP.

mu

The input sparsity parameter.

lrt

(2\timeslog-likelihood ratio) of alternative over null. Returned if a test is performed.

df

Degrees of freedom of the test. Returned if a test is performed.

pval

The p-value of the test. Returned if a test is performed.

Author(s)

Chunlin Li <li000007@umn.edu>

References

Li, C., Shen, X., and Pan, W. (2019). Likelihood ratio tests for a large directed acyclic graph. Journal of the American Statistical Association. Accepted. <doi:10.1080/01621459.2019.1623042>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##
## Example: random graph
##
library(clrdag)
set.seed(2019)
p<-10
n<-1000
## random graph: randomly generate adjacency matrix A, A lower triangular
sparsity <- 2/p
A <- matrix(rbinom(p*p,1,sparsity)*sign(runif(p*p,min=-1,max=1)),p,p)
A[upper.tri(A,diag=TRUE)] <- 0
X <- matrix(rnorm(n*p),n,p) %*% t(solve(diag(p)-A))
out <- MLEdag(X=X,tau=0.3,mu=1,rho=1.2,trace_obj=FALSE) # compute the MLE
sum(abs((out$A!=0)-(A!=0))) # Hamming distance to the truth graph

# test edge 1 --> 2
D <- matrix(0,p,p)
D[2,1] <- 1
out <- MLEdag(X=X,D=D,tau=0.3,mu=1,rho=1.2,trace_obj=FALSE) # compute the MLE
out$pval

clrdag documentation built on June 4, 2019, 5:04 p.m.

Related to MLEdag in clrdag...