Parallel Versions of the Gradient-Based optim() Methods

Provides parallel versions of the gradient-based optim() methods. The main function of the package is optimParallel(), which has the same usage and output as optim(). Using optimParallel() can significantly reduce the optimization time.

The package provides parallel versions of the gradient-based optim methods "L-BFGS-B", "BFGS", and "CG". If the evaluation of the function fn takes more than 0.05 seconds, optimParallel can significantly reduce the optimization time. For a p-parameter optimization based on "L-BFGS-B", the speed increase is about factor 1+2p when no analytic gradient is specified and 1+2p processor cores are available.

See the ArXiv e-prints URL also available as package vignette for more information.

R> vignette("optimParallel")


  • version 0.7-4: bug fix commit 813a06269b6e777157fbe529bc62e38fc4d59de4 Author: Florian Gerber [email protected] Date: Mon Oct 15 22:40:37 2018 -0600 (1) 'fn'. 'gr' can now be functions from other packages calling compiled code, e.g., optimParallel(par=1, fn=dnorm, mean=3)

  • version 0.7-3: bug fix commit 01ebb9016000a7b087c01b190db0b7ab9d4778d6 Author: Florian Gerber [email protected] Date: Fri Jul 27 22:40:37 2018 -0600 (1) indexing 'par' by names inside 'fn' works now. e.g. optimParallel(par=c(a=1), fn <- function(x) {x["a"]^2}) (2) using functions and method from loaded packages works now. 'fn' and 'gr' have now .GlobalEnv as parent environment. (3) the default value for the argument 'method' is now "L-BFGS-B". (4) the help page ?optimParallel contains a new section 'Notes' summarizing considerations for the practical use.

  • version 0.7-2: CRAN release commit f46556cee870a5c13145ddfdf5f2e3998ea0b317 Author: Florian Gerber [email protected] Date: Tue May 1 12:43:35 2018 +0200

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.7-4 by Florian Gerber, 3 months ago

Report a bug at

Browse source code at

Authors: Florian Gerber

Documentation:   PDF Manual  

GPL (>= 2) license

Depends on stats, parallel

Suggests R.rsp, roxygen2, spam, microbenchmark, testthat, ggplot2, numDeriv

Suggested by GLMMadaptive.

See at CRAN