handleNAsKrigingWorst: handleNAsKrigingWorst

View source: R/handleNAs.R

handleNAsKrigingWorstR Documentation

handleNAsKrigingWorst

Description

Remove NAs from a vector by replacing them with a penalized Kriging-based expectation

Usage

handleNAsKrigingWorst(
  x,
  y,
  penaltyImputation = 3,
  imputeCriteriaFuns = list(is.na, is.infinite, is.nan)
)

Arguments

x

The x values from which y was calculated

y

The vector of numerics from which the NAs should be removed

penaltyImputation

multiplier for sPredicted (penalty term). Default: 3.

imputeCriteriaFuns

list criteria functions specified via imputeCriteriaFuns in spotControl. Default: list(is.na, is.infinite, is.nan).

Value

y The imputed vector w/o NA and w/o Inf values.

Examples

imputeCriteriaFuns <- list(is.na, is.infinite, is.nan)
x <- matrix(runif(20), ncol = 2)
y <- funSphere(x)
y[3] <- NA
y[5] <- Inf
plot(y, type="b")
print(y)
y1 <- handleNAsKrigingWorst(x=x, y=y, imputeCriteriaFuns=imputeCriteriaFuns)
print(y1)
points(3, y1[3], type="b", col="red")
points(5, y1[5], type="b", col="red")

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