Description Usage Arguments Details Value Examples
Estimate a Bayesian network (directed acyclic graph) from observational data using the CCDr algorithm as described in Aragam and Zhou (2015).
1 2 3 |
data |
Data as |
lambdas |
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 |
whitelist |
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 |
blacklist |
A two-column matrix of edges that are guaranteed to be absent
from each estimate (a "black list"). See argument
" |
gamma |
Value of concavity parameter. If |
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 DAG estimate is |
betas |
Initial guess for the algorithm. Represents the weighted adjacency matrix of a DAG where the algorithm will begin searching for an optimal structure. |
sigmas |
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. |
verbose |
|
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ### Generate some random data
dat <- matrix(rnorm(1000), nrow = 20)
dat <- sparsebnUtils::sparsebnData(dat, type = "continuous")
# Run with default settings
ccdr.run(data = 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
ccdr.run(data = dat, betas = init.betas, lambdas.length = 20, alpha = 10, verbose = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.