Create a greta_model object representing a statistical
model (using model), and plot a graphical representation of the
model. Statistical inference can be performed on greta_model objects
with mcmc()
Arguments
- ...
for
model:greta_arrayobjects to be tracked by the model (i.e. those for which samples will be retained during mcmc). If not provided, all of the non-datagreta_arrayobjects defined in the calling environment will be tracked. Forprintandplot:further arguments passed to or from other methods (currently ignored).- precision
the floating point precision to use when evaluating this model. Switching from
"double"(the default) to"single"may decrease the computation time but increase the risk of numerical instability during sampling.- compile
whether to apply XLA JIT compilation to the TensorFlow graph representing the model. This may slow down model definition, and speed up model evaluation.
- x
a
greta_modelobject- y
unused default argument
- colour
base colour used for plotting. Defaults to
gretacolours in violet.
Value
model - a greta_model object.
plot - a DiagrammeR::grViz()
object, with the
DiagrammeR::dgr_graph() object used to
create it as an attribute "dgr_graph".
Details
model() takes greta arrays as arguments, and defines a
statistical model by finding all of the other greta arrays on which they
depend, or which depend on them. Further arguments to model can be
used to configure the TensorFlow graph representing the model, to tweak
performance.
The plot method produces a visual representation of the defined
model. It uses the DiagrammeR package, which must be installed
first. Here's a key to the plots:

