Newer
Older
% Please edit documentation in R/update_fittedmodel.R
updateParallel(
formula,
list_tmb,
n.cores = NULL,
cl_type = "PSOCK",
log_file = paste(tempdir(check = FALSE), "htrfit.log", sep = "/"),
...
)
}
\arguments{
\item{formula}{Formula for the GLMNB model.}
\item{n.cores}{Number of cores to use for parallel processing. If NULL, the function will use all available cores.}
\item{cl_type}{cluster type (defautl "PSOCK"). "FORK" is recommanded for linux.}
\item{log_file}{File path for the log output (default: Rtmpdir/htrfit.log).}
\item{...}{Additional arguments to be passed to the glmmTMB::glmmTMB function.}
}
\value{
A list of updated GLMNB models.
}
\description{
This function fits glmmTMB models in parallel using multiple cores, allowing for faster computation.
}
\examples{
data(iris)
groups <- unique(iris$Species)
group_by <- "Species"
formula <- Sepal.Length ~ Sepal.Width + Petal.Length
fitted_models <- fitModelParallel(formula, iris, group_by, n.cores = 1)
new_formula <- Sepal.Length ~ Sepal.Width
results <- updateParallel(new_formula, fitted_models, n.cores = 1)
}