run_banocc | R Documentation |
Runs BAnOCC to fit the model and generate appropriate convergence metrics and inference.
run_banocc(compiled_banocc_model, C, n = rep(0, ncol(C)), L = 10 *
diag(ncol(C)), a = 0.5, b = 0.01, cores = getOption("mc.cores", 1L),
chains = 4, iter = 50, warmup = floor(iter/2), thin = 1,
init = NULL, control = NULL, verbose = FALSE, num_level = 0)
compiled_banocc_model |
The compiled stan model (as with
|
C |
The dataset as a data frame or matrix. This should be N by P with N samples as the rows and P features as the columns. |
n |
The prior mean for m; vectors of length less than P (the number
of features/columns of |
L |
The prior variance-covariance for m (must be
positive-definite with dimension PxP where P=number of features/columns
in |
a |
The shape parameter of a gamma distribution (the prior on the shrinkage parameter lambda) |
b |
The rate parameter of a gamma distribution (the prior on the shrinkage parameter lambda) |
cores |
Number of cores to use when executing the chains in parallel,
which defaults to 1 but we recommend setting the |
chains |
A positive integer specifying the number of Markov chains. The default is 4. |
iter |
A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000. |
warmup |
A positive integer specifying the number of warmup (aka burnin)
iterations per chain. If step-size adaptation is on (which it is by default),
this also controls the number of iterations for which adaptation is run (and
hence these warmup samples should not be used for inference). The number of
warmup iterations should not be larger than |
thin |
A positive integer specifying the period for saving samples. The default is 1, which is usually the recommended value. |
init |
The initial values as a list (see
|
control |
A named |
verbose |
Print informative statements as the function executes? |
num_level |
The number of indentations to add to the output when
|
Returns a named list with the following elements:
The data formatted as a named list that includes the
input data (C
) and the prior parameters (n
, L
,
a
, b
)
The stanfit
object returned by the call to
sampling
vignette("banocc-vignette")
for more examples.
data(compositions_null)
## Not run:
compiled_banocc_model <- rstan::stan_model(model_code=banocc_model)
b_stanfit <- run_banocc(C=compositions_null,
compiled_banocc_model=compiled_banocc_model)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.