as_draws_df.dynamitefit {dynamite} | R Documentation |
Convert dynamite
Output to draws_df
Format
Description
Converts the output from a dynamite()
call to a
draws_df
format of the posterior package, enabling the use
of diagnostics and plotting methods of posterior and bayesplot
packages. Note that this function returns variables in a wide format,
whereas as.data.frame()
uses the long format.
Usage
## S3 method for class 'dynamitefit'
as_draws_df(
x,
parameters = NULL,
responses = NULL,
types = NULL,
times = NULL,
groups = NULL,
...
)
## S3 method for class 'dynamitefit'
as_draws(x, parameters = NULL, responses = NULL, types = NULL, ...)
Arguments
x |
[ |
parameters |
[ |
responses |
[ |
types |
[ |
times |
[ |
groups |
[ |
... |
Ignored. |
Details
You can use the arguments parameters
, responses
and types
to extract
only a subset of the model parameters (i.e., only certain types of
parameters related to a certain response variable).
See potential values for the types argument in
as.data.frame.dynamitefit()
and
get_parameter_names()
for potential values for parameters
argument.
Value
A draws_df
object.
A draws_df
object.
See Also
Model outputs
as.data.frame.dynamitefit()
,
as.data.table.dynamitefit()
,
coef.dynamitefit()
,
confint.dynamitefit()
,
dynamite()
,
get_code()
,
get_data()
,
get_parameter_dims()
,
get_parameter_names()
,
get_parameter_types()
,
ndraws.dynamitefit()
,
nobs.dynamitefit()
Examples
data.table::setDTthreads(1) # For CRAN
as_draws(gaussian_example_fit, types = c("sigma", "beta"))
# Compute MCMC diagnostics using the posterior package
posterior::summarise_draws(as_draws(gaussian_example_fit))