Create a trend specification for model parameters
Usage
make_trend(
par_names,
cov_names,
kernels,
bases = NULL,
shared = NULL,
trend_pnames = NULL,
premap = TRUE,
pretransform = FALSE
)
Arguments
- par_names
Character vector specifying which parameters to apply trend to
- cov_names
Character vector specifying which covariates to use for each trend
- kernels
Character vector specifying which kernel function to use for each trend
- bases
Optional character vector specifying which base function to use for each trend
Named list with entries the parameter names to be shared and the names the new names of the shared parameter.
- trend_pnames
Optional character vector specifying custom parameter names
- premap
Logical indicating if trend should be applied before or after parameter mapping
- pretransform
If !premap, logical indicating if trend should be applied before or after parameter transformation
Examples
# Put trend on B and v parameters
trend <- make_trend(
par_names = c("B", "v"),
cov_names = "strial",
kernels = c("exp_incr", "poly3"),
premap = TRUE,
shared = list(shrd = list("B.B0", "v.d1"))
)
get_trend_pnames(trend)
#> [1] "shrd" "B.d_ei" "v.d2" "v.d3"