| plot.RprobitB_fit | R Documentation |
Creates a standard posterior diagnostic or uncertainty plot with bayesplot, or draws the estimated mixing distributions of the random effects.
## S3 method for class 'RprobitB_fit'
plot(
x,
y = NULL,
type = c("trace", "rank", "acf", "density", "interval", "pairs", "mixture"),
variables = NULL,
...
)
x |
[ |
y |
[ |
type |
[
|
variables |
[ |
... |
Further arguments passed to the selected
bayesplot function. Not used for
|
A ggplot object or, for a pairs plot, a bayesplot_grid object.
set.seed(1)
model <- fit(
choice ~ x + z | 0, dgp_parameters = list(beta = c(x = 1, z = -0.5)),
chains = 2
)
### convergence and mixing of the chains
plot(model, type = "trace")
plot(model, type = "rank")
plot(model, type = "acf")
### marginal and joint posterior distributions
plot(model, type = "density")
plot(model, type = "interval")
plot(model, type = "pairs")
### estimated mixing distribution of a random coefficient
mixed <- fit(
choice ~ x | 0, random_effects = "x",
dgp_parameters = list(beta = c(x = 1), Omega = matrix(0.5)),
chains = 1, n_occasions = 10
)
plot(mixed, type = "mixture")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.