Learn R Programming

marinepredator (version 0.0.1)

F04: Maximum Absolute Value (F04)

Description

A unimodal test function that returns the maximum absolute value in the input vector, also known as the Schwefel 2.21 function.

Usage

F04(x)

Value

Numeric scalar representing the function value.

Arguments

x

Numeric vector of input values.

Details

Formula: $$f(x) = \max_i |x_i|$$

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

Characteristics:

  • Type: Unimodal

  • Separable: No

  • Differentiable: No

  • Convex: Yes

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

  • Default dimensions: 50

This function is particularly challenging because it only depends on the single variable with the largest absolute value, making gradient-based information less useful.

See Also

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

Examples

Run this code
F04(c(0, 0, 0))    # Returns 0 (global minimum)
F04(c(-1, 2, -3))  # Returns 3
F04(c(5, -5, 5))   # Returns 5

Run the code above in your browser using DataLab