DDCpredict {cellWise}  R Documentation 
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)
Xnew 
The new data (test data), which must be a matrix or a data frame. It must always be provided. 
InitialDDC 
The output of the 
DDCpars 
The input options to be used for the prediction. By default the options of InitialDDC are used. 
A list with components:
DDCpars 
the options used in the call, see 
locX 
the locations of the columns, from 
scaleX 
the scales of the columns, from 
Z 

nbngbrs 
predictions use a combination of 
ngbrs 
for each column, the list of its neighbors, from 
robcors 
for each column, the correlations with its neighbors, from 
robslopes 
slopes to predict each column by its neighbors, from 
deshrinkage 
for each connected column, its deshrinkage factor used in 
Xest 
predicted values for every cell of 
scalestres 
scale estimate of the residuals ( 
stdResid 
columnwise standardized residuals of 
indcells 
positions of cellwise outliers in 
Ti 
outlyingness of rows in 
medTi 
median of the 
madTi 
mad of the 
indrows 
row numbers of the outlying rows in 
indNAs 
positions of the 
indall 
positions of 
Ximp 

Rousseeuw P.J., Van den Bossche W.
Hubert, M., Rousseeuw, P.J., Van den Bossche W. (2019). MacroPCA: An allinone PCA method allowing for missing values as well as cellwise and rowwise outliers. Technometrics, 61(4), 459473. (link to open access pdf)
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(xnew, predict.out$stdResid, columnlabels = 1:d, rowlabels = 1:50) # For more examples, we refer to the vignette: vignette("DDC_examples")