funError: funError

View source: R/funError.R

funErrorR Documentation

funError

Description

Simulate NAs, Infs, NaNs in results from objective function evaluations

Usage

funError(x, prob = 0.1, errorList = list(NA, Inf, NaN), outDim = 1)

Arguments

x

input vector or matrix of candidate solution

prob

error probability (0<prob<1). Default: 0.1

errorList

list with error types. Default: list(NA, Inf, NaN)

outDim

dimension of the output matrix (number of columns)

Details

Results from funSphere are replaced with NA, NaN, and Inf values.

Value

vector of objective function values

See Also

is.finite

Examples

set.seed(123)
require(SPOT)
x <- matrix(1:10, 5,2)
y <- funError(x)
any(is.na(y))
## two-dim output
funError(x,outDim=2)
funError(x,outDim=2, prob=0.1)



SPOT documentation built on June 26, 2022, 1:06 a.m.