Learn R Programming

SPOT (version 2.11.10)

funError: 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)

Value

vector of objective function values

Details

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

See Also

is.finite

Examples

Run this code
# NOT RUN {
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)


# }

Run the code above in your browser using DataLab