jaya: Jaya Algorithm, a gradient-free optimization algorithm....

Description Usage Arguments Examples

View source: R/jaya.R

Description

Jaya Algorithm, a gradient-free optimization algorithm. Maximization of a function using Jaya Algorithm (JA). A population based method which repeatedly modifies a population of individual solutions. Capable of solving both constrained and unconstrained optimization problems. Does not contain any hyperparameters.

Usage

1
2
jaya(fun, lower, upper, popSize = 50, maxiter, n_var, seed = NULL,
  suggestions = data.frame(), opt = "minimize")

Arguments

fun

as a function to be optimized

lower

as a vector of lower bounds for the vaiables in the function

upper

as a vector of upper bounds for the vaiables in the function

popSize

as population size

maxiter

as number of iterations to run for finding optimum solution

n_var

as number of variables used in the function to optimize

seed

as an integer vector containing the random number generator state

suggestions

as a data frame of solutions string to be included in the initial population

opt

as a string either "maximize" or "minimize" the function

Examples

1
2
3
# Test Function to minimize
square <- function(x){return((x[1]^2)+(x[2]^2))}
jaya(fun = square, lower = c(-100,-100), upper = c(100,100), maxiter = 10, n_var = 2)

Example output

function (x) 
{
    return((x[1]^2) + (x[2]^2))
}
<bytecode: 0x55a164a2ca28>
            x1        x2      f(x)
Best 0.1453148 0.6660483 0.4647368

Jaya documentation built on Nov. 12, 2019, 5:07 p.m.