- Update
data/datapack_psnu_area_level.RData
so that SWZ is modelled at the Tinkundla (level 2), rather than Region (level 1) area level. - Update
data/datapack_psnu_area_level.RData
so that MOZ is modelled at area level 3, rather than area level 2.
- Fill future as well as historical populations in and
threemc_fill_downup_populations
, to allow for forecasts past 2021.
- Add
on.Load.R
function to setspdep::set.ZeroPolicyOption(TRUE)
. This avoids error whereby shapefiles with areas with no neighbours (e.g. islands) do not result in errors.
- Add
threemc_ppc2
function to implement method from Matt's paper for posterior predictive checks, gives better results thanthreemc_ppc
, particularly for MC coverage. The function code itself still requires tidying up.
- Use
tmb.ad.framework = "TMBad"
, rather than the default "CppAD". This framework performs sparse hessian compression, which leads to significantly lower memory usage (particularly in the "spike" experienced at the "optimising tape..." optimisation stage) during model fit.
- Remove dependencies on non-CRAN packages (i.e.
naomi
), by adding necessary R and C functions fromnaomi
andTMB
to the package.
- Add extensive developer notes to
README.md
(mostly just as a reminder to myself!)
- Fix bug in
threemc_ppc
. Weighted mean is calculated usingcirc_status
andindweight
. However, this ignorescirc_type
. Fortype %in% c("MMC", "TMC")
, need to havecirc_status == 0
for allcirc_type == "Missing"
. This does not apply totype == "MC"
, as we do not need to knowcirc_type
to still count it amongstMC
circumcisions.
- In
create_shell_dataset
, replace missing populations for less granular areas with their respective child areas' populations.
- Add optional penalised time spline, by specifying a non-null value for the
k_dt_time
argument ofthreemc_prepare_model_data
.
- Adds models ("Surv_SpaceAgeTime_ByType_withUnknownType_RW_MMC2" and "Surv_SpaceAgeTime_ByType_withUnknownType_Const_Paed_MMC_RW_MMC2") which use a random walk temporal prior for MMC, but an AR 1 temporal prior for TMC.
- Version 0.1.27 introduced filling in missing population data in
create_shell_dataset
; this update decouples this behaviour from this function into a separate internal functionfill_downup_populations
, and this functionality has been added tothreemc_aggregate
as well.
threemc_ppc
rewritten indata.table
for significant speed and memory efficicency increase.
- Add initial introductory vignette.
- Add TMB model for every iteration of:
- Including a time effect for TMC or not,
- Including a constant peadiatric MMC rate or not, and
- Using a random walk, rather than AR 1 prior Urgent need to functionalise all of this to greatly decrease code complexity and package compilation time.
- Have verbose output on function progress from
threemc_fit_model
as default.
- Can have
threemc_fit_model
choosemod
itself based on parameters in eitherparameters
(for new fits) orfit$par
(for re-sampling from fits). Like 0.1.28, this update abstracts model specification from the end user, which involves generally involves setting a global variablemod
to a quite "esoteric" model name, such as "Surv_SpaceAgeTime_ByType_withUnknownType_RW2". Instead, the user can simply specify the much more intuitive parametersrw_order
andinclude_tmc
tothreemc_prepare_model_data
, simplifying their experience.
- new function
threemc_initial_pars
to abstract initial hyperparameter specification from the end user. In scripts, this section is quite long and ugly and in general can often go wrong due to parameter order etc, so it is best to abstract this functionality. Defaults can still be overridden (e.g. when we want to fit a model with "mapped"/fixed hyperparameters) by specifying thecustom_init
argument using a named list of parameter values.
- In
prepare_survey_data
, fillNA
populations for earlier years than we have data for with the earliest known value for eachage
andarea_id
.
- Fix bug in
prepare_survey_data
whereby surveys not at maximum area level have theirarea_id
columns coerced to NA, when reassiging surveyarea_level
to the specified argumentarea_level
.
- Add models which include a random effect for time for traditional male circumcision.
- Add
inc_time_tmc
argument tothreemc_prepare_model_data
to produceX_time_tmc
so we can use these non-constant TMC models.
- Add function (
threemc_oos_pcc
) to perform posterior predictive checks with OOS survey estimates, for model validation and comparison.
- Add function (
survey_points_dmmpt2_convert_convention
) which can be used to change the age group, circumcision type and column naming conventions used in DMMPT2 and empirical survey circumcision estimates to match those used in threemc aggregations.
- Add
rw_order
argument tothreemc_prepare_model_data
, which allows one to specify a Random Walk temporal process for our temporal prior. Leavingrw_order = NULL
uses the default AR 1 temporal prior.
- Replace loop in
aggregate_sample_age_group
with method which usesleft_join
, ~4x faster for SWZ, likely scales much better for larger countries.
- Conditionals added to produce design matrices when modelling at the country level, where the adjacency matrix will just be a 1x1 matrix with entry 0.
- Added a
NEWS.md
file to track changes to the package. - Change title: (Matt's) Multi-Level Model of Male Circumcision in Sub-Saharan Africa
- Remove wildcard matching (
dplyr::any_of()
,dplyr::contains()
) from survey data set construction. - Don't reference the
space
index in the survey data set; only add when merging survey data to the model frame.