
Validate day of week effect against the observation model week length
Source:R/checks.R
check_day_of_week_effect.Rdcheck_day_of_week_effect() checks that a user-supplied day of week effect
has as many elements as the reporting week length implied by the
observation model (see obs_opts()), i.e. week_length if week_effect
is TRUE and 1 otherwise. The two are required to match because the day
of week effect is passed to stan as a simplex of that length; a mismatch
is otherwise silently resolved by recycling, which reassigns the weights
to different days than the user intended.
Arguments
- day_of_week_effect
Either
NULL(no day of the week effect specified by the user) or a numeric vector.- week_effect
Integer; the reporting week length expected by the observation model, as returned in the
week_effectelement ofcreate_obs_model().