Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O optimParallel
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Florian Gerber
  • optimParallel
  • Issues
  • #3
Closed
Open
Created Jul 18, 2018 by Florian Gerber@florian.gerberOwner

index `par` by names does not work

Thanks to Marc for spotting the issue!

index par by names does not work.

set.seed(13); x <- rnorm(1000, 5, 2)

negll <- function(par, x){ -sum(dnorm(x=x, mean=par["mean"], sd=par["sd"], log=TRUE)) }

optim(par=c(mean=1, sd=1), fn=negll, x=x, method = "L-BFGS-B", lower=c(-Inf, .0001))

The same code cannot be used in optim and optimParallel

library(optimParallel)

cl <- makeCluster(2) # set the number of processor cores

setDefaultCluster(cl=cl) # set 'cl' as default cluster

optimParallel(par=c(mean=1, sd=1), fn=negll, x=x, method = "L-BFGS-B", lower=c(-Inf, .0001))

ERROR

Edited Jul 18, 2018 by Florian Gerber
Assignee
Assign to
Time tracking