Description Usage Arguments Details Value Examples
View source: R/zero_est_graph.R
Greedy DAG search for DAGs for zero-inflated data based on Hurdle conditionals.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
V |
A matrix of 0/1s, equal to Y != 0. |
Y |
A data matrix of the same size as |
parametrization |
A string, either |
fixedGaps |
A logical square matrix of number of rows/columns equal to number of columns of |
maxDegree |
A positive integer, the maximum degree of a node. |
maxInDegree |
A positive integer, the maximum in-degree of a node. |
init |
An list of adjacency matrices or a single adjacency matrix, each of number of rows/columns equal to number of columns of |
verbose |
A logical, whether to print intermediate steps. |
no_check_DAG |
A logical. If |
return_BIC |
A logical. If |
cache_scores |
A logical. If |
control |
A list passed to |
Performs greedy DAG search for DAGs for zero-inflated data based on Hurdle conditionals.
See Chickering (2003) or ?pcalg::gds
for details. However, unlike the Gaussian case in their implementation that returns an equivalence class of DAGs, the DAG estimated by this function is exact.
If return_BIC
is FALSE
, returns an adjacency matrix; otherwise returns a list with "graph"
element being the estimated matrix and "BIC"
being the estimated BIC.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | m <- 4; n <- 1000
adj_mat <- ZiDAG::make_dag(m, mode = "chain", shuffle=FALSE)
d <- ZiDAG::gen_zero_dat(seed=1, gen_para="pms", adj_mat=adj_mat, n=n, gen_uniform_degree=1)
est <- ZiDAG::ziGDS(V=d$V, Y=d$Y, parametrization="pms", verbose=FALSE,
control=list("max_uniform_degree"=1L, "tol"=1e-8, "print_best_degree"=FALSE))
adj_mat == est
d <- ZiDAG::gen_zero_dat(seed=1, gen_para="abk", adj_mat=adj_mat, n=n, gen_uniform_degree=1)
est <- ZiDAG::ziGDS(V=d$V, Y=d$Y, parametrization="abk", verbose=FALSE,
control=list(use_C=TRUE, maxit=1000, runs=2, report=0))
adj_mat == est
est <- ZiDAG::ziGDS(V=d$V, Y=d$Y, parametrization="pms", verbose=FALSE,
control=list("max_uniform_degree"=1L, "tol"=1e-8, "print_best_degree"=FALSE))
adj_mat == est
est <- ZiDAG::ziGDS(V=d$V, Y=d$Y, parametrization="pms", verbose=FALSE,
control=list("max_uniform_degree"=2L, "tol"=1e-8, "print_best_degree"=FALSE))
adj_mat == est
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.