R/ackley.R

Defines functions ackley

Documented in ackley

ackley  <- function(x)
{
  x1 <- x[,1]
  x2 <- x[,2]
  a <- 20
  b <- 0.2
  c <- 2*pi
  i <- 1:2
  dx <- 2
  y <- -a*exp(-b*sqrt(1/dx*(x1^2+x2^2)))-exp(1/dx*(cos(c*x1)+cos(c*x2)))+a+exp(1)
  y <- matrix(y,nrow=nrow(x))
  rownames(y) <- rownames(x)
  colnames(y) <- paste("y",seq(1,ncol(y)),sep="")
  return(y)
}

Try the emma package in your browser

Any scripts or data that you put into this service are public.

emma documentation built on May 2, 2019, 2:47 p.m.