Extracts either time-varying or time-invariant parameters of the model.
Arguments
- object
[
dynamitefit
]
The model fit object.- 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.- type
[
character(1)
]
Eitherbeta
(the default) for time-invariant coefficients,delta
for time-varying coefficients,nu
for random effects,lambda
for factor loadings, orpsi
for latent factor. Ignored if the argumentparameters
is supplied.- 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 argumentparameters
is supplied.- summary
[
logical(1)
]
IfTRUE
, returns posterior mean, standard deviation, and posterior quantiles (as defined by theprobs
argument) for all parameters. IfFALSE
(default), returns the posterior samples instead.- probs
[
numeric()
]
Quantiles of interest. Default isc(0.05, 0.95)
.- include_alpha
[
logical(1)
]
IfTRUE
(default), extracts also time-invariant intercept term alpha if time-invariant parameters beta are extracted, and time-varying alpha if time-varying delta are extracted. Ignored if the argumentparameters
is supplied. @param summary [logical(1)
]
IfTRUE
(default), returns posterior mean, standard deviation, and posterior quantiles (as defined by theprobs
argument) for all parameters. IfFALSE
, returns the posterior samples instead.- ...
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")