| find_reps {hetGP} | R Documentation |
Data preprocessing
Description
Prepare data for use with mleHetGP, in particular to find replicated observations
Usage
find_reps(
X,
Z,
return.Zlist = TRUE,
rescale = FALSE,
normalize = FALSE,
inputBounds = NULL
)
Arguments
X |
matrix of design locations, one point per row |
Z |
vector of observations at |
return.Zlist |
to return |
rescale |
if |
normalize |
if |
inputBounds |
optional matrix of known boundaries in original input space, of size 2 times |
Details
Replicates are searched based on character representation, using unique.
Value
A list with the following elements that can be passed to the main fitting functions, e.g., mleHetGP and mleHomGP
-
X0matrix with unique designs locations, one point per row, -
Z0vector of averaged observations atX0, -
multnumber of replicates atX0, -
Zvector with all observations, sorted according toX0, -
Zlistoptional list, each element corresponds to observations at a design inX0, -
inputBoundsoptional matrix, to rescale back to the original input space, -
outputStatsoptional vector, with mean and variance of the original outputs.
Examples
##------------------------------------------------------------
## Find replicates on the motorcycle data
##------------------------------------------------------------
## motorcycle data
library(MASS)
X <- matrix(mcycle$times, ncol = 1)
Z <- mcycle$accel
data_m <- find_reps(X, Z)
# Initial data
plot(X, Z, ylim = c(-160, 90), ylab = 'acceleration', xlab = "time")
# Display mean values
points(data_m$X0, data_m$Z0, pch = 20)