Skip to content

LukasDSauer/optimizr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

optimizr

R-CMD-check Codecov test coverage CRAN status

A collection of numerical optimization algorithms (currently two). One is a simple implementation of the primitive grid search algorithm, the other is an extension of the simulated annealing algorithm that can take custom boundaries into account. The methodology for this bounded simulated annealing algorithm is due to Haario and Saksman 1991.

Installation

You can install the development version of optimizr from GitHub with:

# install.packages("pak")
pak::pak("LukasDSauer/optimizr")

Example

In the following basic example, we optimize the “wild function” from the stats::optim() examples, global minimum at about -15.81515.

library(optimizr)
# "wild" function from the 
fw <- function (x)
  (10*sin(0.3*x)*sin(1.3*x^2) + 0.00001*x^4 + 0.2*x+80)
simann(par = 50, 
       fn = fw,
       control = list(maxit = 20000, 
                      temp = 10, 
                      parscale = 20, 
                      REPORT = NA_real_))
#> $par
#> [1] -15.81521
#> 
#> $value
#> [1] 67.46776

Reference

Haario H, Saksman E. Simulated Annealing Process in General State Space. Advances in Applied Probability, Vol. 23, No. 4 (Dec., 1991), pp. 866-893, doi:10.2307/1427681.

About

Further numerical optimization algorithms for R.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages