Description Usage Arguments Value See Also Examples
Create a biips model object described in BUGS language.
1 2 | biips_model(file, data = parent.frame(), sample_data = TRUE,
quiet = FALSE, seed = get_seed())
|
file |
string. path of the BUGS file which defines the stochastic
model. Alternatively, |
data |
either a list or environment containing constants and
observed values or a character vector containing names of variables
existing in the workspace. Any numeric objects in |
sample_data |
logical. Toggle the evaluation of the 'data' block of
the BUGS model that generates or transforms data. (default = |
quiet |
logical. Deactivate verbosity. (default = |
seed |
int. RNG seed used for data generation if |
An object of class biips
which can be used to generate samples
from the posterior distribution of the parameters.
An object of class biips
is a list of functions that share a common
environment. The functions can be used to query information on the model.
ptr() |
Get an external pointer to the compiled model object. |
file() |
Get a string. filename of the BUGS model. |
data() |
Get a named list of the original data of the model. |
model() |
Get a character vector. BUGS language definition of the model. |
recompile() |
Recompile the model using the original data set. |
biips_variable_names
, biips_nodes
,
biips_print_dot
, biips_add_function
,
biips_add_distribution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | modelfile <- system.file('extdata', 'hmm.bug', package = 'rbiips')
stopifnot(nchar(modelfile) > 0)
cat(readLines(modelfile), sep = '\n')
data <- list(tmax = 10, p = c(.5, .5), logtau_true = log(1), logtau = log(1))
model <- biips_model(modelfile, data, sample_data = TRUE)
## Not run:
tmax <- 10
p <- c(.5, .5)
logtau_true <- log(1)
logtau <- logtau_true
datanames <- c('tmax', 'p', 'logtau_true', 'logtau')
model <- biips_model(modelfile, datanames, sample_data = TRUE)
## End(Not run)
is.biips(model)
print(model)
model$data()
variable.names(model)
biips_variable_names(model)
biips_nodes(model)
## Not run:
dotfile <- 'hmm.dot'
biips_print_dot(model, dotfile)
cat(readLines(dotfile), sep = '\n')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.