Description Usage Arguments Value
View source: R/posterior_calc.R
A generic and some methods for creating posterior calculations.
The intended use is to prepare data for use with bayesplot ppc plots.
The default method works for any object for which posterior()
can
create a data frame of posterior samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | posterior_calc(object, ...)
## Default S3 method:
posterior_calc(
object,
formula,
data = NULL,
draws = NULL,
data.frame = FALSE,
...
)
## S3 method for class 'data.frame'
posterior_calc(
object,
formula,
data = NULL,
draws = NULL,
data.frame = FALSE,
...
)
|
object |
An object from which posterior calculations are made. |
... |
Additional arguments, currently ignored. |
formula |
A formula describing the quantity to be calculated. The rhs of the
formula is evaluated using one posterior sample of the parameters and |
data |
Additional data involved in the computation. This may be the original data used to fit the model or counter-factual data. |
draws |
The number of draws to make from the posterior distribution.
Sampling is with replacement if |
data.frame |
A logical indicating whtehr the results should be returned as a data frame (TRUE) or a matrix (FALSE). |
A matrix with draws
rows or data frame with three columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.