Learn R Programming

pracma (version 1.1.6)

Test functions: 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

x
numeric vector of some length n >= 2.

Value

  • Returns the value of the function at the specified point.

Details

Rastrigin: $$10 n + \sum_1^n (x_i^2 - 10 \cos(2 \pi x_i))$$ ll{ No. of Vars.: n >= 1 Bounds: -5.12 <= xi="" <="5.12" local="" minima:="" many="" minimum:="" 0.0="" solution:="" i="1:n" }="" Rosenbrock: $$\sum_{i=1}^{n-1} (1-x_i)^2 + 100 (x_{i+1}-x_i^2)^2$$ ll{ No. of Vars.: n >= 2 Bounds: -5.12 <= xi="" <="5.12" local="" minima:="" at="" f(-1,="" 1,="" ...,="" 1)="" for="" n="">= 4 Minimum: 0.0 Solution: xi = 1, i = 1:n }

References

See the Wikipedia.

Examples

Run this code
rastrigin(c(1, 1, 1, 1))
rosenbrock(c(1, 1, 1, 1))

Run the code above in your browser using DataLab