https://github.com/cran/pracma
Tip revision: 03698027c2d84118bd0c53c4a9a5b5d23676f388 authored by HwB on 01 October 2012, 00:00:00 UTC
version 1.2.0
version 1.2.0
Tip revision: 0369802
testfunctions.Rd
\name{Testfunctions}
\alias{rastrigin}
\alias{rosenbrock}
\title{
Optimization Test Function
}
\description{
Simple and often used test function defined in higher dimensions.
The dimension is determined by the length of the input vector.
}
\usage{
rastrigin(x)
rosenbrock(x)
}
\arguments{
\item{x}{numeric vector of some length \code{n >= 2}.}
}
\details{
\strong{Rastrigin}:
\deqn{10 n + \sum_1^n (x_i^2 - 10 \cos(2 \pi x_i))}
\tabular{ll}{
No. of Vars.: \tab n >= 1 \cr
Bounds: \tab -5.12 <= xi <= 5.12 \cr
Local minima: \tab many \cr
Minimum: \tab 0.0 \cr
Solution: \tab xi = 0, i = 1:n \cr
}
\strong{Rosenbrock}:
\deqn{\sum_{i=1}^{n-1} (1-x_i)^2 + 100 (x_{i+1}-x_i^2)^2}
\tabular{ll}{
No. of Vars.: \tab n >= 2 \cr
Bounds: \tab -5.12 <= xi <= 5.12 \cr
Local minima: \tab at f(-1, 1, \ldots, 1) for n >= 4 \cr
Minimum: \tab 0.0 \cr
Solution: \tab xi = 1, i = 1:n \cr
}
}
\value{
Returns the value of the function at the specified point.
}
\references{
See the Wikipedia.
}
\examples{
rastrigin(c(1, 1, 1, 1))
rosenbrock(c(1, 1, 1, 1))
}