MacroPCApredict {cellWise}  R Documentation 
Based on a MacroPCA
fit of an initial (training) data set X
, this function analyzes a
new (test) data set Xnew
.
MacroPCApredict(Xnew, InitialMacroPCA, MacroPCApars = NULL)
Xnew 
The new data (test data), which must be a matrix or a data frame. It must always be provided. 
InitialMacroPCA 
The output of the MacroPCA function on the initial (training) dataset. Must be provided. 
MacroPCApars 
The input options to be used for the prediction.
By default the options of InitialMacroPCA are used. For the complete list of
options see the function 
A list with components:
MacroPCApars 
the options used in the call. 
scaleX 
the scales of the columns of 
k 
the number of principal components. 
loadings 
the columns are the 
eigenvalues 
the 
center 
vector with the fitted center. 
It 
number of iteration steps. 
diff 
convergence criterion. 
X.NAimp 

scores 
scores of 
OD 
orthogonal distances of the rows of 
cutoffOD 
cutoff value for the OD. 
SD 
score distances of the rows of 
cutoffSD 
cutoff value for the SD. 
indrows 
row numbers of rowwise outliers. 
residScale 
scale of the residuals. 
stdResid 
standardized residuals. Note that these are 
indcells 
indices of cellwise outliers. 
NAimp 
various results for the NAimputed data. 
Cellimp 
various results for the cellimputed data. 
Fullimp 
various result for the fully imputed data. 
DDC 
result of DDCpredict which is the first step of MacroPCApredict.
See the function 
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)
checkDataSet
, cellMap
,
DDC
, DDCpredict
,
MacroPCA
library(MASS) set.seed(12345) n < 50; 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) MacroPCA.out < MacroPCA(x, 2) xnew < mvrnorm(n, rep(0,d), A) xnew[sample(1:(n * d), 50, FALSE)] < 10 predict.out < MacroPCApredict(xnew, MacroPCA.out) cellMap(xnew, predict.out$stdResid, columnlabels = 1:d, rowlabels = 1:n)