
Create Smoothing Structure Specification with Priors
Source:R/smoothing_dispersion_structure.r
smoothing_structure.RdThis function creates a standardized smoothing structure object that specifies
both the smoothing structure and associated priors for EpiStrainDynamics models.
tau (denoted \(\rho\) in Eales et al. 2022, Epidemics) is the
smoothing parameter that penalises how much the underlying trend's growth
rate is allowed to change over time. Smaller values enforce a smoother
trend; larger values allow it to bend more sharply.
Arguments
- smoothing_type
Character string specifying the smoothing type:
"shared": All pathogens have the same smoothing parameter (equivalent totau[1]). By default a model with a single pathogen will havesharedsmoothing type."independent": Independent smoothing per pathogen (equivalent totau[number of pathogens])"correlated": Correlated smoothing type (equivalent toSigma[number of pathogens, number of pathogens])
- tau_mean
Optional numeric vector specifying the prior mean(s) for tau parameter. Can be provided for
shared(single value) andindependentsmoothing types (can provide a single value which will be repeated for each pathogen or can provide a unique prior for each pathogen). Prior for tau forcorrelatedsmoothing type is not currently supported.- tau_sd
Numeric vector specifying the prior standard deviation(s) for tau parameter. Can be provided for
shared(single value) andindependentsmoothing types (can provide a single value which will be repeated for each pathogen or can provide a unique prior for each pathogen). Prior for tau forcorrelatedsmoothing type is not currently supported.
Value
An object of class EpiStrainDynamics.smoothing containing:
- smoothing_type
The specified smoothing structure type
- tau_priors
Prior specifications for tau
- priors_provided
Integer flag passed to the Stan model:
1if no priors were supplied (Stan's built-in default prior is used),2if priors were supplied (thetau_mean/tau_sdvalues are used as the prior)