Skip to content

Commit

Permalink
Updated MCMC
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithJF82 committed Oct 16, 2023
1 parent 6c41922 commit 432a4c9
Show file tree
Hide file tree
Showing 13 changed files with 845 additions and 1,239 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export(Generate_Multiple_Datasets)
export(Generate_Sero_Dataset)
export(Generate_VIMC_Burden_Dataset)
export(MCMC)
export(MCMC2)
export(Model_Run)
export(Model_Run_Many_Reps)
export(Model_Run_Multi_Input)
Expand All @@ -22,7 +21,6 @@ export(input_data_truncate)
export(mcmc_FOI_R0_setup)
export(mcmc_checks)
export(mcmc_prelim_fit)
export(mcmc_prelim_fit2)
export(param_calc_enviro)
export(param_prop_setup)
export(parameter_setup)
Expand All @@ -31,7 +29,6 @@ export(sero_calculate)
export(sero_calculate2)
export(sero_data_compare)
export(single_posterior_calc)
export(single_posterior_calc2)
export(template_region_xref)
import(dde)
import(odin.dust)
Expand Down
10 changes: 5 additions & 5 deletions R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,18 @@ parameter_setup <- function(FOI_spillover=0.0,R0=1.0,vacc_data=list(),pop_data=l
#' @param input_data List of population and vaccination data for multiple regions (created using data input creation
#' code and usually loaded from RDS file)
#' @param enviro_data Environmental data frame, containing only relevant environmental variables
#' @param extra_params Vector of strings listing parameters besides ones determining FOI/R0 (may include vaccine
#' efficacy and/or infection/death reporting probabilities)
#' @param extra_estimated_params Vector of strings listing variable parameters besides ones determining FOI/R0 (may include
#' vaccine efficacy and/or infection/death reporting probabilities and/or Brazil FOI adjustment factor)
#'
#' @export
#'
create_param_labels <- function(type="FOI",input_data=list(),enviro_data=NULL,extra_params=c("vacc_eff")){
create_param_labels <- function(type="FOI",input_data=list(),enviro_data=NULL,extra_estimated_params=c("vacc_eff")){

assert_that(type %in% c("FOI","FOI+R0","FOI enviro","FOI+R0 enviro"))
assert_that(input_data_check(input_data),msg=paste("Input data must be in standard format",
" (see https://mrc-ide.github.io/YEP/articles/CGuideAInputs.html)"))

n_extra=length(extra_params)
n_extra=length(extra_estimated_params)

if(type %in% c("FOI","FOI+R0")){
regions=input_data$region_labels
Expand All @@ -595,7 +595,7 @@ create_param_labels <- function(type="FOI",input_data=list(),enviro_data=NULL,ex
if(type=="FOI+R0 enviro"){param_names[i+n_env_vars]=paste("R0_",env_vars[i],sep="")}
}
}
if(n_extra>0){param_names[(n_params-n_extra+1):n_params]=extra_params}
if(n_extra>0){param_names[(n_params-n_extra+1):n_params]=extra_estimated_params}

return(param_names)
}
Expand Down
473 changes: 183 additions & 290 deletions R/mcmc.R

Large diffs are not rendered by default.

Loading

0 comments on commit 432a4c9

Please sign in to comment.