Description Usage Arguments Value See Also Examples
A biips
object is returned by function biips_model
. It
represents a Bayesian graphical model described in BUGS language.
The method biips_build_sampler
assigns a sampler to each node
of the graph. In order to specify the proposal used by the SMC
algorithm, this function has to be called before biips_smc_samples
.
Otherwise, it will be automatically called by biips_smc_samples
with the default parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | is.biips(object)
## S3 method for class 'biips'
print(x, ...)
## S3 method for class 'biips'
biips_variable_names(object, ...)
## S3 method for class 'biips'
variable.names(object, ...)
## S3 method for class 'biips'
biips_nodes(object, type, observed, ...)
## S3 method for class 'biips'
biips_print_dot(object, file, ...)
## S3 method for class 'biips'
biips_build_sampler(object, proposal = "auto", ...)
|
object, x |
|
... |
Additional arguments to be passed to default methods. |
type |
string. Return only a specific type of node. Possible values
are |
observed |
logical. Return only observed or unobserved nodes. Default returns all. |
file |
string. Path of the output file. |
proposal |
string. The type of proposal used by the SMC algorithm.
Possible values are |
The function is.biips
returns TRUE
if the object is of
class biips
.
The method biips_variable_names
returns a character vector.
Names of node arrays used in the model.
The method variable.names
is an alias for
biips_variable_names
.
The method biips_nodes
returns a data.frame
with a row
for each node of the graphical model sorted in a topological order with the
following columns:
id |
integer. node ids. |
name |
string. node names. |
type |
string. node types ( |
observed |
logical. |
discrete |
logical. |
If the function is called after the sampler is built (by calling
biips_build_sampler
or biips_smc_samples
), it
will also contain the additional variables:
iteration |
integer. node sampling iteration of unobserved nodes,
starting at 0. |
sampler |
string. node sampler name for stochastic unobserved nodes. An empty string for other types of nodes. |
The method biips_print_dot
prints the graph in a file in dot
format.
The method biips_build_sampler
returns NULL
.
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 35 36 37 38 | 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)
#\dontrun{
#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)
#}
is.biips(model)
print(model)
model$data()
variable.names(model)
biips_variable_names(model)
biips_nodes(model)
#\dontrun{
#dotfile <- 'hmm.dot'
#biips_print_dot(model, dotfile)
#cat(readLines(dotfile), sep = '\n')
#}
biips_build_sampler(model, proposal = 'prior')
biips_nodes(model, type = 'stoch', observed = FALSE)
biips_build_sampler(model, proposal = 'auto')
biips_nodes(model, type = 'stoch', observed = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.