Commit 7a266d67 authored by Gilles Kratzer's avatar Gilles Kratzer
Browse files

link in man + website + final CRAN checks

parent 92cbbc42
Pipeline #1658 passed with stage
in 2 seconds
......@@ -8,7 +8,7 @@ Authors@R: c(person("Gilles", "Kratzer", role = c("aut", "cre"),
email = "reinhard.furrer@math.uzh.ch",
comment = c(ORCID = "0000-0002-6319-2332")))
Maintainer: Gilles Kratzer <gilles.kratzer@math.uzh.ch>
Description: Flexible implementation of a structural MCMC sampler for Directed Acyclic Graphs (DAGs). It supports the new edge reversal move from Grzegorczyk and Husmeier (2008) <doi.10.1007/s10994-008-5057-7> and the Markov blanket resampling from Su and Borsuk (2016) <http://jmlr.org/papers/v17/su16a.html>. It supports three priors: a prior controlling for structure complexity from Koivisto and Sood (2004) <http://dl.acm.org/citation.cfm?id=1005332.1005352>, an uninformative prior and a user defined prior. The three main problems that can be addressed by this R package are selecting the most probable structure based on a cache of pre-computed scores, controlling for overfitting and sampling the landscape of high scoring structures. It allows to quantify the marginal impact of relationships of interest by marginalising out over structures or nuisance dependencies. Structural MCMC seems a very elegant and natural way to estimate the true marginal impact, so one can determine if it's magnitude is big enough to consider as a worthwhile intervention.
Description: The package provides a flexible implementation of a structural MCMC sampler for Directed Acyclic Graphs (DAGs). It supports the new edge reversal move from Grzegorczyk and Husmeier (2008) <https://doi.org/10.1007/s10994-008-5057-7> and the Markov blanket resampling from Su and Borsuk (2016) <http://jmlr.org/papers/v17/su16a.html>. It supports three priors: a prior controlling for structure complexity from Koivisto and Sood (2004) <http://dl.acm.org/citation.cfm?id=1005332.1005352>, an uninformative prior and a user defined prior. The three main problems that can be addressed by this R package are selecting the most probable structure based on a cache of pre-computed scores, controlling for overfitting and sampling the landscape of high scoring structures. It allows to quantify the marginal impact of relationships of interest by marginalising out over structures or nuisance dependencies. Structural MCMC seems a very elegant and natural way to estimate the true marginal impact, so one can determine if it's magnitude is big enough to consider as a worthwhile intervention.
Depends: R (>= 3.0.0)
License: GPL-3
Encoding: UTF-8
......
......@@ -75,7 +75,7 @@ mcmcabn <- function(score.cache = NULL, score = "mlik", data.dists = NULL, max.p
dag.banned = NULL,
algo = "hc",
tabu.memory = 10,
temperature = 0.9)
temperature = 0.9)$dag
}
if (is.matrix(start.dag)) {
......
......@@ -10,7 +10,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Flexible Implementation of a Structural MCMC Sampler for DAGs">
<meta property="og:description" content="Flexible implementation of a structural MCMC sampler for Directed Acyclic Graphs (DAGs). It supports the new edge reversal move from Grzegorczyk and Husmeier (2008) &lt;doi.10.1007/s10994-008-5057-7&gt; and the Markov blanket resampling from Su and Borsuk (2016) &lt;http://jmlr.org/papers/v17/su16a.html&gt;. It supports three priors: a prior controlling for structure complexity from Koivisto and Sood (2004) &lt;http://dl.acm.org/citation.cfm?id=1005332.1005352&gt;, an uninformative prior and a user defined prior. The three main problems that can be addressed by this R package are selecting the most probable structure based on a cache of pre-computed scores, controlling for overfitting and sampling the landscape of high scoring structures. It allows to quantify the marginal impact of relationships of interest by marginalising out over structures or nuisance dependencies. Structural MCMC seems a very elegant and natural way to estimate the true marginal impact, so one can determine if it's magnitude is big enough to consider as a worthwhile intervention.">
<meta property="og:description" content="The package provides a flexible implementation of a structural MCMC sampler for Directed Acyclic Graphs (DAGs). It supports the new edge reversal move from Grzegorczyk and Husmeier (2008) &lt;https://doi.org/10.1007/s10994-008-5057-7&gt; and the Markov blanket resampling from Su and Borsuk (2016) &lt;http://jmlr.org/papers/v17/su16a.html&gt;. It supports three priors: a prior controlling for structure complexity from Koivisto and Sood (2004) &lt;http://dl.acm.org/citation.cfm?id=1005332.1005352&gt;, an uninformative prior and a user defined prior. The three main problems that can be addressed by this R package are selecting the most probable structure based on a cache of pre-computed scores, controlling for overfitting and sampling the landscape of high scoring structures. It allows to quantify the marginal impact of relationships of interest by marginalising out over structures or nuisance dependencies. Structural MCMC seems a very elegant and natural way to estimate the true marginal impact, so one can determine if it's magnitude is big enough to consider as a worthwhile intervention.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
......
......@@ -132,11 +132,11 @@
</div>
<pre class="usage"><span class='fu'><a href='https://www.rdocumentation.org/packages/utils/topics/data'>data</a></span>(<span class='st'>"mcmc_run_asia"</span>)</pre>
<pre class="usage"><span class='no'>bsc.compute.asia</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>The data contains a cache of pre-computed scores with a maximum of two parents per node.</p><ul>
<p>The data contains a cache of pre-computed scores with a maximum of two parents per node using buildscorecache from the <code>abn</code> R package.</p><ul>
<li><p><code>bsc.compute.asia</code>: cache of score with a maximum of two parents per node.</p></li>
</ul>
......
......@@ -132,7 +132,7 @@
</div>
<pre class="usage"><span class='fu'><a href='https://www.rdocumentation.org/packages/utils/topics/data'>data</a></span>(<span class='st'>"mcmc_run_asia"</span>)</pre>
<pre class="usage"><span class='no'>dist.asia</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
......
......@@ -139,21 +139,21 @@
<tr>
<td>
<p><code><a href="bsc-compute-asia.html">mcmc_run_asia</a></code> </p>
<p><code><a href="bsc-compute-asia.html">bsc.compute.asia</a></code> </p>
</td>
<td><p>Cache of pre-computed scores related to the asia dataset</p></td>
</tr><tr>
<td>
<p><code><a href="dist-asia.html">mcmc_run_asia</a></code> </p>
<p><code><a href="dist-asia.html">dist.asia</a></code> </p>
</td>
<td><p>Named list of distributions to analyze asia dataset</p></td>
</tr><tr>
<td>
<p><code><a href="mcmc-out-asia.html">mcmc_run_asia</a></code> </p>
<p><code><a href="mcmc-out-asia.html">mcmc.out.asia</a></code> </p>
</td>
<td><p>MCMC search from the synthetic asia dataset for use with mcmcabn library examples</p></td>
<td><p>MCMC searches from the synthetic asia dataset for use with mcmcabn library examples</p></td>
</tr><tr>
<td>
......@@ -165,7 +165,7 @@
<td>
<p><code><a href="mcmc_run_asia.html">mcmc_run_asia</a></code> </p>
</td>
<td><p>MCMC search from the synthetic asia dataset for use with mcmcabn library examples</p></td>
<td><p>List of files to reproduce examples <code>mcmcabn</code> library.</p></td>
</tr><tr>
<td>
......
......@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCMC search from the synthetic asia dataset for use with mcmcabn library examples — mcmc.out.asia • mcmcabn</title>
<title>MCMC searches from the synthetic asia dataset for use with mcmcabn library examples — mcmc.out.asia • mcmcabn</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
......@@ -30,7 +30,7 @@
<meta property="og:title" content="MCMC search from the synthetic asia dataset for use with mcmcabn library examples — mcmc.out.asia" />
<meta property="og:title" content="MCMC searches from the synthetic asia dataset for use with mcmcabn library examples — mcmc.out.asia" />
<meta property="og:description" content="This dataframe contains a cache of pre-computed scores with a maximum of two parents per node for the asia dataset." />
<meta name="twitter:card" content="summary" />
......@@ -121,7 +121,7 @@
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>MCMC search from the synthetic asia dataset for use with mcmcabn library examples</h1>
<h1>MCMC searches from the synthetic asia dataset for use with mcmcabn library examples</h1>
<div class="hidden name"><code>mcmc-out-asia.Rd</code></div>
</div>
......@@ -132,7 +132,7 @@
</div>
<pre class="usage"><span class='fu'><a href='https://www.rdocumentation.org/packages/utils/topics/data'>data</a></span>(<span class='st'>"mcmc_run_asia"</span>)</pre>
<pre class="usage"><span class='no'>mcmc.out.asia</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
......
......@@ -151,7 +151,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>score.cache</th>
<td><p>output from <code>buildscorecache()</code> from the <code>abn</code> R package.</p></td>
<td><p>output from buildscorecache from the <code>abn</code> R package.</p></td>
</tr>
<tr>
<th>score</th>
......@@ -207,6 +207,7 @@
<p>The procedure runs a structural Monte Carlo Markov Chain Model Choice (MC)^3 to find the most probable posterior network (DAG). The default algorithm is based on three MCMC move: edge addition, edge deletion and edge reversal. This algorithm is known as the (MC)^3. It is known to mix slowly and getting stuck in low probability regions. Indeed, changing of Markov equivalence region often requires multiple MCMC moves. Then large scale MCMC moves are implemented. Their relative frequency can be set by the user. The new edge reversal move (REV) from Grzegorczyk and Husmeier (2008) and the Markov blanket resampling (MBR) from Su and Borsuk (2016). The classical reversal move depends on the global configuration of the parents and children and fails to propose MCMC jumps that produce valid but very different DAGs in a unique move. The REV move sample globally a new set of parent. The MBR workaround applies the same idea but to the entire Markov blanket of a randomly chosen node.</p>
<p>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.</p>
<p>The parameter <code>start.dag</code> 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: search.heuristic 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).</p>
<p>The parameter <code>prior.choice</code> 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</code>. When prior.choice=1 an uninformative prior is used where parent combinations of all cardinalities are equally likely. When <code>prior.choice=3</code> a user defined prior is used, defined by <code>prior.dag</code>. 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</code>.</p>
<p>MCMC sampler came with asymptotic statistical guarantees. Therefore it is highly advised to run multiple long enough chains. The burn in phase length (i.e throwing away first MCMC iterations) should be adequately chosen.</p>
<p>The argument <code>data.dists</code> must be a list with named arguments, one for each of the variables in <code>data.df</code>, where each entry is either "poisson","binomial", or "gaussian"</p>
......
......@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCMC search from the synthetic asia dataset for use with mcmcabn library examples — mcmc_run_asia • mcmcabn</title>
<title>List of files to reproduce examples <code>mcmcabn</code> library. — mcmc_run_asia • mcmcabn</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
......@@ -30,9 +30,9 @@
<meta property="og:title" content="MCMC search from the synthetic asia dataset for use with mcmcabn library examples — mcmc_run_asia" />
<meta property="og:title" content="List of files to reproduce examples <code>mcmcabn</code> library. — mcmc_run_asia" />
<meta property="og:description" content="10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010)." />
<meta property="og:description" content="10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010). Named list of distributions and pre-computed scores." />
<meta name="twitter:card" content="summary" />
......@@ -121,23 +121,24 @@
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>MCMC search from the synthetic asia dataset for use with mcmcabn library examples</h1>
<h1>List of files to reproduce examples <code>mcmcabn</code> library.</h1>
<div class="hidden name"><code>mcmc_run_asia.Rd</code></div>
</div>
<div class="ref-description">
<p>10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010).</p>
<p>10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010). Named list of distributions and pre-computed scores.</p>
</div>
<pre class="usage"><span class='fu'><a href='https://www.rdocumentation.org/packages/utils/topics/data'>data</a></span>(<span class='st'>"mcmc_run_asia"</span>)</pre>
<pre class="usage"><span class='no'>mcmc_run_asia</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>The data contains an object of class mcmcabn and a cache of score compute with abn R package.</p><ul>
<li><p><code>bsc.compute.asia</code>: cache of score with a maximum of two parents per node.</p></li>
<p>The data contains an object of class mcmcabn and a cache of score computed using
buildscorecache from the <code>abn</code> R package.</p><ul>
<li><p><code>bsc.compute.asia</code>: cache of score with a maximum of two parents per node computed using buildscorecache from the <code>abn</code> R package.</p></li>
<li><p><code>dist.asia</code>: a named list giving the distribution for each node in the network.</p></li>
<li><p><code>mcmc.out.asia</code>: an object of class mcmcabn.</p></li>
</ul>
......
......@@ -6,10 +6,10 @@
\description{This dataframe contains a cache of pre-computed scores with a maximum of two parents per node for the asia dataset.
}
\usage{data("mcmc_run_asia")}
\usage{bsc.compute.asia}
\format{
The data contains a cache of pre-computed scores with a maximum of two parents per node.
The data contains a cache of pre-computed scores with a maximum of two parents per node using \link[abn:build_score_cache]{buildscorecache} from the \code{abn} R package.
\itemize{
\item \code{bsc.compute.asia}: cache of score with a maximum of two parents per node.
}}
......
......@@ -6,7 +6,7 @@
\description{Named list of distribution to analyze asia dataset.
}
\usage{data("mcmc_run_asia")}
\usage{dist.asia}
\format{
The data contains a cache of pre-computed scores with a maximum of two parents per node.
......
......@@ -2,11 +2,11 @@
\docType{data}
\alias{mcmc.out.asia}
\title{MCMC search from the synthetic asia dataset for use with mcmcabn library examples}
\title{MCMC searches from the synthetic asia dataset for use with mcmcabn library examples}
\description{This dataframe contains a cache of pre-computed scores with a maximum of two parents per node for the asia dataset.
}
\usage{data("mcmc_run_asia")}
\usage{mcmc.out.asia}
\format{
The data contains an object of class \code{mcmcabn}.
......
......@@ -25,7 +25,7 @@ mcmcabn(score.cache = NULL,
}
\arguments{
\item{score.cache}{output from \code{buildscorecache()} from the \code{abn} R package.}
\item{score.cache}{output from \link[abn:build_score_cache]{buildscorecache} from the \code{abn} R package.}
\item{score}{character giving which network score should be used to sample the DAGs landscape.}
\item{data.dists}{a named list giving the distribution for each node in the network, see details.}
\item{max.parents}{a constant giving the maximum number of parents allowed.}
......@@ -48,6 +48,8 @@ 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]{search.heuristic} 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}.
MCMC sampler came with asymptotic statistical guarantees. Therefore it is highly advised to run multiple long enough chains. The burn in phase length (i.e throwing away first MCMC iterations) should be adequately chosen.
......
......@@ -2,17 +2,18 @@
\docType{data}
\alias{mcmc_run_asia}
\title{MCMC search from the synthetic asia dataset for use with mcmcabn library examples}
\description{10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010).
\title{List of files to reproduce examples \code{mcmcabn} library.}
\description{10^5 MCMC runs with 1000 burn-in runs from the asia synthetic dataset from Lauritzen and Spiegelhalter (1988) provided by Scutari (2010). Named list of distributions and pre-computed scores.
}
\usage{data("mcmc_run_asia")}
\usage{mcmc_run_asia}
\format{
The data contains an object of class mcmcabn and a cache of score compute with abn R package.
The data contains an object of class mcmcabn and a cache of score computed using
\link[abn:build_score_cache]{buildscorecache} from the \code{abn} R package.
\itemize{
\item \code{bsc.compute.asia}: cache of score with a maximum of two parents per node.
\item \code{bsc.compute.asia}: cache of score with a maximum of two parents per node computed using \link[abn:build_score_cache]{buildscorecache} from the \code{abn} R package.
\item \code{dist.asia}: a named list giving the distribution for each node in the network.
\item \code{mcmc.out.asia}: an object of class mcmcabn.
}}
......
No preview for this file type
model{
###-----------------------
###Binomial nodes
###-----------------------
A ~ dbern(p.A); #Binary response
logit(p.A) <- 0 + 1*C; #Logistic regression
###-----------------------
###Binomial nodes
###-----------------------
B ~ dbern(p.B); #Binary response
logit(p.B) <- 1 + 1*A + 1*E; #Logistic regression
###-----------------------
###Binomial nodes
###-----------------------
C ~ dbern(p.C); #Binary response
logit(p.C) <- 0; #Logistic regression
###-----------------------
###Binomial nodes
###-----------------------
D ~ dbern(p.D); #Binary response
logit(p.D) <- 0 + 1*E; #Logistic regression
###-----------------------
###Binomial nodes
###-----------------------
E ~ dbern(p.E); #Binary response
logit(p.E) <- 1 + 1*C; #Logistic regression
}
\ No newline at end of file
......@@ -317,7 +317,7 @@ test_that("mcmcabn",{
score = "mlik",
data.dists = dist.asia,
max.parents = 2,
mcmc.scheme = c(1000,0,0),
mcmc.scheme = c(500,0,0),
seed = 456,
verbose = FALSE,
start.dag = "random",
......@@ -326,11 +326,24 @@ test_that("mcmcabn",{
prior.choice = 2)
#maximum scoring network using exact search (not MCMC based)
dag <- mostprobable(score.cache = bsc.compute.asia)
expect_equal(max(mcmc.out.asia$scores),fitabn(dag.m = dag,data.df = asia,data.dists = dist.asia)$mlik)
mcmc.out.asia <- mcmcabn(score.cache = bsc.compute.asia,
score = "mlik",
data.dists = dist.asia,
max.parents = 2,
mcmc.scheme = c(250,0,0),
seed = 789,
verbose = FALSE,
start.dag = "hc",
prob.rev = 0.1,
prob.mbr = 0.1,
prior.choice = 2)
expect_equal(max(mcmc.out.asia$scores),fitabn(dag.m = dag,data.df = asia,data.dists = dist.asia)$mlik)
## marks datasets
data(marks)
......@@ -436,7 +449,6 @@ test_that("query",{
prob.mbr = 0.1,
prior.choice = 2)
expect_true(is.matrix(query(mcmcabn = mcmc.out.gaussian.test)))
expect_equal(query(mcmcabn = mcmc.out.gaussian.test)[1,2],query(mcmcabn = mcmc.out.gaussian.test,formula = ~A|B))
......@@ -444,3 +456,6 @@ expect_equal(query(mcmcabn = mcmc.out.gaussian.test)[2,3],query(mcmcabn = mcmc.o
expect_equal(query(mcmcabn = mcmc.out.gaussian.test)[6,1],query(mcmcabn = mcmc.out.gaussian.test,formula = ~G|A))
})
#delete file temporary file
if (file.exists("model.bug")) {
file.remove("model.bug")}
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