Last data update: 2014.03.03

R: 2D test function
camelbackR Documentation

2D test function

Description

Camelback 2-dimensional test function.

Usage

camelback(x)

Arguments

x

a 2-dimensional vector specifying the location where the function is to be evaluated.

Details

The Camelback function is usually defined over the domain [-3,-2] x [3, 2]. Here, the function is adapted to the domain [0,1] x [0,1]. It has 2 global minima : x1 = c(0.5149730,0.3218374); x2 = c(0.4850263,0.6781641)

Value

A real number equal to the Camelback function values at x

Author(s)

D. Ginsbourger, Ecole des Mines de St-Etienne.

Examples

 
n.grid <- 20
x.grid <- y.grid <- seq(0,1,length=n.grid)
design.grid <- expand.grid(x.grid, y.grid)
response.grid <- apply(design.grid, 1, camelback)
z.grid <- matrix(response.grid, n.grid, n.grid)
contour(x.grid,y.grid,z.grid,20)
x1 = c(0.5149730,0.3218374); x2 = c(0.4850263,0.6781641)
points(rbind(t(x1), t(x2)), pch=19, col="red")
title("Fonction Camelback")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiceKriging)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiceKriging/camelback.Rd_%03d_medium.png", width=480, height=480)
> ### Name: camelback
> ### Title: 2D test function
> ### Aliases: camelback
> ### Keywords: optimize internal
> 
> ### ** Examples
>  
> n.grid <- 20
> x.grid <- y.grid <- seq(0,1,length=n.grid)
> design.grid <- expand.grid(x.grid, y.grid)
> response.grid <- apply(design.grid, 1, camelback)
> z.grid <- matrix(response.grid, n.grid, n.grid)
> contour(x.grid,y.grid,z.grid,20)
> x1 = c(0.5149730,0.3218374); x2 = c(0.4850263,0.6781641)
> points(rbind(t(x1), t(x2)), pch=19, col="red")
> title("Fonction Camelback")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>