plot.dynamiteformula {dynamite} | R Documentation |
Plot the Model Structure as a Directed Acyclic Graph (DAG)
Description
Plot a snapshot of the model structure at a specific time point with a window of the highest-order lag dependency both into the past and the future as a directed acyclic graph (DAG). Only response variables are shown in the plot. This function can also produce a TikZ code of the DAG to be used in reports and publications.
Usage
## S3 method for class 'dynamiteformula'
plot(
x,
show_auxiliary = TRUE,
show_covariates = FALSE,
tikz = FALSE,
vertex_size = 0.25,
label_size = 18,
...
)
Arguments
x |
[ |
show_auxiliary |
[ |
show_covariates |
[ |
tikz |
[ |
vertex_size |
[ |
label_size |
[ |
... |
Not used.. |
Value
A ggplot
object, or a character
string if tikz = TRUE
.
See Also
Drawing plots
plot.dynamitefit()
Examples
data.table::setDTthreads(1) # For CRAN
multichannel_formula <- obs(g ~ lag(g) + lag(logp), family = "gaussian") +
obs(p ~ lag(g) + lag(logp) + lag(b), family = "poisson") +
obs(b ~ lag(b) * lag(logp) + lag(b) * lag(g), family = "bernoulli") +
aux(numeric(logp) ~ log(p + 1))
# A ggplot
plot(multichannel_formula)
# TikZ format
plot(multichannel_formula, tikz = TRUE)