Commit e797792d authored by Gilles Kratzer's avatar Gilles Kratzer
Browse files

website

parent aa9a7fd1
Pipeline #2496 passed with stage
in 3 seconds
......@@ -8,6 +8,7 @@
^\.gitlab-ci\.yml$
^NEWS.md$
^README.md$
^mcmcabn_0.1.tar.gz$
^model.bug$
^tests/model.bug$
^vignettes/mcmcabn-advanced.rmd
^.*\.tar.gz$
......@@ -32,7 +32,7 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
prob.mc3 <- 1 - (prob.rev + prob.mbr)
heating.orig <- NULL
## output
out.dags <- array(data = NA, dim = c(n.var, n.var, mcmc.scheme[1] + 1))
......@@ -40,6 +40,7 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
out.alpha <- rep(NA, length = mcmc.scheme[1] + 1)
out.method <- rep(NA, length = mcmc.scheme[1] + 1)
out.rejection <- rep(NA, length = mcmc.scheme[1] + 1)
out.heating <- rep(NA, length = mcmc.scheme[1] + 1)
## seeding
set.seed(seed = seed)
......@@ -123,21 +124,16 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
sc <- cbind(tmp, score.cache[[score]])
}
# sc.scaled <- sc
# tmp.fact <- abs(max(sc[,ncol(sc)]))
# if(scaling>0){
# sc.scaled[,ncol(sc)] <- sc[,ncol(sc)]/(scaling * tmp.fact)
# }
## scoring init
score.init <- score.dag(dag.tmp,score.cache,sc)
# for (a in 1:n.var) {
# sc.tmp <- sc[score.cache$children == as.numeric(colnames(dag.tmp)[a]), ,drop = FALSE]
# score.init <- sum(min(sc.tmp[which(apply(sc.tmp, 1, function(x) identical(unname(x[1:n.var]), unname(dag.tmp[a,
# ])))), n.var + 1]), score.init)
#
# }
## heating scheme
if(is.numeric(heating) & heating>1){
heating.orig <- heating
heating <- 1/heating.orig
}
## out
......@@ -151,19 +147,23 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
out.rejection[1] <- 0
out.heating[1] <- heating
## start mcmc search
if (verbose)
cat("Start MCMC burn in \n")
j <- 1
while (j <= mcmc.scheme[3]) {
## method choice:
method.choice <- sample(x = c("MC3", "REV", "MBR"), size = 1, prob = c(prob.mc3, prob.rev, prob.mbr))
#if(heating=="auto"){factor <- 1/(j+1)}
if(heating<1 & !is.null(heating.orig)){heating <-1/(heating.orig-j+1)}
switch(method.choice, MC3 = {
out <- mc3(n.var, (dag.tmp), retain, ban, max.parents, sc, score.cache, score, prior.choice, prior.lambda, prior.dag,
......@@ -192,7 +192,11 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
out.scores[1] <- score
out.dags[, , 1] <- dag.tmp
### EOF: Burnin phase!
### EOF: Burn-in phase!
if(!is.null(heating.orig) & heating<1){
heating.orig <- round(1/heating)
}
if (verbose)
cat("Start MCMC search \n")
......@@ -202,6 +206,9 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
## start blind search
j <- 0
if(heating<1 & !is.null(heating.orig)){heating <- 1/(heating.orig-mcmc.search+1)}
while (j <= mcmc.scheme[2]) {
method.choice <- sample(x = c("MC3", "REV", "MBR"), size = 1, prob = c(prob.mc3, prob.rev, prob.mbr))
......@@ -246,9 +253,11 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
out.rejection[mcmc.search + 1] <- rejection
out.heating[mcmc.search + 1] <- heating
} #EOF mcmc search
out <- list(dags = out.dags, scores = out.scores, alpha = out.alpha, method = out.method, rejection = out.rejection,
iterations = mcmc.scheme[1] * (mcmc.scheme[2] + 1), thinning = mcmc.scheme[2], burnin = mcmc.scheme[3], data.dist = data.dists)
iterations = mcmc.scheme[1] * (mcmc.scheme[2] + 1), thinning = mcmc.scheme[2], burnin = mcmc.scheme[3], data.dist = data.dists, heating = out.heating)
class(out) <- "mcmcabn"
......
......@@ -55,9 +55,9 @@
if (is.matrix(prior.dag) && dim(prior.dag)[1] != length(data.dists))
stop("prior.dag should be a squared matrix with dimension equal to the number of variables.")
if(heating<0 | !is.numeric(heating))
stop("heating parameter shoud be between a positive real number. One is neutral. Smaller than one is heating up and larger than one is cooling down the convergence rate.")
if(heating<0 | !is.numeric(heating))
stop("heating parameter shoud be between a positive real number. One is neutral. Smaller than one is heating up. Larger than one indicates the number of steps when a linearly decreased heating scheme should be performed.")
}
##-------------------------------------------------------------------------
......
......@@ -14,6 +14,10 @@ navbar:
href: index.html
- text: "Vignette"
href: articles/mcmcabn.html
- text: "Articles"
menu:
- text: 'mcmcabn advanced methods'
href: articles/mcmcabn-advanced.html
- icon: fa-newspaper-o
text: "news"
href: news/index.html
......
......@@ -82,6 +82,20 @@
<li>
<a href="articles/mcmcabn.html">Vignette</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-gitlab list-ul"></span>
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/mcmcabn-advanced.html">mcmcabn advanced methods</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">
<span class="fa fa-newspaper-o"></span>
......
This diff is collapsed.
......@@ -82,6 +82,20 @@
<li>
<a href="../articles/mcmcabn.html">Vignette</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-gitlab list-ul"></span>
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/mcmcabn-advanced.html">mcmcabn advanced methods</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">
<span class="fa fa-newspaper-o"></span>
......@@ -133,7 +147,7 @@
<p class="section-desc"></p>
<ul>
<li><a href="Articles/convergence.html">mcmcabn: a structural MCMC sampler for DAGs learned from observed systemic datasets</a></li>
<li><a href="mcmcabn-advanced.html">Advances with mcmcabn: a structural MCMC sampler for DAGs learned from observed systemic datasets</a></li>
<li><a href="mcmcabn.html">mcmcabn: a structural MCMC sampler for DAGs learned from observed systemic datasets</a></li>
</ul>
</div>
......
This diff is collapsed.
......@@ -46,6 +46,20 @@
<li>
<a href="../articles/mcmcabn.html">Vignette</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-gitlab list-ul"></span>
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/mcmcabn-advanced.html">mcmcabn advanced methods</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">
<span class="fa fa-newspaper-o"></span>
......
......@@ -82,6 +82,20 @@
<li>
<a href="articles/mcmcabn.html">Vignette</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-gitlab list-ul"></span>
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/mcmcabn-advanced.html">mcmcabn advanced methods</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">
<span class="fa fa-newspaper-o"></span>
......
......@@ -46,6 +46,20 @@
<li>
<a href="articles/mcmcabn.html">Vignette</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-gitlab list-ul"></span>
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/mcmcabn-advanced.html">mcmcabn advanced methods</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">
<span class="fa fa-newspaper-o"></span>
......
Markdown is supported
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