Extracts the names and dimensions of all parameters used in the
dynamite
model. See also get_parameter_types()
and
get_parameter_names()
. The returned dimensions match those of
the stanfit
element of the dynamitefit
object. When applied to
dynamiteformula
objects, the model is compiled and sampled for 1 iteration
to get the parameter dimensions.
Usage
get_parameter_dims(x, ...)
# S3 method for class 'dynamiteformula'
get_parameter_dims(x, data, time, group = NULL, ...)
# S3 method for class 'dynamitefit'
get_parameter_dims(x, ...)
Arguments
- x
[
dynamiteformula
ordynamitefit
]
The model formula or an existingdynamitefit
object. Seedynamiteformula()
anddynamite()
.- ...
Ignored.
- data
[
data.frame
,tibble::tibble
, ordata.table::data.table
]
The data that contains the variables in the model in long format. Supported column types areinteger
,logical
,double
, andfactor
. Columns of typecharacter
will be converted to factors. Unused factor levels will be dropped. Thedata
can contain missing values which will simply be ignored in the estimation in a case-wise fashion (per time-point and per channel). Inputdata
is converted to channel specific matrix representations viastats::model.matrix.lm()
.- time
[
character(1)
]
A column name ofdata
that denotes the time index of observations. If this variable is a factor, the integer representation of its levels are used internally for defining the time indexing.- group
[
character(1)
]
A column name ofdata
that denotes the unique groups orNULL
corresponding to a scenario without any groups. Ifgroup
isNULL
, a new column.group
is created with constant value1L
is created indicating that all observations belong to the same group. In case of name conflicts withdata
, see thegroup_var
element of the return object to get the column name of the new variable.
See also
Model outputs
as.data.frame.dynamitefit()
,
as.data.table.dynamitefit()
,
as_draws_df.dynamitefit()
,
coef.dynamitefit()
,
confint.dynamitefit()
,
dynamite()
,
get_code()
,
get_data()
,
get_parameter_names()
,
get_parameter_types()
,
ndraws.dynamitefit()
,
nobs.dynamitefit()
Examples
data.table::setDTthreads(1) # For CRAN
get_parameter_dims(multichannel_example_fit)
#> $beta_g
#> [1] 2
#>
#> $a_g
#> [1] 1
#>
#> $sigma_g
#> [1] 1
#>
#> $beta_p
#> [1] 3
#>
#> $a_p
#> [1] 1
#>
#> $beta_b
#> [1] 5
#>
#> $a_b
#> [1] 1
#>