Description Usage Arguments Value Author(s) References Examples
Computes the MLE/LRT of a Gaussian directed acyclic graph using difference convex programming and alternating direction method of multipliers.
1 2 3 |
X |
An n by p data matrix, where n is the number of observations and p is the dimension. |
A, Lambda |
Initial estimate. |
D |
A p by p matrix indicating hypothesized edges.
For the entries equal to one, no sparse penalty is imposed.
If |
tau |
A positive real number. |
mu |
A positive real number. |
rho |
A positive real number. |
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. |
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. |
Chunlin Li <li000007@umn.edu>
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>.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.