data/datapack_psnu_area_level.RData
so that SWZ is modelled at the Tinkundla (level 2), rather than Region (level 1) area level.data/datapack_psnu_area_level.RData
so that MOZ is modelled at area level 3, rather than area level 2. threemc_fill_downup_populations
, to allow for forecasts past 2021.on.Load.R
function to set spdep::set.ZeroPolicyOption(TRUE)
. This avoids error whereby shapefiles with areas with no neighbours (e.g. islands) do not result in errors. threemc_ppc2
function to implement method from Matt's paper for
posterior predictive checks, gives better results than threemc_ppc
,
particularly for MC coverage. The function code itself still requires
tidying up. 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. naomi
), by adding necessary
R and C functions from naomi
and TMB
to the package. README.md
(mostly just as a reminder to
myself!)threemc_ppc
. Weighted mean is calculated using circ_status
and
indweight
. However, this ignores circ_type
. For type %in% c("MMC", "TMC")
,
need to have circ_status == 0
for all circ_type == "Missing"
. This does not
apply to type == "MC"
, as we do not need to know circ_type
to still count it
amongst MC
circumcisions.create_shell_dataset
, replace missing populations for less granular areas
with their respective child areas' populations. k_dt_time
argument of threemc_prepare_model_data
.create_shell_dataset
; this update decouples this behaviour from this function
into a separate internal function fill_downup_populations
, and this
functionality has been added to threemc_aggregate
as well. threemc_ppc
rewritten in data.table
for significant speed and memory
efficicency increase.threemc_fit_model
as default.threemc_fit_model
choose mod
itself based on parameters in
either parameters
(for new fits) or fit$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 variable mod
to a quite
"esoteric" model name, such as "Surv_SpaceAgeTime_ByType_withUnknownType_RW2".
Instead, the user can simply specify the much more intuitive parameters
rw_order
and include_tmc
to threemc_prepare_model_data
, simplifying their
experience.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
the custom_init
argument using a named list of parameter values.prepare_survey_data
, fill NA
populations for earlier years than we
have data for with the earliest known value for each age
and area_id
. prepare_survey_data
whereby surveys not at maximum area
level have their area_id
columns coerced to NA, when reassiging
survey area_level
to the specified argument area_level
.inc_time_tmc
argument to threemc_prepare_model_data
to
produce X_time_tmc
so we can use these non-constant TMC models. threemc_oos_pcc
) to perform posterior predictive checks
with OOS survey estimates, for model validation and comparison. 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. rw_order
argument to threemc_prepare_model_data
, which allows
one to specify a Random Walk temporal process for our temporal prior.
Leaving rw_order = NULL
uses the default AR 1 temporal prior.aggregate_sample_age_group
with method which uses
left_join
, ~4x faster for SWZ, likely scales much better for larger countries. NEWS.md
file to track changes to the package.dplyr::any_of()
, dplyr::contains()
) from survey data
set construction.space
index in the survey data set; only add when merging
survey data to the model frame.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.