{"id":16876939,"url":"https://github.com/jlmelville/mize","last_synced_at":"2025-10-13T00:17:43.279Z","repository":{"id":56936081,"uuid":"77254163","full_name":"jlmelville/mize","owner":"jlmelville","description":"R Package for Unconstrained Numerical Optimization","archived":false,"fork":false,"pushed_at":"2025-01-25T17:36:29.000Z","size":3282,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-03T23:58:31.029Z","etag":null,"topics":["conjugate-gradient","l-bfgs","numerical-optimization","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlmelville.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-23T22:38:22.000Z","updated_at":"2025-03-09T16:43:53.000Z","dependencies_parsed_at":"2022-08-21T06:20:40.059Z","dependency_job_id":null,"html_url":"https://github.com/jlmelville/mize","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jlmelville/mize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmelville%2Fmize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmelville%2Fmize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmelville%2Fmize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmelville%2Fmize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlmelville","download_url":"https://codeload.github.com/jlmelville/mize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmelville%2Fmize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013622,"owners_count":26085298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conjugate-gradient","l-bfgs","numerical-optimization","r"],"created_at":"2024-10-13T15:41:01.358Z","updated_at":"2025-10-13T00:17:43.264Z","avatar_url":"https://github.com/jlmelville.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mize\n\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/jlmelville/mize?branch=master\u0026svg=true)](https://ci.appveyor.com/project/jlmelville/mize)\n[![Coverage status](https://codecov.io/gh/jlmelville/mize/branch/master/graph/badge.svg)](https://codecov.io/github/jlmelville/mize?branch=master)\n[![R-CMD-check](https://github.com/jlmelville/mize/workflows/R-CMD-check/badge.svg)](https://github.com/jlmelville/mize/actions)\n[![CRAN Status Badge](http://www.r-pkg.org/badges/version/mize)](https://cran.r-project.org/package=mize)\n[![Dependencies](https://tinyverse.netlify.com/badge/mize)](https://cran.r-project.org/package=mize)\n[![CRAN Monthly Downloads](https://cranlogs.r-pkg.org/badges/mize)](https://cran.r-project.org/package=mize)\n![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/mize)\n[![Last Commit](https://img.shields.io/github/last-commit/jlmelville/mize)](https://github.com/jlmelville/mize)\n\nUnconstrained Numerical Optimization Algorithms.\n\n`mize` can be used as a standalone function like the `stats::optim` function,\nor can be integrated into other packages by creating a stateful optimizer and\nhandling the iterations, convergence, logging and so on externally.\n\n`mize` knows how to do Broyden-Fletcher-Goldfarb-Shanno (BFGS),\nthe limited-memory BFGS (L-BFGS), various flavors of Conjugate Gradient (CG),\nNesterov Accelerated Gradient (NAG) and momentum-based methods, among others.\n\n## Installing\n\n```R\n# Install from CRAN:\ninstall.packages(\"mize\")\n\n# Or install the development version from GitHub:\n# install.packages(\"devtools\")\ndevtools::install_github(\"jlmelville/mize\")\n```\n\n## Documentation\n\n```R\n?mize\n```\n\nThere are also some vignettes:\n\n* `mize.Rmd`, which goes through many of the options available.\n* `mmds.Rmd`, which does a simple, but non-trivial, application of `mize` to\ncarry out metric Multi-Dimensional Scaling on the `eurodist` data set.\n* `stateful.Rmd`, which demonstrates how to use `mize` statefully, so you can\nmanually and externally invoke each iteration step.\n\n## Examples\n\n```R\n# Make a list containing the function and gradient:\nrosenbrock_fg \u003c- list(\n   fn = function(x) { 100 * (x[2] - x[1] * x[1]) ^ 2 + (1 - x[1]) ^ 2  },\n   gr = function(x) { c( -400 * x[1] * (x[2] - x[1] * x[1]) - 2 * (1 - x[1]),\n                          200 *        (x[2] - x[1] * x[1])) })\n# Starting point:\nrb0 \u003c- c(-1.2, 1)\n\n# Minimize using L-BFGS\nres \u003c- mize(rb0, rosenbrock_fg, method = \"L-BFGS\")\n# Optimized parameters are in res$par\n\n# Or create an optimizer and then loop manually\nopt \u003c- make_mize(method = \"L-BFGS\")\nopt \u003c- mize_init(opt, rb0, rosenbrock_fg)\n\npar \u003c- rb0\ndone \u003c- FALSE\niter \u003c- 0\nwhile (!done) {\n  iter \u003c- iter + 1\n  res \u003c- mize_step(opt, par, rosenbrock_fg)\n  par \u003c- res$par\n  opt \u003c- res$opt\n  # Look at res$f for current function value\n  # you get to (i.e. have to) decide when to stop\n  done \u003c- iter \u003e 30\n}\n```\n\n## See also\n\nThe Wolfe line searches use conversion of Mark Schmidt's\n[minFunc routines](http://www.cs.ubc.ca/~schmidtm/Software/minFunc.html),\nCarl Edward Rasmussen's\n[Matlab code](http://learning.eng.cam.ac.uk/carl/code/minimize/) and Dianne\nO'Leary's Matlab translation of the\n[Moré-Thuente line search](http://www.cs.umd.edu/users/oleary/software/)\nalgorithm from [MINPACK](http://www.netlib.org/minpack/).\n\nI also maintain the [funconstrain](https://github.com/jlmelville/funconstrain) package, which contains a large number of test\nproblems for numerical optimization. See this [gist](https://gist.github.com/jlmelville/2cb8905edd0dbc23806d3122a7a05c5d) for functions\nto use mize with funconstrain.\n\n## License\n\n[BSD 2-Clause](https://opensource.org/licenses/BSD-2-Clause).\n\n## Acknowledgments\n\nI am grateful to Hans Werner Borchers, who provided assistance and\nencouragement in getting mize onto CRAN.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmelville%2Fmize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlmelville%2Fmize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmelville%2Fmize/lists"}