diff --git a/EpiAware/src/EpiLatentModels/broadcast/helpers.jl b/EpiAware/src/EpiLatentModels/broadcast/helpers.jl index c5f64f7f9..3fe684cff 100644 --- a/EpiAware/src/EpiLatentModels/broadcast/helpers.jl +++ b/EpiAware/src/EpiLatentModels/broadcast/helpers.jl @@ -3,12 +3,15 @@ Constructs a `BroadcastLatentModel` appropriate for modelling the day of the wee # Arguments - `model::AbstractTuringLatentModel`: The latent model to be repeated. +- `link::Function`: The link function to transform the latent model _before_ broadcasting +to periodic weekly. Default is `x -> 7 * softmax(x)` which implements constraint +of the sum week effects to be 7. # Returns - `BroadcastLatentModel`: The broadcast latent model. " -function broadcast_dayofweek(model::AbstractTuringLatentModel) - transformed_model = TransformLatentModel(model, x -> 7 * softmax(x)) +function broadcast_dayofweek(model::AbstractTuringLatentModel; link = x -> 7 * softmax(x)) + transformed_model = TransformLatentModel(model, link) return BroadcastLatentModel(transformed_model, 7, RepeatEach()) end