Internal function to fit glmmTMB models in parallel.
parallel_update.Rd
This function is used internally by updateParallel
to fit glmmTMB models in parallel.
Arguments
- formula
Formula for the GLMNB model.
- list_tmb
List of glmmTMB objects.
- n.cores
Number of cores to use for parallel processing.
- log_file
File path for the log output (default : Rtmpdir/htrfit.log).
- cl_type
cluster type (defautl "PSOCK"). "FORK" is recommanded for linux.
- ...
Additional arguments to be passed to the glmmTMB::glmmTMB function.
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)
#> Log file location: /tmp/RtmpS86cq0/htrfit.log
#> CPU(s) number : 1
#> Cluster type : PSOCK
new_formula <- Sepal.Length ~ Sepal.Width
results <- parallel_update(new_formula, fitted_models, n.cores = 1)
#> CPU(s) number : 1
#> Cluster type : PSOCK