ccdr.run: Main CCDr Algorithm

Description Usage Arguments Details Value Examples

View source: R/ccdr-main-R.R

Description

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

Usage

1
2
ccdr.run(data, betas, lambdas, lambdas.length = NULL, gamma = 2,
  error.tol = 1e-04, max.iters = NULL, alpha = 10, verbose = FALSE)

Arguments

data

Data matrix. Must be numeric and contain no missing values.

betas

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

lambdas

(optional) 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).

lambdas.length

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).

gamma

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.tol

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

max.iters

Maximum number of iterations for each internal sweep.

alpha

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

verbose

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

Details

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.

Value

A ccdrPath-class object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

### Generate some random data
dat <- matrix(rnorm(1000), nrow = 20)

### Run with default settings
ccdr.run(data = dat)

### Optional: Adjust settings
pp <- ncol(dat)
init.betas <- matrix(0, nrow = pp, ncol = pp)              # initialize algorithm with a random initial value
init.betas[1,2] <- init.betas[1,3] <- init.betas[4,2] <- 1 #
ccdr.run(data = dat, betas = init.betas, lambdas.length = 10, alpha = 10, verbose = TRUE)

## End(Not run)

itsrainingdata/ccdr documentation built on May 18, 2019, 7:12 a.m.