Commit 1d96d8da authored by Gilles Kratzer's avatar Gilles Kratzer
Browse files

upload before CRAN submission

parent 52276436
Pipeline #2074 passed with stage
in 2 seconds
Package: mcmcabn
Title: Flexible Implementation of a Structural MCMC Sampler for DAGs
Version: 0.1
Version: 0.2
Authors@R: c(person("Gilles", "Kratzer", role = c("aut", "cre"),
email = "gilles.kratzer@math.uzh.ch",
comment = c(ORCID = "0000-0002-5929-8935")),
......
## mcmcabn 0.1:
* mcmcabn(), query(), summary(), print() and plot() functions
## mcmcabn 0.2:
* patch to make compatible with abn 2.0
......@@ -75,7 +75,7 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
tabu.memory = 10,
temperature = 0.9)
start.dag <- start.dag[["dags"]][[which.is.max(x = unlist(start.dag$scores))]]
start.dag <- start.dag[["dags"]][[which.max(x = unlist(start.dag$scores))]]
}
......
......@@ -48,7 +48,7 @@ This function is a structural Monte Carlo Markov Chain Model Choice (MC)^3 sampl
The classical (MC)^3 is unbiased but inefficient in mixing, the two radical MCMC alternative move are known to massively accelerate mixing without introducing biases. But those move are computationally expensive. Then low frequencies are advised. The REV move is not necessarily ergotic , then it should not be used alone.
The parameter \code{start.dag} can be: "random", "hc" or user defined. If user select "random" then a random valid DAG is selected. The routine used favourise low density structure. If "hc" (for Hill-climber: \link[abn:heuristic_search]{searchHeuristic} then a DAG is selected using 100 different searches with 500 optimization steps. A user defined DAG can be provided. It should be a named square matrix containing only zeros and ones. The DAG should be valid (i.e. acyclic).
The parameter \code{start.dag} can be: "random", "hc" or user defined. If user select "random" then a random valid DAG is selected. The routine used favourise low density structure. If "hc" (for Hill-climber: \link[abn:search_heuristic]{searchHeuristic} then a DAG is selected using 100 different searches with 500 optimization steps. A user defined DAG can be provided. It should be a named square matrix containing only zeros and ones. The DAG should be valid (i.e. acyclic).
The parameter \code{prior.choice} determines the prior used within each individual node for a given choice of parent combination. In Koivisto and Sood (2004) p.554 a form of prior is used which assumes that the prior probability for parent combinations comprising of the same number of parents are all equal. Specifically, that the prior probability for parent set G with cardinality |G| is proportional to 1/[n-1 choose |G|] where there are n total nodes. Note that this favours parent combinations with either very low or very high cardinality which may not be appropriate. This prior is used when \code{prior.choice=2}. When prior.choice=1 an uninformative prior is used where parent combinations of all cardinalities are equally likely. When \code{prior.choice=3} a user defined prior is used, defined by \code{prior.dag}. It is given by an adjacency matrix (squared and same size as number of nodes) where entries ranging from zero to one give the user prior belief. An hyper parameter defining the global user belief in the prior is given by \code{prior.lambda}.
......
......@@ -378,7 +378,7 @@ test_that("mcmcabn",{
#maximum scoring network using exact search (not MCMC based)
dag <- mostprobable(score.cache = bsc.compute.marks)
expect_equal(max(mcmc.out.marks$scores),fitabn(dag.m = dag,data.df = marks,data.dists = dist.marks)$mlik)
expect_equal(max(mcmc.out.marks$scores),fitabn(object = dag,data.df = marks,data.dists = dist.marks)$mlik)
##tests
data(gaussian.test)
......@@ -403,7 +403,7 @@ test_that("mcmcabn",{
data.dists = dist.gaussian.test,
max.parents = 2,
mcmc.scheme = c(250,0,0),
seed = 678,
seed = 123,
verbose = FALSE,
start.dag = "random",
prob.rev = 0.1,
......@@ -414,7 +414,7 @@ test_that("mcmcabn",{
#maximum scoring network using exact search (not MCMC based)
dag <- mostprobable(score.cache = bsc.compute.gaussian.test)
expect_equal(max(mcmc.out.gaussian.test$scores),fitabn(dag.m = dag,data.df = gaussian.test,data.dists = dist.gaussian.test)$mlik)
expect_equal(max(mcmc.out.gaussian.test$scores),fitabn(object = dag,data.df = gaussian.test,data.dists = dist.gaussian.test)$mlik)
})
......
......@@ -323,4 +323,4 @@ to structure discovery in Bayesian networks. Machine Learning, 50:95–125, 2003
* Imoto, S., Higuchi, T., Goto, T., Tashiro, K., Kuhara, S., and Miyano, S. (2003). Using Bayesian networks for estimating gene networks from microarrays and biological knowledge. In Proceedings of the European Conference on Computational Biology.
* Goudie, R. J., and Mukherjee, S. (2016). A Gibbs Sampler for Learning DAGs. Journal of machine learning research: JMLR, 17(30), 1-39.
* Kuipers, J. and Moffa, G. (2017). Partition MCMC for Inference on Acyclic Digraphs, Journal of the American Statistical Association, 112:517, 282-299, DOI: 10.1080/01621459.2015.1133426
* Scutari, M. (2010). Learning Bayesian Networks with the bnlearn R Package. Journal of Statistical Software, 35(3), 1 - 22. doi:http://dx.doi.org/10.18637/jss.v035.i03.
* Scutari, M. (2010). Learning Bayesian Networks with the bnlearn R Package. Journal of Statistical Software, 35(3), 1 - 22. \doi{http://dx.doi.org/10.18637/jss.v035.i03.}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment