Extracts either time-varying or time-invariant parameters of the model.
Arguments
- object
[
dynamitefit]
The model fit object.- types
[
character()]
Type(s) of the parameters for which the samples should be extracted. See details of possible values. Default is all values listed in details except spline coefficientsomega. This argument is mutually exclusive withparameters.- parameters
[
character()]
Parameter(s) for which the samples should be extracted. Possible options can be found with functionget_parameter_names(). Default is all parameters of specific type for all responses. This argument is mutually exclusive withtypes.- responses
[
character()]
Response(s) for which the samples should be extracted. Possible options are elements ofunique(x$priors$response), and the default is this entire vector. Ignored if the argumentparametersis supplied.omega_alpha, andomega_psi. See alsoget_parameter_types().- times
[
double()]
Time point(s) to keep. IfNULL(the default), all time points are kept.- groups
[
character()]
Group name(s) to keep. IfNULL(the default), all groups are kept.- summary
[
logical(1)]
IfTRUE(default), returns posterior mean, standard deviation, and posterior quantiles (as defined by theprobsargument) for all parameters. IfFALSE, returns the posterior samples instead.- probs
[
numeric()]
Quantiles of interest. Default isc(0.05, 0.95).- ...
Ignored.
Value
A tibble containing either samples or summary statistics of the
model parameters in a long format.
See also
Model outputs
as.data.frame.dynamitefit(),
as.data.table.dynamitefit(),
as_draws_df.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
betas <- coef(gaussian_example_fit, type = "beta")
deltas <- coef(gaussian_example_fit, type = "delta")
