From c94f2d649b762a8f2d97fdefb1cd29e10e3f03c5 Mon Sep 17 00:00:00 2001 From: Jouni Helske Date: Sun, 1 Sep 2024 21:44:18 +0300 Subject: [PATCH] update docs --- NAMESPACE | 2 -- R/seqHMM-package.R | 1 - man/average_marginal_effect.Rd | 2 +- man/estimate_mnhmm.Rd | 11 ++++++++++- man/estimate_nhmm.Rd | 11 ++++++++++- man/forward_backward.Rd | 7 ++++--- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index ed06c54c..b290bc32 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -114,8 +114,6 @@ importFrom(graphics,strwidth) importFrom(graphics,text) importFrom(methods,hasArg) importFrom(numDeriv,jacobian) -importFrom(posterior,as_draws_rvars) -importFrom(posterior,draws_of) importFrom(rstan,optimizing) importFrom(rstantools,rstan_config) importFrom(stats,BIC) diff --git a/R/seqHMM-package.R b/R/seqHMM-package.R index 3e11d059..4142e6de 100644 --- a/R/seqHMM-package.R +++ b/R/seqHMM-package.R @@ -25,7 +25,6 @@ #' @import Rcpp #' @importFrom future plan sequential multisession #' @importFrom future.apply future_lapply -#' @importFrom posterior as_draws_rvars draws_of #' @importFrom rstan optimizing #' @importFrom rstantools rstan_config #' @importFrom RcppParallel RcppParallelLibs CxxFlags diff --git a/man/average_marginal_effect.Rd b/man/average_marginal_effect.Rd index 81a23259..eb7cf5c3 100644 --- a/man/average_marginal_effect.Rd +++ b/man/average_marginal_effect.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ame.R +% Please edit documentation in R/average_marginal_effect.R \name{average_marginal_effect} \alias{average_marginal_effect} \title{Average Marginal Effects of Covariates of Non-homogenous Hidden Markov Models} diff --git a/man/estimate_mnhmm.Rd b/man/estimate_mnhmm.Rd index 653a072c..681a7c93 100644 --- a/man/estimate_mnhmm.Rd +++ b/man/estimate_mnhmm.Rd @@ -23,6 +23,7 @@ estimate_mnhmm( restarts = 1L, threads = 1L, store_data = TRUE, + verbose = TRUE, ... ) } @@ -84,7 +85,15 @@ is stored to the model object. For large datasets, this can be set to \code{FALSE}, in which case you might need to pass the data separately to some post-prosessing functions.} -\item{...}{Additional arguments to \code{\link[rstan:stanmodel-method-optimizing]{rstan::optimizing()}}.} +\item{verbose}{If \code{TRUE} (default), print progress messages during the final +optimization (after restarts). Note that due to the design of \code{rstan}, the +reason for the termination of optimization (e.g., reached the maximum number +of iterations) is only available by the final message show with +\code{verbose = TRUE}.} + +\item{...}{Additional arguments to \code{\link[rstan:stanmodel-method-optimizing]{rstan::optimizing()}}. Most importantly, +argument \code{iter} defines the maximum number of iterations for optimization. +The default is \code{2000}.} } \value{ Object of class \code{mnhmm}. diff --git a/man/estimate_nhmm.Rd b/man/estimate_nhmm.Rd index d97fa334..558993bb 100644 --- a/man/estimate_nhmm.Rd +++ b/man/estimate_nhmm.Rd @@ -20,6 +20,7 @@ estimate_nhmm( restarts = 1L, threads = 1L, store_data = TRUE, + verbose = TRUE, ... ) } @@ -72,7 +73,15 @@ is stored to the model object. For large datasets, this can be set to \code{FALSE}, in which case you might need to pass the data separately to some post-prosessing functions.} -\item{...}{Additional arguments to \code{\link[rstan:stanmodel-method-optimizing]{rstan::optimizing()}}.} +\item{verbose}{If \code{TRUE} (default), print progress messages during the final +optimization (after restarts). Note that due to the design of \code{rstan}, the +reason for the termination of optimization (e.g., reached the maximum number +of iterations) is only available by the final message show with +\code{verbose = TRUE}.} + +\item{...}{Additional arguments to \code{\link[rstan:stanmodel-method-optimizing]{rstan::optimizing()}}. Most importantly, +argument \code{iter} defines the maximum number of iterations for optimization. +The default is \code{2000}.} } \value{ Object of class \code{nhmm}. diff --git a/man/forward_backward.Rd b/man/forward_backward.Rd index b265cbd8..5aaa1584 100644 --- a/man/forward_backward.Rd +++ b/man/forward_backward.Rd @@ -47,12 +47,13 @@ computed and returned in logarithmic scale for numerical stability. If is \code{1}. Not used for \code{nhmm} and \code{mnhmm} objects.} \item{as_data_frame}{If \code{TRUE} (default), the output is returned as a -data.frame. Otherwise, a list of array(s) is returned.} +data.frame. Otherwise, a list of array(s) is returned. Ignored if +\code{log_space} is \code{FALSE}, in which case list of arrays is always returned.} } \value{ If \code{as_data_frame} is \code{TRUE} a \code{data.frame} with -log-values of forward and backward probabilities. If \code{FALSE}, a list with -components +log-values of forward and backward probabilities. If \code{FALSE} or +\code{log_space = FALSE}, a list with components \itemize{ \item forward_probs\cr If \code{log_space = FALSE}, scaled forward probabilities, i.e. probability of state given observations up to that time point.