Learn R Programming

marinepredator (version 0.0.1)

F01: Sphere Function (F01)

Description

The Sphere function is a simple unimodal test function commonly used to evaluate the performance of optimization algorithms. It has a single global minimum at the origin.

Usage

F01(x)

Value

Numeric scalar representing the function value.

Arguments

x

Numeric vector of input values.

Details

Formula: $$f(x) = \sum_{i=1}^{n} x_i^2$$

Global minimum: \(f(0, 0, ..., 0) = 0\)

Characteristics:

  • Type: Unimodal

  • Separable: Yes

  • Differentiable: Yes

  • Convex: Yes

  • Default bounds: \([-100, 100]^n\)

  • Default dimensions: 50

See Also

test-functions for an overview of all test functions, get_function_details to retrieve function parameters.

Examples

Run this code
F01(c(0, 0, 0))    # Returns 0 (global minimum)
F01(c(1, 2, 3))    # Returns 1 + 4 + 9 = 14
F01(rep(0, 50))    # Returns 0 in 50 dimensions

Run the code above in your browser using DataLab