{ccdrAlgorithm}R Documentation

Main CCDr Algorithm


Estimate a Bayesian network (directed acyclic graph) from observational data using the CCDr algorithm as described in Aragam and Zhou (2015).

Usage, lambdas = NULL, lambdas.length = NULL, whitelist = NULL,
  blacklist = NULL, gamma = 2, error.tol = 1e-04, max.iters = NULL,
  alpha = 10, betas, sigmas = NULL, verbose = FALSE)



Data as sparsebnData object. Must be numeric and contain no missing values.


Numeric vector containing a grid of lambda values (i.e. regularization parameters) to use in the solution path. If missing, a default grid of values will be used based on a decreasing log-scale (see also generate.lambdas).


Integer number of values to include in the solution path. If lambdas has also been specified, this value will be ignored. Note also that the final solution path may contain fewer estimates (see alpha).


A two-column matrix of edges that are guaranteed to be in each estimate (a "white list"). Each row in this matrix corresponds to an edge that is to be whitelisted. These edges can be specified by node name (as a character matrix), or by index (as a numeric matrix).


A two-column matrix of edges that are guaranteed to be absent from each estimate (a "black list"). See argument "whitelist" above for more details.


Value of concavity parameter. If gamma > 0, then the MCP will be used with gamma as the concavity parameter. If gamma < 0, then the L1 penalty will be used and this value is otherwise ignored.


Error tolerance for the algorithm, used to test for convergence.


Maximum number of iterations for each internal sweep.


Threshold parameter used to terminate the algorithm whenever the number of edges in the current DAG estimate is > alpha * ncol(data).


Initial guess for the algorithm. Represents the weighted adjacency matrix of a DAG where the algorithm will begin searching for an optimal structure.


Numeric vector of known values of conditional variances for each node in the network. If this is set by the user, these parameters will not be computed and the input will be used as the "true" values of the variances in the algorithm. Note that setting this to be all ones (i.e. sigmas[j] = 1 for all j) is equivalent to using the least-squares loss.


TRUE / FALSE whether or not to print out progress and summary reports.


Instead of producing a single estimate, this algorithm computes a solution path of estimates based on the values supplied to lambdas or lambdas.length. The CCDr algorithm approximates the solution to a nonconvex optimization problem using coordinate descent. Instead of AIC or BIC, CCDr uses continuous regularization based on concave penalties such as the minimax concave penalty (MCP).

This implementation includes two options for the penalty: (1) MCP, and (2) L1 (or Lasso). This option is controlled by the gamma argument.


A sparsebnPath object.


### Generate some random data
dat <- matrix(rnorm(1000), nrow = 20)
dat <- sparsebnUtils::sparsebnData(dat, type = "continuous")

# Run with default settings = dat, lambdas.length = 20)

### Optional: Adjust settings
pp <- ncol(dat$data)

# Initialize algorithm with a random initial value
init.betas <- matrix(0, nrow = pp, ncol = pp)
init.betas[1,2] <- init.betas[1,3] <- init.betas[4,2] <- 1

# Run with adjusted settings = dat, betas = init.betas, lambdas.length = 20, alpha = 10, verbose = TRUE)

[Package ccdrAlgorithm version 0.0.5 Index]