From 9103bdd41e7273713534dd632c986d89a034cfd7 Mon Sep 17 00:00:00 2001 From: ntorresd Date: Fri, 10 May 2024 14:15:23 -0500 Subject: [PATCH] doc: update documentation --- man/fit_seromodel.Rd | 17 +++++++++-------- man/get_foi_central_estimates.Rd | 13 ++++++++++++- man/plot_foi.Rd | 6 ++++-- man/run_seromodel.Rd | 27 ++++++++++++++------------- 4 files changed, 39 insertions(+), 24 deletions(-) diff --git a/man/fit_seromodel.Rd b/man/fit_seromodel.Rd index 18132065..2aad529e 100644 --- a/man/fit_seromodel.Rd +++ b/man/fit_seromodel.Rd @@ -7,9 +7,8 @@ data} \usage{ fit_seromodel( serodata, - foi_model = c("constant", "tv_normal_log", "tv_normal"), - foi_location = 0, - foi_scale = 1, + foi_model = c("constant", "tv_normal_log", "tv_normal", "av_normal"), + foi_parameters = NULL, chunks = NULL, chunk_size = 1, iter = 1000, @@ -42,11 +41,13 @@ options: \item{\code{"tv_normal_log"}}{Runs a normal logarithmic model} }} -\item{foi_location}{Location parameter of the force-of-infection distribution -of the selected model. Depending on \code{foi_model}, the meaning may vary.} - -\item{foi_scale}{Scale parameter of the force-of-infection distribution -of the selected model. Depending on \code{foi_model}, the meaning may vary.} +\item{foi_parameters}{List specifying the initial prior parameters of the +model \code{foi_model} to be specified as (e.g.): +\describe{ +\item{\code{"constant"}}{\code{list(foi_a = 0, foi_b = 2)}} +\item{\code{"tv_normal"}}{\code{list(foi_location = 0, foi_scale = 1)}} +\item{\code{"tv_normal_log"}}{\code{list(foi_location = -6, foi_scale = 4)}} +}} \item{chunks}{Numeric list specifying the chunk structure of the time interval from the birth year of the oldest age cohort diff --git a/man/get_foi_central_estimates.Rd b/man/get_foi_central_estimates.Rd index a39d079a..0ae49e20 100644 --- a/man/get_foi_central_estimates.Rd +++ b/man/get_foi_central_estimates.Rd @@ -4,7 +4,12 @@ \alias{get_foi_central_estimates} \title{Extract central estimates for the fitted forced FoI} \usage{ -get_foi_central_estimates(seromodel_object, cohort_ages) +get_foi_central_estimates( + seromodel_object, + cohort_ages, + lower_quantile = 0.05, + upper_quantile = 0.95 +) } \arguments{ \item{seromodel_object}{Stanfit object containing the results of fitting a @@ -12,6 +17,12 @@ model by means of \link{run_seromodel}.} \item{cohort_ages}{A data frame containing the age of each cohort corresponding to each birth year.} + +\item{lower_quantile}{Lower quantile used to compute the credible interval of +the fitted force-of-infection.} + +\item{upper_quantile}{Lower quantile used to compute the credible interval of +the fitted force-of-infection.} } \value{ \code{foi_central_estimates}. Central estimates for the fitted forced FoI diff --git a/man/plot_foi.Rd b/man/plot_foi.Rd index e9a0960b..3cde9bff 100644 --- a/man/plot_foi.Rd +++ b/man/plot_foi.Rd @@ -20,12 +20,14 @@ model by means of \link{run_seromodel}.} \item{cohort_ages}{A data frame containing the age of each cohort corresponding to each birth year.} -\item{max_lambda}{TBD} +\item{max_lambda}{Upper \code{ylim}for force-of-infection plot} \item{size_text}{Text size use in the theme of the graph returned by the function.} -\item{foi_sim}{TBD} +\item{foi_sim}{Force-of-infection trend to be plotted alongside the estimated +force-of-infection. Typically this corresponds to the force-of-infection used +to simulate the serosurvey used to model.} } \value{ A ggplot2 object containing the force-of-infection vs time including diff --git a/man/run_seromodel.Rd b/man/run_seromodel.Rd index 033539c0..f564ca8e 100644 --- a/man/run_seromodel.Rd +++ b/man/run_seromodel.Rd @@ -8,10 +8,9 @@ estimate the seroprevalence based on the result of the fit} run_seromodel( serodata, foi_model = c("constant", "tv_normal_log", "tv_normal"), - foi_location = 0, - foi_scale = 1, - chunk_size = 1, + foi_parameters = NULL, chunks = NULL, + chunk_size = 1, iter = 1000, adapt_delta = 0.9, max_treedepth = 10, @@ -43,11 +42,19 @@ options: \item{\code{"tv_normal_log"}}{Runs a normal logarithmic model} }} -\item{foi_location}{Location parameter of the force-of-infection distribution -of the selected model. Depending on \code{foi_model}, the meaning may vary.} +\item{foi_parameters}{List specifying the initial prior parameters of the +model \code{foi_model} to be specified as (e.g.): +\describe{ +\item{\code{"constant"}}{\code{list(foi_a = 0, foi_b = 2)}} +\item{\code{"tv_normal"}}{\code{list(foi_location = 0, foi_scale = 1)}} +\item{\code{"tv_normal_log"}}{\code{list(foi_location = -6, foi_scale = 4)}} +}} -\item{foi_scale}{Scale parameter of the force-of-infection distribution -of the selected model. Depending on \code{foi_model}, the meaning may vary.} +\item{chunks}{Numeric list specifying the chunk structure of the time +interval from the birth year of the oldest age cohort +\code{min(serodata$age_mean_f)} to the time when the serosurvey was conducted +\code{t_sur}. If \code{NULL}, the time interval is divided in chunks of size +\code{chunk_size}.} \item{chunk_size}{Size of the chunks to be used in case that the chunk structure \code{chunks} is not specified in \link{fit_seromodel}. @@ -56,12 +63,6 @@ for every year in the time interval spanned by the serosurvey. If the length of the time interval is not exactly divisible by \code{chunk_size}, the remainder years are included in the last chunk.} -\item{chunks}{Numeric list specifying the chunk structure of the time -interval from the birth year of the oldest age cohort -\code{min(serodata$age_mean_f)} to the time when the serosurvey was conducted -\code{t_sur}. If \code{NULL}, the time interval is divided in chunks of size -\code{chunk_size}.} - \item{iter}{Number of interactions for each chain including the warmup. \code{iter} in \link[rstan:stanmodel-method-sampling]{sampling}.}