Skip to content
Snippets Groups Projects
parallel_update.Rd 1.22 KiB
Newer Older
Arnaud Duvermy's avatar
Arnaud Duvermy committed
% Generated by roxygen2: do not edit by hand
Arnaud Duvermy's avatar
Arnaud Duvermy committed
% Please edit documentation in R/update_fittedmodel.R
\name{parallel_update}
\alias{parallel_update}
\title{Internal function to fit glmmTMB models in parallel.}
Arnaud Duvermy's avatar
Arnaud Duvermy committed
\usage{
parallel_update(
  formula,
  list_tmb,
  n.cores = NULL,
  log_file = paste(tempdir(check = FALSE), "htrfit.log", sep = "/"),
Arnaud Duvermy's avatar
Arnaud Duvermy committed
}
\arguments{
\item{formula}{Formula for the GLMNB model.}

Arnaud Duvermy's avatar
Arnaud Duvermy committed
\item{list_tmb}{List of glmmTMB objects.}
Arnaud Duvermy's avatar
Arnaud Duvermy committed

\item{n.cores}{Number of cores to use for parallel processing.}

\item{log_file}{File path for the log output (default : Rtmpdir/htrfit.log).}
Arnaud Duvermy's avatar
Arnaud Duvermy committed

\item{cl_type}{cluster type (defautl "PSOCK"). "FORK" is recommanded for linux.}

Arnaud Duvermy's avatar
Arnaud Duvermy committed
\item{...}{Additional arguments to be passed to the glmmTMB::glmmTMB function.}
}
\value{
A list of updated GLMNB models.
}
\description{
Arnaud Duvermy's avatar
Arnaud Duvermy committed
This function is used internally by \code{\link{updateParallel}} to fit glmmTMB models in parallel.
Arnaud Duvermy's avatar
Arnaud Duvermy committed
}
\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 
Arnaud Duvermy's avatar
Arnaud Duvermy committed
results <- parallel_update(new_formula, fitted_models, n.cores = 1)
Arnaud Duvermy's avatar
Arnaud Duvermy committed
}