From cb2917d89d4377fd1abeabb62df0a0abe1ee979a Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Tue, 11 Mar 2025 16:09:12 +0700 Subject: [PATCH 01/17] Updating log_x_10 for density plots. Outputting single plot if only one is called. --- R/plot_jags_densitydx.R | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/R/plot_jags_densitydx.R b/R/plot_jags_densitydx.R index 929c8bcb7..71a5f6bc6 100644 --- a/R/plot_jags_densitydx.R +++ b/R/plot_jags_densitydx.R @@ -77,18 +77,23 @@ plot_jags_dens <- function(data, # Changing parameter name to reflect the input dplyr::mutate(Parameter = paste0("iso = ", j, ", parameter = ", .data$Parameter_sub, ", strat = ", - i), - value = log(.data$value)) + i)) # Assigning attributes, which are needed to run ggs_density attributes(visualize_jags_plot) <- c(attributes(visualize_jags_plot), attributes_jags) # Creating density plot densplot <- ggmcmc::ggs_density(visualize_jags_plot) + ggplot2::theme_bw() + - ggplot2::labs(x = "log(value)") + ggplot2::labs(x = "log(value)") + + ggplot2::scale_x_log10() density_out[[j]] <- densplot } + dens_strat_list[[i]] <- density_out } + #Printing only one plot if only one exists. + if (length(dens_strat_list) == 1) { + dens_strat_list <- dens_strat_list[[1]][[iso]] + } dens_strat_list } From 7ba594ab48bd59c0347d3ec265b3079353429904 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Tue, 11 Mar 2025 16:13:19 +0700 Subject: [PATCH 02/17] Updating test file for plot_jags_dens --- .../plot_jags_densitydx/typhoid-plot.svg | 291 +++++++++--------- 1 file changed, 139 insertions(+), 152 deletions(-) diff --git a/tests/testthat/_snaps/plot_jags_densitydx/typhoid-plot.svg b/tests/testthat/_snaps/plot_jags_densitydx/typhoid-plot.svg index d5157635a..6e97437ab 100644 --- a/tests/testthat/_snaps/plot_jags_densitydx/typhoid-plot.svg +++ b/tests/testthat/_snaps/plot_jags_densitydx/typhoid-plot.svg @@ -27,21 +27,20 @@ - - - - - - - - + + + + + + + - - - - - - + + + + + + @@ -57,18 +56,20 @@ - - - - - - + + + + + + + - - - - - + + + + + + @@ -84,24 +85,25 @@ - - - - - - - - - + + + + + + + + + + - - - + + + + - - - - + + + @@ -117,28 +119,21 @@ - - - - - - - - - - - + + + + + + + - - - - - - + + + - - - + + + @@ -154,24 +149,22 @@ - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + @@ -235,89 +228,83 @@ - - - -0 -3 -6 -9 - + + + + +1 +10 +100 +1000 +10000 + - - - --1 -0 -1 -2 -3 + + + +0.3 +1.0 +3.0 +10.0 +30.0 - - - - -0 -1 -2 -3 -4 - - -0.5 -1.0 - - - --8 --6 --4 -0.0 -0.1 -0.2 -0.3 + + + +1 +3 +10 +30 + + + +2 +3 +4 + + + +1e-04 +1e-03 +1e-02 +0.00 +0.25 +0.50 +0.75 - - - + + + 0 -1 -2 -3 +2 +4 +6 - - - -0.00 -0.25 -0.50 -0.75 + + + +0.0 +0.5 +1.0 +1.5 +2.0 - - - -0.00 -0.25 -0.50 -0.75 -1.00 -1.25 + + + + +0 +1 +2 - - - - - -0.00 -0.05 -0.10 -0.15 -0.20 + + +0.0 +0.2 +0.4 - - - - + + log(value) density From f3a37040fefd832f3f88560be2006abc6636fc24 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Tue, 11 Mar 2025 16:18:09 +0700 Subject: [PATCH 03/17] Putting example in own folder. Updating log_x_10. Outputting one plot if only one called. --- R/plot_jags_densitydx.R | 21 ++------------------ inst/examples/examples-plot_jags_densitydx.R | 11 ++++++++++ 2 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 inst/examples/examples-plot_jags_densitydx.R diff --git a/R/plot_jags_densitydx.R b/R/plot_jags_densitydx.R index 71a5f6bc6..4047232a0 100644 --- a/R/plot_jags_densitydx.R +++ b/R/plot_jags_densitydx.R @@ -26,27 +26,10 @@ #' - `y1` = posterior estimate of peak antibody concentration #' @param strat Specify [character] string to produce plots of specific #' stratification entered in quotes. -#' @return A [base::list()] of [ggplot2::ggplot()] objects producing density +#' @return A [list] of [ggplot2::ggplot] objects producing density #' plots for all the specified input. #' @export -#' @examples -#' if (!is.element(runjags::findjags(), c("", NULL))) { -#' library(runjags) -#' library(ggmcmc) -#' library(dplyr) -#' set.seed(1) -#' -#' data <- serodynamics::nepal_sees_jags_post -#' -#' plot_jags_dens( -#' data = data, #A [serodynamics::run_mod()] [list] output. -#' iso = "HlyE_IgA", #A [character] string specifying -#' #nantigen/antibody of interest. -#' param = "alpha", #A [character] string specifying parameter of -#' # interest. -#' strat = "typhi") #A [character] string specifying -#' # stratification of interest. -#' } +#' @examples inst/examples/examples-plot_jags_densitydx.R plot_jags_dens <- function(data, iso = unique(data$curve_params$Iso_type), diff --git a/inst/examples/examples-plot_jags_densitydx.R b/inst/examples/examples-plot_jags_densitydx.R new file mode 100644 index 000000000..da9c7b9e7 --- /dev/null +++ b/inst/examples/examples-plot_jags_densitydx.R @@ -0,0 +1,11 @@ + +if (!is.element(runjags::findjags(), c("", NULL))) { + + data <- serodynamics::nepal_sees_jags_post + + plot_jags_dens( + data = data, + iso = "HlyE_IgA", + param = "alpha", + strat = "typhi") +} From af794339462e075b5c95d75c0639d0f022f5e6db Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Tue, 11 Mar 2025 20:13:56 +0700 Subject: [PATCH 04/17] Increment version number to 0.0.0.9021 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0386529fe..4ed34b475 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: serodynamics Title: What the Package Does (One Line, Title Case) -Version: 0.0.0.9020 +Version: 0.0.0.9021 Authors@R: c( person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"), comment = "Author of the method and original code."), From f826b93f85e03791129c6e94f181943dbb7a6bf2 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Tue, 11 Mar 2025 20:15:12 +0700 Subject: [PATCH 05/17] News and documentation --- NEWS.md | 1 + man/plot_jags_dens.Rd | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index ce4fc24a4..0f35555e3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ ## New features +* Updating density diagnostic function (#71) * Diagnostic function to produce density plots with stratification (#27) * Added SEES data set data folder and documentation (#41) * Fixing SEES data and added jags_post for SEES (#63) diff --git a/man/plot_jags_dens.Rd b/man/plot_jags_dens.Rd index 20b95951c..4f3bdca31 100644 --- a/man/plot_jags_dens.Rd +++ b/man/plot_jags_dens.Rd @@ -32,7 +32,7 @@ specific parameter, entered with quotes. Options include: stratification entered in quotes.} } \value{ -A \code{\link[base:list]{base::list()}} of \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}} objects producing density +A \link{list} of \link[ggplot2:ggplot]{ggplot2::ggplot} objects producing density plots for all the specified input. } \description{ @@ -51,22 +51,7 @@ The antibody dynamic curve includes the following parameters: } } \examples{ -if (!is.element(runjags::findjags(), c("", NULL))) { - library(runjags) - library(ggmcmc) - library(dplyr) - - data <- serodynamics::nepal_sees_jags_post - -plot_jags_dens( - data = data, #A [serodynamics::run_mod()] [list] output. - iso = "HlyE_IgA", #A [character] string specifying - #nantigen/antibody of interest. - param = "alpha", #A [character] string specifying parameter of - # interest. - strat = "typhi") #A [character] string specifying - # stratification of interest. - } +inst/examples/examples-plot_jags_densitydx.R } \author{ Sam Schildhauer From 69e9ac8da4ec137b8f74cb75fa465165c265323c Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Wed, 19 Mar 2025 13:24:37 -0700 Subject: [PATCH 06/17] Switching to singular @example --- R/plot_jags_densitydx.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_jags_densitydx.R b/R/plot_jags_densitydx.R index 4047232a0..498f222bb 100644 --- a/R/plot_jags_densitydx.R +++ b/R/plot_jags_densitydx.R @@ -29,7 +29,7 @@ #' @return A [list] of [ggplot2::ggplot] objects producing density #' plots for all the specified input. #' @export -#' @examples inst/examples/examples-plot_jags_densitydx.R +#' @example inst/examples/examples-plot_jags_densitydx.R plot_jags_dens <- function(data, iso = unique(data$curve_params$Iso_type), From 066cebb6ffc9f1746f26b32365ca24ec026f7282 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Wed, 19 Mar 2025 13:26:22 -0700 Subject: [PATCH 07/17] Updating example code --- inst/examples/examples-plot_jags_densitydx.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/inst/examples/examples-plot_jags_densitydx.R b/inst/examples/examples-plot_jags_densitydx.R index da9c7b9e7..572f53391 100644 --- a/inst/examples/examples-plot_jags_densitydx.R +++ b/inst/examples/examples-plot_jags_densitydx.R @@ -1,11 +1,7 @@ -if (!is.element(runjags::findjags(), c("", NULL))) { - data <- serodynamics::nepal_sees_jags_post plot_jags_dens( data = data, iso = "HlyE_IgA", - param = "alpha", strat = "typhi") -} From 4a574eca9fd99f7d3ba869ce8601a39f9373202b Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Wed, 19 Mar 2025 13:27:08 -0700 Subject: [PATCH 08/17] Changing x axis label --- R/plot_jags_densitydx.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_jags_densitydx.R b/R/plot_jags_densitydx.R index 498f222bb..448cf641c 100644 --- a/R/plot_jags_densitydx.R +++ b/R/plot_jags_densitydx.R @@ -67,7 +67,7 @@ plot_jags_dens <- function(data, # Creating density plot densplot <- ggmcmc::ggs_density(visualize_jags_plot) + ggplot2::theme_bw() + - ggplot2::labs(x = "log(value)") + + ggplot2::labs(x = "parameter value") + ggplot2::scale_x_log10() density_out[[j]] <- densplot } From 41b575290bba0d25b3d39de0b025c972122ec169 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Wed, 19 Mar 2025 13:32:46 -0700 Subject: [PATCH 09/17] Updating documentation and log_scale --- R/plot_jags_densitydx.R | 2 +- man/plot_jags_dens.Rd | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/plot_jags_densitydx.R b/R/plot_jags_densitydx.R index 448cf641c..cd8804ef5 100644 --- a/R/plot_jags_densitydx.R +++ b/R/plot_jags_densitydx.R @@ -68,7 +68,7 @@ plot_jags_dens <- function(data, densplot <- ggmcmc::ggs_density(visualize_jags_plot) + ggplot2::theme_bw() + ggplot2::labs(x = "parameter value") + - ggplot2::scale_x_log10() + ggplot2::scale_x_log10(labels = scales::label_comma()) density_out[[j]] <- densplot } diff --git a/man/plot_jags_dens.Rd b/man/plot_jags_dens.Rd index 4f3bdca31..de65d961e 100644 --- a/man/plot_jags_dens.Rd +++ b/man/plot_jags_dens.Rd @@ -51,7 +51,13 @@ The antibody dynamic curve includes the following parameters: } } \examples{ -inst/examples/examples-plot_jags_densitydx.R + + data <- serodynamics::nepal_sees_jags_post + + plot_jags_dens( + data = data, + iso = "HlyE_IgA", + strat = "typhi") } \author{ Sam Schildhauer From 45a6a966509c164fe9ea158227d8a4bb758d83d0 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 10:42:41 -0700 Subject: [PATCH 10/17] Merging example with main --- inst/examples/examples-plot_jags_densitydx.R | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/inst/examples/examples-plot_jags_densitydx.R b/inst/examples/examples-plot_jags_densitydx.R index 2a2022583..b5484d16e 100644 --- a/inst/examples/examples-plot_jags_densitydx.R +++ b/inst/examples/examples-plot_jags_densitydx.R @@ -1,17 +1,8 @@ -<<<<<<< HEAD - data <- serodynamics::nepal_sees_jags_post + + data <- serodynamics::nepal_sees_jags_output plot_jags_dens( data = data, iso = "HlyE_IgA", strat = "typhi") -======= -data <- serodynamics::nepal_sees_jags_output - -# Specifying isotype and stratification for traceplot. -plot_jags_dens( - data = data, - iso = "HlyE_IgA", - strat = "typhi") ->>>>>>> origin/main From ec6c4e0bd84a49259657d767ff1cf57192f2f9c3 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 11:11:35 -0700 Subject: [PATCH 11/17] Updating capitalization --- R/Run_Mod.R | 12 ++++++------ man/run_mod.Rd | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/Run_Mod.R b/R/Run_Mod.R index c35092cce..651ae6cd3 100644 --- a/R/Run_Mod.R +++ b/R/Run_Mod.R @@ -1,9 +1,9 @@ #' @title Run Jags Model #' @author Sam Schildhauer #' @description -#' run_mod() takes a data frame and adjustable mcmc inputs to -#' [runjags::run.jags()] as an mcmc -#' bayesian model to estimate antibody dynamic curve parameters. +#' run_mod() takes a data frame and adjustable MCMC inputs to +#' [runjags::run.jags()] as an MCMC +#' Bayesian model to estimate antibody dynamic curve parameters. #' The [rjags::jags.model()] models seroresponse dynamics to an #' infection. The antibody dynamic curve includes the following parameters: #' - y0 = baseline antibody concentration @@ -14,7 +14,7 @@ #' @param data A [base::data.frame()] with the following columns. #' @param file_mod The name of the file that contains model structure. #' @param nchain An [integer] between 1 and 4 that specifies -#' the number of mcmc chains to be run per jags model. +#' the number of MCMC chains to be run per jags model. #' @param nadapt An [integer] specifying the number of adaptations per chain. #' @param nburn An [integer] specifying the number of burn ins before sampling. #' @param nmc An [integer] specifying the number of samples in posterior chains. @@ -35,7 +35,7 @@ #' - A [base::data.frame()] titled `curve_params` that contains the posterior #' distribution will be exported with the following attributes: #' - `iteration` = number of sampling iterations -#' - `chain` = number of mcmc chains run; between 1 and 4 +#' - `chain` = number of MCMC chains run; between 1 and 4 #' - `indexid` = "newperson", indicating posterior distribution #' - `antigen_iso` = antibody/antigen type combination being evaluated #' - `alpha` = posterior estimate of decay rate @@ -127,7 +127,7 @@ run_mod <- function(data, # stratification and will only be included if specified. jags_post_final[[i]] <- jags_post - # Unpacking and cleaning mcmc output. + # Unpacking and cleaning MCMC output. jags_unpack <- ggmcmc::ggs(jags_post[["mcmc"]]) # Adding attributes diff --git a/man/run_mod.Rd b/man/run_mod.Rd index fce7003d2..96a27685a 100644 --- a/man/run_mod.Rd +++ b/man/run_mod.Rd @@ -23,7 +23,7 @@ run_mod( \item{file_mod}{The name of the file that contains model structure.} \item{nchain}{An \link{integer} between 1 and 4 that specifies -the number of mcmc chains to be run per jags model.} +the number of MCMC chains to be run per jags model.} \item{nadapt}{An \link{integer} specifying the number of adaptations per chain.} @@ -55,7 +55,7 @@ objects (one per stratum). distribution will be exported with the following attributes: \itemize{ \item \code{iteration} = number of sampling iterations -\item \code{chain} = number of mcmc chains run; between 1 and 4 +\item \code{chain} = number of MCMC chains run; between 1 and 4 \item \code{indexid} = "newperson", indicating posterior distribution \item \code{antigen_iso} = antibody/antigen type combination being evaluated \item \code{alpha} = posterior estimate of decay rate @@ -77,9 +77,9 @@ distribution will be exported with the following attributes: } } \description{ -run_mod() takes a data frame and adjustable mcmc inputs to -\code{\link[runjags:run.jags]{runjags::run.jags()}} as an mcmc -bayesian model to estimate antibody dynamic curve parameters. +run_mod() takes a data frame and adjustable MCMC inputs to +\code{\link[runjags:run.jags]{runjags::run.jags()}} as an MCMC +Bayesian model to estimate antibody dynamic curve parameters. The \code{\link[rjags:jags.model]{rjags::jags.model()}} models seroresponse dynamics to an infection. The antibody dynamic curve includes the following parameters: \itemize{ From d5932c9dad963f9710b6c3940615b339c0a5c265 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 11:25:29 -0700 Subject: [PATCH 12/17] Updating lint in example --- inst/examples/examples-plot_jags_densitydx.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inst/examples/examples-plot_jags_densitydx.R b/inst/examples/examples-plot_jags_densitydx.R index b5484d16e..269abd2d6 100644 --- a/inst/examples/examples-plot_jags_densitydx.R +++ b/inst/examples/examples-plot_jags_densitydx.R @@ -1,8 +1,8 @@ - data <- serodynamics::nepal_sees_jags_output +data <- serodynamics::nepal_sees_jags_output - plot_jags_dens( - data = data, - iso = "HlyE_IgA", - strat = "typhi") +plot_jags_dens( + data = data, + iso = "HlyE_IgA", + strat = "typhi") From c2e7092c57f9c87fb22373ce7da4548378f87334 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 11:25:51 -0700 Subject: [PATCH 13/17] Increment version number to 0.0.0.9029 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4ba7bda75..99879bb57 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: serodynamics Title: What the Package Does (One Line, Title Case) -Version: 0.0.0.9028 +Version: 0.0.0.9029 Authors@R: c( person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"), comment = "Author of the method and original code."), From 3654811f0b9d63a4e411cdd15343bb600be306a5 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 11:27:02 -0700 Subject: [PATCH 14/17] adding dplyr call to bind_rows -- this needs to be implemented into main --- tests/testthat/test-run_mod.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-run_mod.R b/tests/testthat/test-run_mod.R index e40bbdc1b..555d870bc 100644 --- a/tests/testthat/test-run_mod.R +++ b/tests/testthat/test-run_mod.R @@ -12,7 +12,7 @@ test_that( sim_case_data(n = 100, antigen_isos = "HlyE_IgA") |> mutate(strat = "stratum 1") - dataset <- bind_rows(strat1, strat2) + dataset <- dplyr::bind_rows(strat1, strat2) withr::with_seed( 1, code = { From 97e301e708a44f1ce810cb456b11e2d7b77ab4ae Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 11:27:18 -0700 Subject: [PATCH 15/17] Updating documentation for density --- man/plot_jags_dens.Rd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/plot_jags_dens.Rd b/man/plot_jags_dens.Rd index 4b35605f2..78b6145c4 100644 --- a/man/plot_jags_dens.Rd +++ b/man/plot_jags_dens.Rd @@ -53,12 +53,12 @@ The antibody dynamic curve includes the following parameters: \examples{ - data <- serodynamics::nepal_sees_jags_output +data <- serodynamics::nepal_sees_jags_output - plot_jags_dens( - data = data, - iso = "HlyE_IgA", - strat = "typhi") +plot_jags_dens( + data = data, + iso = "HlyE_IgA", + strat = "typhi") } \author{ Sam Schildhauer From 2074123fd7ce6d292f04ccc1783bc683c07471b0 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 12:11:53 -0700 Subject: [PATCH 16/17] Reverting run_mod changes back -- trying to isolate files changed --- R/Run_Mod.R | 12 ++++++------ man/run_mod.Rd | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/Run_Mod.R b/R/Run_Mod.R index 651ae6cd3..c35092cce 100644 --- a/R/Run_Mod.R +++ b/R/Run_Mod.R @@ -1,9 +1,9 @@ #' @title Run Jags Model #' @author Sam Schildhauer #' @description -#' run_mod() takes a data frame and adjustable MCMC inputs to -#' [runjags::run.jags()] as an MCMC -#' Bayesian model to estimate antibody dynamic curve parameters. +#' run_mod() takes a data frame and adjustable mcmc inputs to +#' [runjags::run.jags()] as an mcmc +#' bayesian model to estimate antibody dynamic curve parameters. #' The [rjags::jags.model()] models seroresponse dynamics to an #' infection. The antibody dynamic curve includes the following parameters: #' - y0 = baseline antibody concentration @@ -14,7 +14,7 @@ #' @param data A [base::data.frame()] with the following columns. #' @param file_mod The name of the file that contains model structure. #' @param nchain An [integer] between 1 and 4 that specifies -#' the number of MCMC chains to be run per jags model. +#' the number of mcmc chains to be run per jags model. #' @param nadapt An [integer] specifying the number of adaptations per chain. #' @param nburn An [integer] specifying the number of burn ins before sampling. #' @param nmc An [integer] specifying the number of samples in posterior chains. @@ -35,7 +35,7 @@ #' - A [base::data.frame()] titled `curve_params` that contains the posterior #' distribution will be exported with the following attributes: #' - `iteration` = number of sampling iterations -#' - `chain` = number of MCMC chains run; between 1 and 4 +#' - `chain` = number of mcmc chains run; between 1 and 4 #' - `indexid` = "newperson", indicating posterior distribution #' - `antigen_iso` = antibody/antigen type combination being evaluated #' - `alpha` = posterior estimate of decay rate @@ -127,7 +127,7 @@ run_mod <- function(data, # stratification and will only be included if specified. jags_post_final[[i]] <- jags_post - # Unpacking and cleaning MCMC output. + # Unpacking and cleaning mcmc output. jags_unpack <- ggmcmc::ggs(jags_post[["mcmc"]]) # Adding attributes diff --git a/man/run_mod.Rd b/man/run_mod.Rd index 96a27685a..fce7003d2 100644 --- a/man/run_mod.Rd +++ b/man/run_mod.Rd @@ -23,7 +23,7 @@ run_mod( \item{file_mod}{The name of the file that contains model structure.} \item{nchain}{An \link{integer} between 1 and 4 that specifies -the number of MCMC chains to be run per jags model.} +the number of mcmc chains to be run per jags model.} \item{nadapt}{An \link{integer} specifying the number of adaptations per chain.} @@ -55,7 +55,7 @@ objects (one per stratum). distribution will be exported with the following attributes: \itemize{ \item \code{iteration} = number of sampling iterations -\item \code{chain} = number of MCMC chains run; between 1 and 4 +\item \code{chain} = number of mcmc chains run; between 1 and 4 \item \code{indexid} = "newperson", indicating posterior distribution \item \code{antigen_iso} = antibody/antigen type combination being evaluated \item \code{alpha} = posterior estimate of decay rate @@ -77,9 +77,9 @@ distribution will be exported with the following attributes: } } \description{ -run_mod() takes a data frame and adjustable MCMC inputs to -\code{\link[runjags:run.jags]{runjags::run.jags()}} as an MCMC -Bayesian model to estimate antibody dynamic curve parameters. +run_mod() takes a data frame and adjustable mcmc inputs to +\code{\link[runjags:run.jags]{runjags::run.jags()}} as an mcmc +bayesian model to estimate antibody dynamic curve parameters. The \code{\link[rjags:jags.model]{rjags::jags.model()}} models seroresponse dynamics to an infection. The antibody dynamic curve includes the following parameters: \itemize{ From 1a1d090a09a1636e95361ead51b126017f682140 Mon Sep 17 00:00:00 2001 From: sschildhauer Date: Mon, 28 Apr 2025 12:12:07 -0700 Subject: [PATCH 17/17] Taking out suppresswarning from test --- tests/testthat/test-plot_jags_densitydx.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/testthat/test-plot_jags_densitydx.R b/tests/testthat/test-plot_jags_densitydx.R index 7bf680798..04c710ef4 100644 --- a/tests/testthat/test-plot_jags_densitydx.R +++ b/tests/testthat/test-plot_jags_densitydx.R @@ -4,8 +4,7 @@ test_that( code = { skip_if(getRversion() < "4.4.1") # 4.3.3 had issues - data <- serodynamics::nepal_sees_jags_output |> - suppressWarnings() + data <- serodynamics::nepal_sees_jags_output # Testing for any errors: results <- plot_jags_dens(data) |> expect_no_error()