
Last chance! 50% off unlimited learning
Sale ends in
Based on a DDC
fit on an initial (training) data set X
, this function
analyzes a new (test) data set Xnew
.
DDCpredict(Xnew, InitialDDC, DDCpars = NULL)
A list with components:
the options used in the call, see DDC
.
the locations of the columns, from InitialDDC
.
the scales of the columns, from InitialDDC
.
Xnew
standardized by locX
and scaleX
.
predictions use a combination of nbngbrs
columns.
for each column, the list of its neighbors, from InitialDDC
.
for each column, the correlations with its neighbors, from InitialDDC
.
slopes to predict each column by its neighbors, from InitialDDC
.
for each connected column, its deshrinkage factor used in InitialDDC
.
predicted values for every cell of Xnew
.
scale estimate of the residuals (Xnew
- Xest
), from InitialDDC
.
columnwise standardized residuals of Xnew
.
positions of cellwise outliers in Xnew
.
outlyingness of rows in Xnew
.
median of the Ti
in InitialDDC
.
mad of the Ti
in InitialDDC
.
row numbers of the outlying rows in Xnew
.
positions of the NA
's in Xnew
.
positions of NA
's and outlying cells in Xnew
.
Xnew
where all cells in indall are imputed by their prediction.
The new data (test data), which must be a matrix or a data frame. It must always be provided. Its columns (variables) should correspond to those of InitialDDC$remX
.
The output of the DDC
function on the initial (training)
dataset. Must be provided.
The input options to be used for the prediction. By default the options of InitialDDC are used.
Rousseeuw P.J., Van den Bossche W.
Hubert, M., Rousseeuw, P.J., Van den Bossche W. (2019). MacroPCA: An all-in-one PCA method allowing for missing values as well as cellwise and rowwise outliers. Technometrics, 61(4), 459-473. (link to open access pdf)
checkDataSet
, cellMap
,
DDC
library(MASS)
set.seed(12345)
n <- 100; d <- 10
A <- matrix(0.9, d, d); diag(A) = 1
x <- mvrnorm(n, rep(0,d), A)
x[sample(1:(n * d), 50, FALSE)] <- NA
x[sample(1:(n * d), 50, FALSE)] <- 10
x <- cbind(1:n, x)
DDCx <- DDC(x)
xnew <- mvrnorm(50, rep(0,d), A)
xnew[sample(1:(50 * d), 50, FALSE)] <- 10
predict.out <- DDCpredict(xnew, DDCx)
cellMap(D = xnew, R = predict.out$stdResid,
columnlabels = 1:d, rowlabels = 1:50)
# For more examples, we refer to the vignette:
if (FALSE) {
vignette("DDC_examples")
}
Run the code above in your browser using DataLab