rrcov/0000755000176200001440000000000013610127007011402 5ustar liggesusersrrcov/NAMESPACE0000644000176200001440000001153313607356014012634 0ustar liggesusersuseDynLib(rrcov, .registration=TRUE) importFrom(stats4, plot, summary) importFrom(methods, show) importFrom("methods", "slot", "slotNames") importFrom("methods", "is", "new") importFrom(lattice, xyplot, panel.xyplot, panel.abline, ltext) importFrom(mvtnorm, rmvnorm) importFrom("grDevices", "dev.interactive", "palette") importFrom("graphics", "abline", "arrows", "axis", "box", "hist", "legend", "lines", "pairs", "par", "points", "rect", "strwidth", "text", "title") importFrom("stats", ".getXlevels", "cor", "cov", "cov.wt", "cov2cor", "dchisq", "density", "dnorm", "ecdf", "mad", "mahalanobis", "median", "model.matrix", "model.response", "na.fail", "pchisq", "pf", "pgamma", "pnorm", "princomp", "qchisq", "qf", "qnorm", "quantile", "rnorm", "runif", "sd", "terms", "uniroot", "var", "setNames") importFrom("utils", "combn") import(robustbase, pcaPP) export(CovClassic, Cov, CovRobust, CovMcd, CovMrcd, CovMrcd, CovMest, CovOgk, CovMve, CovSest, CovSde, CovMMest, CovControlMcd, CovControlMrcd, CovControlMest, CovControlOgk, CovControlMve, CovControlSest, CovControlSde, CovControlMMest, covMest, T2.test, Wilks.test, PcaClassic, PcaHubert, PcaLocantore, PcaCov, PcaProj, PcaGrid, LdaClassic, Linda, LdaPP, QdaClassic, QdaCov, pca.scoreplot, pca.distances, myscreeplot, mtxconfusion, sqrtm, vecnorm, getEllipse ) ##S3 generics S3method(T2.test, default) S3method(T2.test, formula) S3method(Wilks.test, default) S3method(Wilks.test, formula) S3method(Wilks.test, data.frame) S3method(Wilks.test, matrix) S3method(PcaClassic, default) S3method(PcaClassic, formula) S3method(PcaHubert, default) S3method(PcaHubert, formula) S3method(PcaLocantore, default) S3method(PcaLocantore, formula) S3method(PcaCov, default) S3method(PcaCov, formula) S3method(PcaProj, default) S3method(PcaProj, formula) S3method(PcaGrid, default) S3method(PcaGrid, formula) S3method(LdaClassic, default) S3method(LdaClassic, formula) S3method(Linda, default) S3method(Linda, formula) S3method(LdaPP, default) S3method(LdaPP, formula) S3method(QdaClassic, default) S3method(QdaClassic, formula) S3method(QdaCov, default) S3method(QdaCov, formula) ## S4 generics export(isClassic, getCenter, getScale, getCov, getCorr, getData, getDistance, getEvals, getMeth, getDet, getShape, getFlag, restimate, getQuan, getLoadings, getEigenvalues, getSdev, getScores, getPrcomp, scorePlot, getRaw, isSingular ) exportClasses(Cov, CovClassic, CovRobust, CovMcd, CovMest, CovOgk, CovMve, CovSest, CovSde, CovMMest, CovControl, CovControlMcd, CovControlMrcd, CovControlMest, CovControlOgk, CovControlMve, CovControlSest, CovControlSde, CovControlMMest, SummaryCov, SummaryCovRobust, Pca, PcaClassic, PcaRobust, PcaHubert, PcaLocantore, PcaCov, PcaProj, PcaGrid, SummaryPca, Lda, LdaClassic, LdaRobust, Linda, LdaPP, PredictLda, SummaryLda, Qda, QdaClassic, QdaRobust, QdaCov, PredictQda, SummaryQda, Ulist, Uvector, Utable, Umatrix, Ufunction ) exportMethods(isClassic, getCenter, getScale, getCov, getCorr, getData, getDistance, getEvals, getMeth, getDet, getFlag, getShape, plot, show, summary, restimate, getQuan, getLoadings, getEigenvalues, getSdev, getScores, getPrcomp, predict, screeplot, biplot, scorePlot, getRaw, isSingular, names ) rrcov/ChangeLog0000644000176200001440000006137413607362133013176 0ustar liggesusers2020-01-14 Valentin Todorov * * DESCRIPTION (Version): 1.5-2 * * R/getEllipse.R - Removed the dependence on packages 'cluster' and 'ellipse' * R/Linda - added parameter 'control' to select the robust location and * covariance estimator to use in LDA. Now any estimator derived from class 'Cov' * can be used, even such that are not in 'rrcov'. Return this parameter in the * returned S4 object. * * R/Linda - return the location and covariance estimator used as 'covobj'. This * is useful for controlling cross-validation, for example. * * R/Lda.R - fixed an issue in predict function * * R/LdaClassic, R/Linda - use generalized inverse if the common covariance * matrix is singular. * 2019-11-25 Valentin Todorov * * DESCRIPTION (Version): 1.4-9 * DESCRIPTION (Version): 1.4-8 * * - Added data set \code{diabetes}; data set \code{soil} from package \code{rrcovHD} moved here. * - Linear and quadratic discriminant analysis can use the MRCD estimates. * - Fixed an issue with CovControlMcd(nsamp="deterministic") - this would not work, * because nsamp was defined in the class definition as "numeric". Now it is * "Cnumeric" - union of "character" and "numeric'. * - Corrected the code for Minimum Regularized Covariance Determinant estimator (MRCD) - * \code{CovMrcd()} - the step of adjusting the eignevalues in r6pack() is excluded * now because it has no effect when n > p. * 2018-11-14 Valentin Todorov * * DESCRIPTION (Version): 1.4-7 * DESCRIPTION (Version): 1.4-6 * * R/CovMrcd.R, CovControlMrcd.R: added Minimum Regularized Covariance * Determinant estimator (MRCD) (Boudt et al. 2018) * * data/octane.rda, man/octane.Rd - octane data set added * data/olitos.rda, man/olitos.Rd - olitos data set moved from package rrcovHD * * R/CovClassic.R, plot-utils.R: make the 'pairs' plot also * available for classical covariance matrix * 2018-05-20 Valentin Todorov * * DESCRIPTION (Version): 1.4-4 * * vignettes/mybiblio.bib: Fixed issue with building * the vignette: non-ascii symbols in .bib * (see mail from K. Hornik from 14.05.2018) * src/rrcov_init.c: Registration of native routines * 2016-09-03 Valentin Todorov * * DESCRIPTION (Version): 1.4-3 * DESCRIPTION (Version): 1.4-2 * * src/sest.c: Warning reported by Duncan Murdoch: if(fabs(t <= cc)) * 2016-08-19 Valentin Todorov * * DESCRIPTION (Version): 1.4-1 * * R/Pca.R, PcaCov.R, PcaHubert.R, PcaLocantore.R, PcaClasic.R: * fixed a bug when scale != FALSE. * Now scale can be also a function or a vector with length p. * 2016-08-05 Valentin Todorov * * DESCRIPTION (Version): 1.4-0 * * R/PcaCov.R, Pca.R: fixed a bug when scale != FALSE; the call to princomp() * replaced by an internal function (simplified princomp()) * * R/Pca.R: fixed a bug when scale != FALSE - computing OD .distances() * * R/Linda.R: added argument l1med=FALSE - if set to TRUE, the L1 median * will be used for centering the data in mcdB and mcdC methods * 2016-02-10 Valentin Todorov * * DESCRIPTION (Version): 1.3-10 * * R/CovSest.r: additional trace for Rocke S-estimates * R/Pca.R, Allclasses.R, etc.: Add the quantile cut-off for computing the OD and SD distances in PCA as a parameter * R/PcaCov.R, etc.: Automatic selection of components with k=0 * * 2015-11-28 Valentin Todorov * * DESCRIPTION (Version): 1.3-9 * * 2015-07-07 * R/Pca.R, man/biplot.rd: The missing parameter choices= added to biplot() * * R/PcaXxx.R, man/PcaXxx.rd: added a parameter crit.pca.distances to be used * for computing the score and orthogonal distances. This parameter is stored * in the Pca-class object * * R/PcaXxx.R, man/PcaXxx.rd (except Grid and Proj): selection of number of * components fixed, see Help. * 2014-11-23 Valentin Todorov * * DESCRIPTION (Version): 1.3-7 * * src/sest.c: fixed an issue (reported by Stefan van Aelst) * in computing S-estimates, related to improper * calculation of the rank of a matrix with q() * 2014-11-05 Valentin Todorov * * DESCRIPTION (Version): 1.3-6 * * R/CovSest.R, dets.R, AllClasses.R, CovControl.R: added Deterministic S as * an option to CovSest (method="sdet"), function ..detSloc(), * new parameters and new slots in class CovSest. * * R/Pca.R, PcaClassic.R, pcaHubert.R: the internal functions classSVD() * and kernelEVD() are replaced by function classPC() which is moved * to robustbase * * R/CovMcd.R, AllClasses.R, CovControl.R - deterministic MCD, with nsamp="deterministic", * new parameters and new slots in class CovMcd * * tests/tsest.R: added tests method="sdet" * * R/CovSde, man/CovSde.Rd: a bug, when number of variables * too large, fixed. The number of variables is used to calculate * the necessary number of samples. If this number is large than * .Machine$integer.max an error message, saying NAs passed to * an external function was issued. Now the nsamp <= .Machine$integer.max * and in the documentation is explained that CovSde() can be used only * with relatively small data sets. * * R/CovMest3.R, man/CovMest3.Rd - function deprecated, * replaced by the one return ing an S4 class, CovMest(). * tests/tmest.R removed. * * TODO: fix a bug in C version of sfast * TODO fix a crash in CovOgk with a singular matrix * * 2013-09-01 Valentin Todorov * 1.3-5 * * R/Pca.R - definition of a print() method removed * Use suppressPackageStartupMessages(library(rrcov)) in the tests * * R/CovOgk.R - bug fixed (Chris Green): a data set with 0 (complete) rows * (n=0) would crash R with access violation * * R/CovClassic.R - the restriction "Need at least p=(number of variables) * observations" removed * * man/PcaHubert.Rd - % signs in the examples were not escaped and part of the * statements was missing * 2013-08-19 Valentin Todorov * 1.3-4 * * Changes, mainly to fix warnings in packages rrcovNA and rrcovHD * * Generic and method scoreplot changed to scorePlot to avoid * conflict with package pls * * Vignette moved to directory .\vignettes, as recommended in * the 'Writing R Extensions' manual * * NOTE "Namespace imported from by a ':::' call: ..." fixed for all * but two robustbase calls. * * Packages 'mvtnorm' and 'pcaPP' moved from Depends to Import and the particular * functions used are only imported (rmvnorm from 'mvtnorm' and PCAgrid * and PCAproj from 'pcaPP') * 2013-04-28 Valentin Todorov * 1.3-3 * * SRC/ds11.f: Fortran array bound check error fixed * * R/zzz.R: on.Load() replaced by on.Attach() to suppress a NOTE * * R/Pca.R: Fixed a problem in pca.scoreplot() - the ellipse was not * properly shown in case for example of PP PCA, when the scores can be correlated. 2012-06-10 Valentin Todorov * 1.3-02 * * R/Linda.R: Fixed a problem with array over-run in .Fortran("fsada") in integer argument 14 * * Method getRaw() for CovMcd, CovMve and CovOgk added * Union S4 classes Uvector, Umatrix, Ulist, Ufunction, Utable exported * in the name space * T2.test() fixed - the F statistic was shown but titled as "T^2". Now both * T2 and F are shown * 2011-06-26 Valentin Todorov * 1.3-01 * * Fix for LdaPP() * 2011-05-05 Valentin Todorov * 1.3-00 * * Added LdaPP() and the related classes - see Pires and Branco (2010) * 2011-04-30 Valentin Todorov * 1.2-02 * * R/plot-methods.R: fixed the pairs-plot for Cov objects - on the diagonal * were shown not the variable names but Var1, var2, etc. * * R/Pca.R, AllGenerics.R, Man/scoreplot.rda, pca.scoreplot.rda: * the internal function pca.scoreplot()is defined now in the namespace, * help is added and corresponding method/generic scoreplot() function * is defined too. * * Data/pottery.rda, Man/pottery.rd: added the pottery data set - * see Pires and Branco (2010) * * 2011-04-04 Valentin Todorov * 1.2-00 * R/CovSest.R, CovMMest.R, man/* - added slots for the tuning constants of * the S- and MM-loss functions. The functions for calculating these * constants (.csolve.bw.S() and .csolve.bw.MM() are not exported but the * user could access them using rrcov:::.csolve.bw.S() call * data/wages.rda - Added data set Wages and Hours * R/Pca.R - fixed the cutoff for the orthogonal distances (diagnostic plot)- * univariate MCD replaced by median and MAD 2010-08-30 Valentin Todorov * 1.1-00 * src/ds11.f - fixed a problem with CovSde for p=1 (i.e. option p=1 implemented) * R/CovSest.R, man/CovSest.Rd - default number of samples 'nsamp' for method='sfast' * changed to nsamp=20 * Added MM-estimates of location and scatter * Added methods getDet(), getShape() and getDflag() for objects of class 'Cov' * C implementation of the FAST-S estimates * signflip and scale parameters added to PcaHubert() and PcaCov() 2010-06-20 Valentin Todorov * 1.0-01 * data/rice.Rda, man/rice.Rd: Rice data set added * * R/PcaHubert.R - fixed a minor problem - see VT::14.12.2009 * * src/fsada.f: fixed a problem in Linda with method 'fsa' - * number of cases was limited to 500 and number of * variables to 100 without error message * R/Linda.R, man/Linda.Rd, src/fsada.f - added 'trace' parameter * * R/Allclasses.R, AllGenerics.R, PcaClassic.R, PcaLocantore.R, * RcaHubert.R, Pca.R, man/PcaClassic.Rd, PcaLocantore.Rd, * PcaClassic-class.Rd, PcaLocantore-class.Rd, Pca-class.Rd: * - added sign flipping for the loadings, controlled by a * signflip=TRUE parameter * - added a scale slot in Pca class and scale=FALSE parameter in * PcaClassic() and PcaLocantore() * * R/plot-utils.R, CovRobust.R, CovClassic: * - additional graphics parameters for the plot methods are available now, e.g. * different colors or different symbols for the different groups * - it is possible to provide custom labels for the id.n observations * - pairs-plot for more than 2 variables * 2009-10-10 Valentin Todorov * 1.0-00 * CITATION to the JSS paper added * Rd files updated to refer to the JSS paper * vignette added * ********************************************************** 2009-09-29 Valentin Todorov * 0.5-03 * citation file added * PcaCov can compute the classical estimates (cov.control=NULL) * 2009-07-21 Valentin Todorov * 0.5-02 * Defaults of CovRobust() changed * Corrections in some help pages * Biplot implemented as a method of class PCA (generic function biplot) * 2009-02-20 Valentin Todorov * 0.5-01 * * Added Quadratic Discriminant Abalyis: Qda, SummaryQda, * PredictQda, QdaClassic, QdaRobust and QdaCov * 2009-02-14 Valentin Todorov * 0.5-00 * * Added Stahel-Donoho estimator of multivariate location and scatter * CovSde 2009-01-14 Valentin Todorov * 0.4-08 * * data/salmon - data set added * Added Robust Linear Discriminant Analysis: * R/AllClasses, R/Lda.R, R/LdaClassic.R, R/Linda.R * and the corresponding manual pages: man/Lda*.Rd * * Added PP-approach PCA methods PcaProj and PcaGrid (see package pcaPP): * R/AllClasses, R/PcaProj.R, R/PcaGrid.R * and the corresponding manual pages: man/PcaProj*.Rd, man/PcaGrid*.Rd * 2008-07-04 Valentin Todorov * 0.4-07 * * data/un86 - data set added * * R/CovRobust.R - function to select a robust estimator added * * R/CovSest.R, man/CovSest.Rd, R/CovControlSest.R, man/CovControlSest.Rd - * added two more estimation methods for the S estimates: bisqauare and * Rocke type, as described in Maronna et al. (2006) - thanks to Matias * Salibian-Barrera for the provided code. * * R/CovMve.R, man/CovMve.Rd - now the raw cov matrix is properly scaled by * a factor median(dist)/qchisq(0.5, p) and the reweighted cov matrix is * multiplied by a consistency corretcion factor, similarly as in CovMcd(). * No finite sample correction factors are used. For details see ?CovMve. * * man/CovMve.Rd - the search for the approximate solution is explained * (fast MVE) and the corresponding referecne (Maronna et al., 2006) is given. * * R/CovMest.R, man/CovMest.Rd - the default initial value now is the raw * (not reweighted) MVE estimate with the covariance matrix standardised * to det(cov)=1 * * R/CovOgk.R, man/CovOgk.RD, src/covOPW.c, R/CovControlOgk.R, man/CovControlOgk.R * Added a C implementation for OGK - thanks to Kjell Konis. * See ?CovOgk for details * * R/plot-utils.R - fixed a bug in plot(CovMcd(x), which="tolEllipsePlot", id.n=0) - * even if id.n was set to 0, at least one observation was plotted with a label * 2008-06-02 Valentin Todorov * 0.4-06 * Added the 'bushmiss' - a group of data sets based on 'bushfire' * with added incompliteness (MCAR) with probability 0.1, * 0.2, 0.3 and 0.4 * Fixed minor errors in the documentation * Added PCA based on robust cov matrix - PcaCov * Added Spherical PCA algorithm - PcaLocantore * Added 'bus' data set - Automatic vehicle recognition data * as an illustration for the PCA methods. The examples reproduce * the corresponding examples from Maronna et al. (2006), page 213 2007-02-12 Valentin Todorov * 0.4-05 * Added the OsloTransect data set * Fixed minor errors in the documentation * Fixed two serious problems in .fastMve() - there was a * hard-coded seed setting and the half-sample was hardcoded too * Added S-estimates computed by either the FAST-S algorithm or * Ruppert's SURREAL 2007-11-10 Valentin Todorov * 0.4-03 * R/plot-utils.R - "Squared Robust distance" changed to "Robust distance", * added ylim parameter so that two parallel distance plots * (robust and classic) will have the same scale * man/getCenter-methods.Rd - there was an 'unmatched right brace' in line 34 - * shown as 'Note' in "R CMD install" but not in "R CMD check" * R/CovRobust.R - method 'plot' - make robust and classic distance * plot same scale * Added function Cov() as an alias to CovClassic() for compatibility with * previous versions * Function and class Robpca changed to PcaHubert - Robpca was too general * Added methods predict, screeplot and biplot for Pca 2007-10-24 Valentin Todorov * 0.4-02 * Fixed the OO-hierarchy for robust location and scatter: now * Cov is a VIRTUAL class and CovClassic added for representing * the classic estimates * CovMve added, to be used as initial solution for CovMest 2007-09-28 Valentin Todorov * 0.4-01 * Removed covMcd, ltsReg and all datasets which were already moved to * package robustbase. Now package robustbase is required and these * functions are used from there. This could cause some minor * incompatibilities because of changed parameters in covMcd(), like: * - trace=FALSE instead of print.it=FALSE * - seed=NULL instead of seed=0 * - changed structure and names of datasets 2007-09-24 Valentin Todorov * 0.3-08 * Added ROBPCA - Robust Principal Component Analysis - with an * S4 object model R/Pca.R, R/PcaClassic, R/Robpca and * man/Pca-class.RD, man/PcaRobust-class.Rd, man/PcaClassic-class.RD * man/Robpca-class.RD, man/PcaClassic.RD, man/Robpca.RD 2007-09-20 Valentin Todorov * 0.3-07 * Added classical and robust Wilks Lambda test - R/Wilks.test.R and * man/Wilks.test.RD 2007-07-05 Valentin Todorov * 0.3-06 * Added one- and two-sample T2 Hotelling test and one-sample * robust T2 Hotelling test (Willems et al. 2002) - R/T2.test.R and * man/T2.test.RD * R/covMcd.R: usage of simulated finite sample correction factors fixed: * - case p=1 fixed * - simulated corrections used only when the Pison et.al. * formula is definitely wrong (negative or very large) * Added the L-moments data sets from Hosking and Wallis (1997): * Appalachia, Cascades, lmom32 and lmom33 * Fixed print.mcd() to avoid conflict with package 'robust' * (same class "mcd") * R/covMcd.R - the calculation of the consistency correction factor * for the raw and reweighted MCD covariance replaced by a call to * a function MCDcons() * R/CovRobust.R, Cov.R, AllGenerics.R, utils.R - fixed the plot * method of CovRobust in case of singular covariance matrix 2006-12-21 Valentin Todorov * 0.3-05 * fixed a bug in ltsReg (in the QQ-plot were plotted the residuals instead * of the standardized reisuals) * added dataset 'Fish Catch Data' * added dataset 'Hemophilia' 2006-09-07 Valentin Todorov * 0.3-04 * name the partial= argument of the sort function in covMcd3.R - * necessary for the coming R 2.4.0 2006-07-08 Valentin Todorov * 0.3-03 * Remove CRLF line endings of the files *.Rout.save in rrcov/tests directory 2006-06-01 Valentin Todorov * 0.3-02 * add CovControlMcd function and CovControlMcd-class * add CovMcd function and CovMcd-class * add CovControlOgk function and CovControlOgk-class * add CovOgk function and CovOgk-class 2006-05-21 Valentin Todorov * 0.3-01 * NAMESPACE: add importFrom(stats4, plot, summary) * add Marona and Yohai data set * add Cov function and Cov-class * add CovControl-class * add CovControlMest function and CovControlMest-class * add CovRobust-class * add CovMest function and CovMest-class 2006-03-13 Valentin Todorov * 0.2-13 * defined package namespace * added constrained M-estimates (Rocke (1994,1996)) 2006-02-10 Valentin Todorov * 0.2-12 * FIXED - .fastmcd and fastlts does not return everything * fixed problems in ltsReg in case of location model Y~1 (or x is missing in ltsReg.default()) 2006-02-06 Valentin Todorov * 0.2-11 * added more data sets from Rousseeuw & Leroy: telef, lactic, pension, pilot, cloud, education, airmay * fixed codoc discrepancies in the data sets stars and wood * ltsReg & covMcd - added options 'best' and 'exact' for nsamp * ltsReg & covMcd - added parameter for controlling the small sample correction factors - use.correction * rrcov.control - added parameter for controlling the small sample correction factors - use.correction * ltsReg & covMcd - output of the consistency and the small sample correction factors 2005-10-24 Valentin Todorov * 0.2-10 * minor corrections in the help of covPlot * fixed bug in covPlot in case of class=TRUE * tolellipse - both robust and classical ellipse are superimposed * added directory inst/bm containing benchmarks comparing covMcd and ltsReg to the corresponding functions in MASS, S-PLUS and Matlab 2005-10-17 Valentin Todorov * 0.2-9 * minor corrections in the help of covMcd * minor correction in ltsReg (false corrected to FALSE) * covMcd - fixed the limitation on the number of variables <= 50 * ltsReg - fixed the limitation on the number of variables <= 50 * added function summary.mcd which prints (additionally to the output of print.mcd) the correlation matrix (if requested), the eigenvalues of the covariance or correlation matrix and the robust distances. * added control object for the estimation options rrcov.control and used in covMcd and ltsReg 2005-09-20 Valentin Todorov * 0.2-8 * ltsReg: added formula interface * ltsReg: adde generic functions summary.lts and print.summary.lts * ltsReg: fixed a problem with reordering of the coeficients even in case without intercept 2005-04-16 Valentin Todorov * 0.2-7 * ltsReg: fixed a bug related to nsamp -> it was hard-coded = 500 in Fortran * ltsPlot: default for id.n changed - instead of 3, now it is the number of identified outliers * ltsPlot: help enhanced * covMcd, covPlot, tolellipse: tol.inv parameter changed to tol, according the change in mahalanobis() in 2.1.0 2004-12-26 Valentin Todorov * 0.2-6 * a bug in ltsReg (rsquared) fixed * fixed CRLF line endings in FORTRAN sources * fixed a problem in covMcd: in case of p=1 and cov=[0], the cov matrix was a double instead of a matrix, which resulted in errors in subsequent calls (e.g. determinant(mcd$cov) expects a matrix) * fixed a problem in ltsReg when p==1 and Intercept==FALSE - the vectors of coefficients ans$coefficients and ans$raw.coefficients were of size 2 * error handling added in ltsReg in case of scale=0 2004-09-16 Valentin Todorov * 0.2-5 * several errors in doc fixed (ltsPlot.Rd, covPlot.Rd, aircraft.Rd) 2004-09-16 Valentin Todorov * 0.2-4 * added Regression Diagnostic Plots - function ltsPlot() * ...added Normal QQ Plot of the residuals * ...added Standardized Residuals versus index plot * ...added Standardized Residuals versus fitted values plot * ...added Regression diagnostic plot * ltsReg: the responce variable Y added to the result object * covMcd: fixed a bug related to nsamp -> it was hard-coded = 500 in Fortran * covMcd: fixed a bug - in case of alpha=1 * added S3 methods plot.mcd and plot.lts * the S3 methods print.mcd and print.lts moved to separate R files * added the stars data set (Hertzsprung-Russell diagram) 2004-07-13 Valentin Todorov * 0.2-3 * improved documentation of the datasets * added datasets aircraft and delivery * added Covariance Plots - function covPlot() * ...added Distance Plot - function distplot() * ...added Distance-Distance Plot - function ddplot() * ...added Chisquare QQ-Plot - function chi2qqplot() * ...added Tolerance Ellipse Plot - function tolellipse() * added function print.lts (for ltsReg result); included in the test tlts.R * added function print.mcd (for covMcd result); included in the test tmcd.R 2004-06-26 Valentin Todorov * 0.2-2 * fixed bug in Fortran: rfltsreg.f, xrfnbreak() * Depends >= 1.8 (it was >= 1.9, because of the bug above) * Parameter, controlling whether to perform intercept adjustment at each step added to ltsReg and its default value set to FALSE rrcov/data/0000755000176200001440000000000013607354177012333 5ustar liggesusersrrcov/data/soil.rda0000644000176200001440000000452713002255751013764 0ustar liggesusersYhGeIK#GjZ|o4R$%gQP4,RHPhҾ!%RhK ]$]Hq tSpӖBkGky̜ߙxtochiK;s9+4:<)+B䯜P~(59vhB(W^)M΅ҟM=~k?6?$/w:8?WzNo<[ϝvo<95 C^c^w*y;''_L~n/E>6c"?:(3WEϧ/z),,|@[e1M׈|hKo3]Nԙ 63iS4VM[~t~Ye|@y65;mӎd܌{ď]M}& |m}# ?ķ2}TمtƃSa>gv0tϋ'$w_G}F,vLp˒T R=@y$W씏 ?鰪L?W&p5ca^y#b?|ȣ}O?y߆S&Lz/N+?y3/yh<1<W|UyB-)<+Q1}Te[;bx*"E 8+[2J<(%25xȡ^Gx?s\{yzA}2?8>y2y/#9ė+v7ٿ~׃#+^TCG朶J &ur@mel^.s"/ ȳ>΁/y#%!<|Z{gݬoҸುeߢA&gnbJ=u_K}Գ&]Gq4SNkډN5y,>΃KڸwxWyzqOoF4S/]}r?<;dx;Ľ\Cy'/^7oxkc#ɣ':yB;v4{uTG#wލwf;.vp6S5G-sN=\}w-"lþދ78xEm3}m=K幜{8 Xozoh NV`^s~ df87/?䙙o?.w}p+_:㲜̻B'}ԝi=|,O·L{gय़73^Os\ 1}?a;u^qJxh^Kc]o2i9]wΪX=Q\{x5%R}Sߏg{%8q_]%}' U)8xfXKy(O<_;߆}>XelqJ^מ뻻mQ--Q$bѰ%ڢ-["^K=l6qL#K/mYڛdÇu:zz{}#Ћ99Ļ^K"6HnX"o$u؋::x8KQ^9sԕyy=Gy^߬}Ƿo;w|v}Ƿo;w|v;\z1,n˲w9F~^ߡ;9b8b,Y}Ge,ƒwTfc;a/9/́%ᨿ쾣2;*s9jswT_^Hǐ g[&IϿo#rrcov/data/bushmiss.rda0000644000176200001440000000217012763517421014653 0ustar liggesusersNSALJ/M_ Dcʈ|{K)m@7Gh|G`鲏Х+6?g2gm{Μ9sǙjX{45/STuz2b.yX)5BL=q턢v=]wZnޔ*-]߁țkuy7Sz V7ϰt{ya#Wa}mKsMˋ93^j}[xQ=+/|_);Zĺ_ \7}ߐ9__ "ǥyԃ1^]j#'!߹t:kx>qx{Aw@(J^//mħe=:K=J?e=K=W?$^cK>GnJ^iϣ7^c[G:1C}Cpv_juLuZE^.5k*}=4gTїOXoK9}[o+2յwXIsAԋoE z4?~?$rrcov/data/maryo.rda0000644000176200001440000000070012763517421014142 0ustar liggesusers r0b```b`f@& `d`aҬE@> Gc ^'o1BΡw N[P`+쯳NojdW ݲq n?Ef|'VO߫ʆo]_sag'1>gv?fUU]en<x7.{㚘۫O2ۦ{X}银r?w*7mhlaR'?銉I/k }Un ٟNՎg_{z}dO>?^PcS_(v%x6zWnQeT^oR~ eNRg`(J8JsSla@,fC0YFP!:@1rrcov/data/pottery.rda0000644000176200001440000000155112763517421014526 0ustar liggesusersUKLSA}çRSт*CaM#Mi/tÆkb\aҸ5qBʎs`I;̽ޙ93aܷ3 ek_3c48n%oۙªa[WJecމ罕|<_8քxdP'z%/J6/I? x%}BoȐd5(QG?}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^/veσaZ ww]dqQ eAH/m >@ .-=adE2-^۴Kϭ=ufRtBuw@] pتE5krf38!t=INXRhsjFFّ8ăqy;j|?;%JQ)Ӝm ugvL3=~ >,}TU_`rmJɤ9U>7Mbq&ׯ]bb}(8#X2J-L{ ? G>?]Jj =+zl&*`J ~3G-v8 !|7 E^{F ;7׻g_>0 YZrrcov/data/Cascades.rda0000644000176200001440000000126512763517421014530 0ustar liggesusers r0b```b`f@& `d`aΉɉ) @>H %&o=yj#c"B{welT~Ro{|%NO;~Oηߧѩxj<߳"G)~ige[:uFC[js-3 ֌wߊ?b[TKۯϿ$IjZ.,Sy;T+دɪy[JۛIWl!{KUiuB?[];S/N޿px#Te ok2{ZYC5Ξ: nC^= #B`IYGY]wiA \?{&o®^?䰽$~yOTYmk y6PCGu@!ygG>DG9 -N-K-.FdgY_l0T3416FY!,<#Kd)34@Rinhf366D" 315D`bjhp gbnʳD͑YxhវX & WJbI^Z0 orrcov/data/lmom33.rda0000644000176200001440000000112612763517421014130 0ustar liggesusers r0b```b`f@& `d`al9 @H/mZIѧ?q}-<;;.ˁ[|E#'|kncoRKfpy ϩ]TI AYovg'XA~S$ om+:@r%EţYt %װ?hFnn_ߢu^IDxW;lsMLDpd(4Hݿ1pF qnF)2{Os:1@]lY=7 @n 951먷95ji@y"rUb= (G{HR`sc#f1F̵5,пdOB6cQU?7wq4>#-;[:|'عD= nhYƽі?gX =Ѷb5&aߒIA/'bL<9QBO"ݡ8x'$\QgHY,ĘHqqOы!y6; q ]j] `C}?P/ 9ޖKvIR[Cff_gV~#mx9`pʣ_;lPyvao23S~~rUwx֠#` 6ߝ?&P{2.^49F.^#f¦C)$0=V~GQ秦d+})"!>x94C:m1=* Dq9(HҚ_}xgOn*#g4精>iOc8L* <+fz}sg_{y?t/+NxJz389^ΓWqR=e}"d9=?#UY<z^^#5,Dl2K2*P\˂Ee*^~(Rqg(_G X1үΐ4kUQJ鮫YZ3 FG75e w$xU^ rrcov/data/hemophilia.rda0000644000176200001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Bh'@V1* %kŨ bTpЪiPhQ5& Ф :ZZFZa+ "4#MV&a^ R7tr-4.#\qiTSb|Ԅ 3}BͲrrcov/man/0000755000176200001440000000000013607360210012156 5ustar liggesusersrrcov/man/PcaLocantore.Rd0000644000176200001440000001256412763517421015041 0ustar liggesusers\name{PcaLocantore} \alias{PcaLocantore} \alias{PcaLocantore.formula} \alias{PcaLocantore.default} \title{ Spherical Principal Components} \description{ The Spherical Principal Components procedure was proposed by Locantore et al., (1999) as a functional data analysis method. The idea is to perform classical PCA on the data, \ projected onto a unit sphere. The estimates of the eigenvectors are consistent and the procedure is extremely fast. The simulations of Maronna (2005) show that this method has very good performance. } \usage{ PcaLocantore(x, ...) \method{PcaLocantore}{default}(x, k = ncol(x), kmax = ncol(x), delta = 0.001, na.action = na.fail, scale = FALSE, signflip = TRUE, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaLocantore}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, the algorithm itself will determine the number of components by finding such \code{k} that \eqn{l_k/l_1 >= 10.E-3} and \eqn{\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j >= 0.8}. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=ncol(x)}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{delta}{an accuracy parameter} \item{scale}{a value indicating whether and how the variables should be scaled to have unit variance (only possible if there are no constant variables). If \code{scale=FALSE} (default) or \code{scale=NULL} no scaling is performed (a vector of 1s is returned in the scale slot). If \code{scale=TRUE} the data are scaled by \code{mad}. Alternatively it can be a function like \code{sd} or \code{Qn} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the scale slot. Default is \code{scale=FALSE}.} \item{signflip}{a logical value indicating wheather to try to solve the sign indeterminancy of the loadings - ad hoc approach setting the maximum element in a singular vector to be positive. Default is \code{signflip = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } \details{ \code{PcaLocantore}, serving as a constructor for objects of class \code{\link{PcaLocantore-class}} is a generic function with "formula" and "default" methods. For details see the relevant references. } \value{ An S4 object of class \code{\link{PcaLocantore-class}} which is a subclass of the virtual class \code{\link{PcaRobust-class}}. } \references{ N. Locantore, J. Marron, D. Simpson, N. Tripoli, J. Zhang and K. Cohen K. (1999), Robust principal components for functional data. Test, 8, 1-28. R. Maronna, D. Martin and V. Yohai (2006), Robust Statistics: Theory and Methods. Wiley, New York. R. Maronna (2005). Principal components and orthogonal regression based on robust scales. Technometrics, 47, 264-273. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} The SPC algorithm is implemented on the bases of the available from the web site of the book Maronna et al. (2006) code \url{http://www.wiley.com/legacy/wileychi/robust_statistics/} } %\note{} \examples{ ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaLocantore(hbk) pca ## Compare with the classical PCA prcomp(hbk) ## or PcaClassic(hbk) ## If you want to print the scores too, use print(pca, print.x=TRUE) ## Using the formula interface PcaLocantore(~., data=hbk) ## To plot the results: plot(pca) # distance plot pca2 <- PcaLocantore(hbk, k=2) plot(pca2) # PCA diagnostic plot (or outlier map) ## Use the standard plots available for for prcomp and princomp screeplot(pca) biplot(pca) } \keyword{robust} \keyword{multivariate} rrcov/man/pca.distances.Rd0000644000176200001440000000341012763517421015174 0ustar liggesusers\name{pca.distances} \alias{pca.distances} \title{ Compute score and orthogonal distances for Principal Components (objects of class 'Pca') } \description{ Compute score and orthogonal distances for an object (derived from)\code{\link{Pca-class}}. } \usage{ pca.distances(obj, data, r, crit=0.975) } \arguments{ \item{obj}{an object of class (derived from) \code{"Pca"}.} \item{data}{The data matrix for which the \code{"Pca"} object was computed.} \item{r}{rank of data} \item{crit}{Criterion to use for computing the cutoff values.} } \details{ This function calculates the score and orthogonal distances and the appropriate cutoff values for identifying outlying observations. The computed values are used to create a vector a of flags, one for each observation, identifying the outliers. } \value{ An S4 object of class derived from the virtual class \code{\link{Pca-class}} - the same object passed to the function, but with the score and orthogonal distances as well as their cutoff values and the corresponding flags appended to it. } \references{ M. Hubert, P. J. Rousseeuw, K. Vanden Branden (2005), ROBPCA: a new approach to robust principal components analysis, \emph{Technometrics}, \bold{47}, 64--79. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} \examples{ ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaHubert(hbk) pca.distances(pca, hbk, rankMM(hbk)) } \keyword{robust} \keyword{multivariate} rrcov/man/getEllipse.Rd0000644000176200001440000000220513607355574014562 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot-utils.R \name{getEllipse} \alias{getEllipse} \title{Calculates the points for drawing a confidence ellipsoid} \usage{ getEllipse(loc = c(0, 0), cov = matrix(c(1, 0, 0, 1), ncol = 2), crit = 0.975) } \arguments{ \item{loc}{location vector} \item{cov}{a \code{pXp} covariance matrix} \item{crit}{the confidence level, default is \code{crit=0.975}} } \value{ A matrix with two columns containing the calculated points. } \description{ A simple function to calculate the points of a confidence ellipsoid, by default \code{dist=qchisq(0.975, 2)} } \examples{ data(hbk) cc <- cov.wt(hbk) e1 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2]) e2 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2], crit=0.99) plot(X2~X1, data=hbk, xlim=c(min(X1, e1[,1], e2[,1]), max(X1,e1[,1], e2[,1])), ylim=c(min(X2, e1[,2], e2[,2]), max(X2,e1[,2], e2[,2]))) lines(e1, type="l", lty=1, col="red") lines(e2, type="l", lty=2, col="blue") legend("topleft", legend=c(0.975, 0.99), lty=1:2, col=c("red", "blue")) } \author{ Valentin Todorov, \email{valentin.todorov@chello.at} } rrcov/man/covMest-deprecated.Rd0000644000176200001440000001222212763517421016174 0ustar liggesusers\name{covMest} \alias{covMest} % \title{Constrained M-Estimates of Location and Scatter} \concept{High breakdown point} \description{ Computes constrained M-Estimates of multivariate location and scatter based on the translated biweight function (\sQuote{t-biweight}) using a High breakdown point initial estimate. The default initial estimate is the Minimum Volume Ellipsoid computed with \code{\link{CovMve}}. The raw (not reweighted) estimates are taken and the covariance matrix is standardized to determinant 1. } \usage{ covMest(x, cor=FALSE, r = 0.45, arp = 0.05, eps=1e-3, maxiter=120, control, t0, S0) } \arguments{ \item{x}{a matrix or data frame. } \item{cor}{should the returned result include a correlation matrix? Default is \code{cor = FALSE}}. \item{r}{ required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is 0.45} \item{arp}{ asympthotic rejection point, i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{0.05}.} \item{eps}{ a numeric value specifying the relative precision of the solution of the M-estimate. Defaults to \code{1e-3}} \item{maxiter}{ maximum number of iterations allowed in the computation of the M-estimate. Defaults to 120} \item{control}{ a list with estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} \item{t0}{ optional initial high breakdown point estimates of the location. If not supplied MVE will be used. } \item{S0}{ optional initial high breakdown point estimates of the scatter. If not supplied MVE will be used. } } \details{ Rocke (1996) has shown that the S-estimates of multivariate location and scatter in high dimensions can be sensitive to outliers even if the breakdown point is set to be near 0.5. To mitigate this problem he proposed to utilize the translated biweight (or t-biweight) method with a standardization step consisting of equating the median of \code{rho(d)} with the median under normality. This is then not an S-estimate, but is instead a constrained M-estimate. In order to make the smooth estimators to work, a reasonable starting point is necessary, which will lead reliably to a good solution of the estimator. In \code{covMest} the MVE computed by \code{\link{CovMve}} is used, but the user has the possibility to give her own initial estimates. } \note{ The psi, rho and weight functions for the M estimation are encapsulated in a virtual S4 class \code{PsiFun} from which a \code{PsiBwt} class, implementing the translated biweight (t-biweight), is dervied. The base class \code{PsiFun} contains also the M-iteration itself. Although not documented and not accessibale directly by the user these classes will form the bases for adding other functions (biweight, LWS, etc.) as well as S-estimates. } \author{Valentin Todorov \email{valentin.todorov@chello.at}, (some code from C. Becker - http://www.sfb475.uni-dortmund.de/dienst/de/content/struk-d/bereicha-d/tpa1softw-d.html) } \value{ An object of class \code{"mest"} which is basically a \code{\link{list}} with the following components. This class is "derived" from \code{"mcd"} so that the same generic functions - \code{print}, \code{plot}, \code{summary} - can be used. NOTE: this is going to change - in one of the next revisions \code{covMest} will return an S4 class \code{"mest"} which is derived (i.e. \code{contains}) form class \code{"cov"}. \item{center}{the final estimate of location.} \item{cov}{the final estimate of scatter.} \item{cor}{the estimate of the correlation matrix (only if \code{cor = TRUE}).} \item{mah}{mahalanobis distances of the observations using the M-estimate of the location and scatter.} \item{X}{the input data as a matrix.} \item{n.obs}{total number of observations.} \item{method}{character string naming the method (M-Estimates).} \item{call}{the call used (see \code{\link{match.call}}).} } \references{ D.L.Woodruff and D.M.Rocke (1994) Computable robust estimation of multivariate location and shape on high dimension using compound estimators, \emph{Journal of the American Statistical Association}, \bold{89}, 888--896. D.M.Rocke (1996) Robustness properties of S-estimates of multivariate location and shape in high dimension, \emph{Annals of Statistics}, \bold{24}, 1327-1345. D.M.Rocke and D.L.Woodruff (1996) Identification of outliers in multivariate data \emph{Journal of the American Statistical Association}, \bold{91}, 1047--1061. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \seealso{ \code{\link[robustbase]{covMcd}} } \keyword{robust} \keyword{multivariate} rrcov/man/rrcov-utils.Rd0000644000176200001440000000413112763517421014747 0ustar liggesusers\name{rrcov-utils} \title{Different utility functions to be used in rrcov and packages depending on rrcov} \alias{myscreeplot} % plots screeplots for two covariance matrices \alias{mtxconfusion} % computes a confusion matrix %% %% MATLAB-like functions %% \alias{sqrtm} % returns the square root of a symetric positive definite matrix %\alias{ones} % returns a nxp matrix filled with ones %\alias{zeros} % returns a nxp matrix filled with zeros \alias{vecnorm} % returns the norm of a vector %\alias{repmat} % replicates a matrix \usage{ myscreeplot(rcov, ccov) mtxconfusion(actual, predicted, prior = NULL, printit=FALSE) sqrtm(A) % ones(n=1, p=1) % zeros(n=1, p=1) % repmat(A, n, p) } \arguments{ \item{A}{A matrix.} \item{tol}{Optional numerical tolerance (compared to singular values).} \item{sv}{A vector of non-increasing singular values of a matrix A, if already computed.} \item{rcov, ccov}{Covariance matrices.} \item{n}{Number of rows.} \item{p}{Number of columns.} \item{actual}{Actual class membership.} \item{predicted}{Predicted class membership.} \item{prior}{Prior probabilities.} \item{printit}{Wheather to print the results.} } \description{ Different utility functions to be used in rrcov and packages depending on rrcov: \itemize{ \item \code{myscreeplot} Plots screeplots for two covariance matrices \item \code{mtxconfusion} Computes a confusion matrix between actual and predicted class membership \item MATLAB-like functions \itemize{ \item \code{sqrtm} Returns the square root of a symetric positive definite matrix \item \code{ones} Returns a nxp matrix filled with ones \item \code{zeros} Returns a nxp matrix filled with zeros \item \code{vecnorm} Returns the norm of a vector \item \code{rankMM} Returns the rank of the matrix \item \code{repmat} Replicates a matrix } } } %\details{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} \keyword{internal} rrcov/man/CovControlOgk.Rd0000644000176200001440000000625513565032244015214 0ustar liggesusers\name{CovControlOgk} \alias{CovControlOgk} % \title{ Constructor function for objects of class "CovControlOgk" } \description{ This function will create a control object \code{CovControlOgk} containing the control parameters for \code{CovOgk} } \usage{ CovControlOgk(niter = 2, beta = 0.9, mrob = NULL, vrob = .vrobGK, smrob = "scaleTau2", svrob = "gk") } \arguments{ \item{niter}{ number of iterations, usually 1 or 2 since iterations beyond the second do not lead to improvement. } \item{beta}{ coverage parameter for the final reweighted estimate } \item{mrob}{ function for computing the robust univariate location and dispersion - one could use the \code{tau scale} defined in Yohai and Zamar (1998), see \code{\link[robustbase]{scaleTau2}}. The C version of this function defined by \code{smrob} is the default. } \item{vrob}{ function for computing robust estimate of covariance between two random vectors - one could use the function proposed by Gnanadesikan and Kettenring (1972), see \code{\link[robustbase]{covOGK}()}. The C version of this function defined by \code{svrob} is the default. } \item{smrob}{ a string indicating the name of the function for computing the robust univariate location and dispersion - defaults to \code{scaleTau2} - the scale tau function defined in Yohai and Zamar (1998) } \item{svrob}{ a string indicating the name of the function for computing robust estimate of covariance between two random vectors - defaults \code{gk}, the one proposed by Gnanadesikan and Kettenring (1972) } } \details{ If the user does not specify a scale and covariance function to be used in the computations or specifies one by using the arguments \code{smrob} and \code{svrob} (i.e. the names of the functions as strings), a native code written in C will be called which is by far faster than the R version. If the arguments \code{mrob} and \code{vrob} are not NULL, the specified functions will be used via the pure R implementation of the algorithm. This could be quite slow. } \value{ A \code{CovControlOgk} object } \references{ Maronna, R.A. and Zamar, R.H. (2002) Robust estimates of location and dispersion of high-dimensional datasets; \emph{Technometrics} \bold{44}(4), 307--317. Yohai, R.A. and Zamar, R.H. (1998) High breakdown point estimates of regression by means of the minimization of efficient scale \emph{JASA} \bold{86}, 403--413. Gnanadesikan, R. and John R. Kettenring (1972) Robust estimates, residuals, and outlier detection with multiresponse data. \emph{Biometrics} \bold{28}, 81--124. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\seealso{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlOgk", beta=0.95) ctrl2 <- CovControlOgk(beta=0.95) data(hbk) CovOgk(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/PredictQda-class.Rd0000644000176200001440000000251112763517421015601 0ustar liggesusers\name{PredictQda-class} \docType{class} \alias{PredictQda-class} \alias{show,PredictQda-method} \title{Class "PredictQda" - prediction of "Qda" objects } \description{ The prediction of a "Qda" object } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PredictQda", ...)} but most often by invoking 'predict' on a "Qda" object. They contain values meant for printing by 'show'} \section{Slots}{ \describe{ \item{\code{classification}:}{a factor variable containing the classification of each object } \item{\code{posterior}:}{a matrix containing the posterior probabilities } \item{\code{x}:}{ matrix with the discriminant scores } \item{\code{ct}:}{re-classification table of the training sample} } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "PredictQda")}: prints the results } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Qda-class}} } \examples{ showClass("PredictQda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/T2.test.Rd0000644000176200001440000000732712763517421013733 0ustar liggesusers\name{T2.test} \alias{T2.test} \alias{T2.test.default} \alias{T2.test.formula} \title{Robust Hotelling T2 test} \description{ Performs one and two sample Hotelling T2 tests as well as robust one-sample Hotelling T2 test } \usage{ T2.test(x, \dots) \method{T2.test}{default}(x, y = NULL, mu = 0, conf.level = 0.95, method=c("c", "mcd"), \dots) \method{T2.test}{formula}(formula, data, subset, na.action, \dots) } \arguments{ \item{x}{a (non-empty) numeric data frame or matrix.} \item{y}{an optional (non-empty) numeric data frame or matrix.} \item{mu}{an optional (non-empty) numeric vector of data values (or a single number which will be repeated p times) indicating the true value of the mean (or difference in means if you are performing a two sample test).} \item{conf.level}{confidence level of the interval} \item{method}{the method to be used - 'c' for sample mean and covariance matrix and 'mcd' for minimum covariance determinant estimator. A two-sample MCD based T2-test is not yet implemented.} \item{formula}{a formula of the form \code{lhs ~ rhs} where \code{lhs} is a numeric data frame or matrix giving the observations and \code{rhs} a factor with two levels giving the corresponding groups.} \item{data}{an optional matrix or data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}. By default the variables are taken from \code{environment(formula)}.} \item{subset}{an optional vector specifying a subset of observations to be used (currently not used)} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. Defaults to \code{getOption("na.action")} (currently only "na.rm" used)} \item{\dots}{further arguments to be passed to or from methods.} } \details{ The formula interface is only applicable for the two-sample tests. } \value{ A list with class \code{"htest"} containing the following components: \item{statistic}{the value of the T2-statistic.} \item{parameter}{the degrees of freedom for the T2-statistic.} \item{p.value}{the p-value for the test.} \item{conf.int}{a confidence interval for the mean vector appropriate to the specified alternative hypothesis.} \item{estimate}{the estimated mean vector or vectors depending on whether it was a one-sample test or a two-sample test.} \item{null.value}{the specified hypothesized value of the mean or mean difference depending on whether it was a one-sample test or a two-sample test.} \item{alternative}{a character string describing the alternative hypothesis.} \item{method}{a character string indicating what type of T2-test was performed.} \item{data.name}{a character string giving the name(s) of the data.} } \references{ Willems G., Pison G., Rousseeuw P. and Van Aelst S. (2002), A robust hotelling test, \emph{Metrika}, \bold{55}, 125--138. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } %\note{} \seealso{ \code{\link{CovMcd}}} \examples{ ## One-sample classical test data(delivery) delivery.x <- delivery[,1:2] T2.test(delivery.x) ## One-sample robust test data(delivery) delivery.x <- delivery[,1:2] T2.test(delivery.x, method="mcd") ## Two-sample classical test data(hemophilia) grp <-as.factor(hemophilia[,3]) x <- hemophilia[which(grp==levels(grp)[1]),1:2] y <- hemophilia[which(grp==levels(grp)[2]),1:2] T2.test(x,y) ## or using the formula interface T2.test(as.matrix(hemophilia[,-3])~hemophilia[,3]) \dontrun{ ## Two-sample robust test T2.test(x,y, method="mcd") ## error - not yet implemented }} \keyword{htest} \keyword{multivariate} rrcov/man/CovMcd.Rd0000644000176200001440000001434713565047777013660 0ustar liggesusers\name{CovMcd} \alias{CovMcd} % \title{ Robust Location and Scatter Estimation via MCD } \description{ Computes a robust multivariate location and scatter estimate with a high breakdown point, using the \sQuote{Fast MCD} (Minimum Covariance Determinant) estimator. } \usage{ CovMcd(x, raw.only=FALSE, alpha=control@alpha, nsamp=control@nsamp, scalefn=control@scalefn, maxcsteps=control@maxcsteps, initHsets=NULL, save.hsets=FALSE, seed=control@seed, trace=control@trace, use.correction=control@use.correction, control=CovControlMcd(), ...) } \arguments{ \item{x}{a matrix or data frame. } \item{raw.only}{should only the \dQuote{raw} estimate be returned.} \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{nsamp}{ number of subsets used for initial estimates or \code{"best"}, \code{"exact"} or \code{"deterministic"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time. For \code{"deterministic"}, the \emph{deterministic} MCD is computed; as proposed by Hubert et al. (2012) it starts from the \eqn{h} most central observations of \emph{six} (deterministic) estimators. } \item{scalefn}{\code{\link{function}} to compute a robust scale estimate or character string specifying a rule determining such a function, see \code{\link{rrcov.control}}.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{initHsets}{NULL or a \eqn{K x h} integer matrix of initial subsets of observations of size \eqn{h} (specified by the indices in \code{1:n}).} \item{save.hsets}{(for deterministic MCD) logical indicating if the initial subsets should be returned as \code{initHsets}.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{use.correction}{ whether to use finite sample correction factors. Default is \code{use.correction=TRUE}} \item{control}{ a control object (S4) of class \code{\link{CovControlMcd-class}} containing estimation options - same as these provided in the function specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} \item{\dots}{potential further arguments passed to \pkg{robustbase}'s \code{\link[robustbase]{covMcd}}.} } \details{ This function computes the minimum covariance determinant estimator of location and scatter and returns an S4 object of class \code{\link{CovMcd-class}} containing the estimates. The implementation of the function is similar to the existing \R function \code{\link[robustbase]{covMcd}()} which returns an S3 object. The MCD method looks for the \eqn{h (> n/2)} observations (out of \eqn{n}) whose classical covariance matrix has the lowest possible determinant. The raw MCD estimate of location is then the average of these \eqn{h} points, whereas the raw MCD estimate of scatter is their covariance matrix, multiplied by a consistency factor and a finite sample correction factor (to make it consistent at the normal model and unbiased at small samples). Both rescaling factors are returned also in the vector \code{raw.cnp2} of length 2. Based on these raw MCD estimates, a reweighting step is performed which increases the finite-sample efficiency considerably - see Pison et al. (2002). The rescaling factors for the reweighted estimates are returned in the vector \code{cnp2} of length 2. Details for the computation of the finite sample correction factors can be found in Pison et al. (2002). The finite sample corrections can be suppressed by setting \code{use.correction=FALSE}. The implementation in rrcov uses the Fast MCD algorithm of Rousseeuw and Van Driessen (1999) to approximate the minimum covariance determinant estimator. } \value{ An S4 object of class \code{\link{CovMcd-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ P. J. Rousseeuw and A. M. Leroy (1987) \emph{Robust Regression and Outlier Detection.} Wiley. P. J. Rousseeuw and K. van Driessen (1999) A fast algorithm for the minimum covariance determinant estimator. \emph{Technometrics} \bold{41}, 212--223. M. Hubert, P. Rousseeuw and T. Verdonck (2012) A deterministic algorithm for robust location and scatter. \emph{Journal of Computational and Graphical Statistics} \bold{21}(3), 618--637. Pison, G., Van Aelst, S., and Willems, G. (2002), Small Sample Corrections for LTS and MCD, \emph{Metrika}, \bold{55}, 111-123. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } %\note{ % The function \code{\link[robustbase]{covMcd}()} on which \code{CovMcd} is based % will be deprecated i.e. is going to be made obsolete in future versions. %} \seealso{ \code{\link[MASS]{cov.rob}} from package \pkg{MASS} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovMcd(hbk.x) cD <- CovMcd(hbk.x, nsamp = "deterministic") summary(cD) ## the following three statements are equivalent c1 <- CovMcd(hbk.x, alpha = 0.75) c2 <- CovMcd(hbk.x, control = CovControlMcd(alpha = 0.75)) ## direct specification overrides control one: c3 <- CovMcd(hbk.x, alpha = 0.75, control = CovControlMcd(alpha=0.95)) c1 } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMest.Rd0000644000176200001440000000312112763517421015375 0ustar liggesusers\name{CovControlMest} \alias{CovControlMest} \title{ Constructor function for objects of class "CovControlMest" } \concept{High breakdown point} \description{ This function will create a control object \code{CovControlMest} containing the control parameters for \code{CovMest} } \usage{ CovControlMest(r = 0.45, arp = 0.05, eps = 0.001, maxiter = 120) } \arguments{ \item{r}{a numeric value specifying the required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is 0.45} \item{arp}{a numeric value specifying the asympthotic rejection point, i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{0.05} } \item{eps}{a numeric value specifying the relative precision of the solution of the M-estimate. Defaults to \code{1e-3}} \item{maxiter}{maximum number of iterations allowed in the computation of the M-estimate. Defaults to 120 } } %\details{} \value{ A \code{CovControlMest} object } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMest", r=0.4) ctrl2 <- CovControlMest(r=0.4) data(hbk) CovMest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/SummaryCovRobust-class.Rd0000644000176200001440000000265612763517421017077 0ustar liggesusers\name{SummaryCovRobust-class} \docType{class} \alias{SummaryCovRobust-class} \alias{isClassic,SummaryCovRobust-method} \alias{show,SummaryCovRobust-method} \title{Class "SummaryCovRobust" - summary of "CovRobust" objects } \description{ Summary information for CovRobust objects meants for printing by 'show' } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("SummaryCovRobust", ...)}, but most often by invoking 'summary' on an "Cov" object. They contain values meant for printing by 'show'. } \section{Slots}{ \describe{ \item{\code{covobj}:}{Object of class \code{"Cov"}} \item{\code{evals}:}{Eigenvalues of the covariance or correlation matrix} } } \section{Extends}{ Class \code{"SummaryCov"}, directly. } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "SummaryCovRobust")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{CovRobust-class}}, \code{\link{SummaryCov-class}} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cv <- CovMest(hbk.x) cv summary(cv) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/SummaryQda-class.Rd0000644000176200001440000000220312763517421015642 0ustar liggesusers\name{SummaryQda-class} \docType{class} \alias{SummaryQda-class} \alias{show,SummaryQda-method} \title{ Class "SummaryQda" - summary of "Qda" objects } \description{ Summary information about a \code{Qda} - Quadratic Discriminant Analysis object } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("SummaryQda", ...)}, but most often by invoking 'summary' on an "Qda" object. They contain values meant for printing by 'show'. } \section{Slots}{ \describe{ \item{\code{qdaobj}:}{Object of class \code{"Qda"}} } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "SummaryQda")}: display the object } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Qda-class}} } \examples{ showClass("SummaryQda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/PcaGrid-class.Rd0000644000176200001440000000326112763517421015075 0ustar liggesusers\name{PcaGrid-class} \Rdversion{1.1} \docType{class} \alias{PcaGrid-class} \alias{getQuan,PcaGrid-method} \title{Class "PcaGrid" - Robust PCA using PP - GRID search Algorithm } \description{ Holds the results of an approximation of the PP-estimators for PCA using the grid search algorithm in the plane. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaGrid", ...)} but the usual way of creating \code{PcaGrid} objects is a call to the function \code{PcaGrid()} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}, \code{center}, \code{scale}, \code{loadings}, \code{eigenvalues}, \code{scores}, \code{k}, \code{sd}, \code{od}, \code{cutoff.sd}, \code{cutoff.od}, \code{flag}, \code{n.obs}:}{ from the \code{"\linkS4class{Pca}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{PcaRobust}"}, directly. Class \code{"\linkS4class{Pca}"}, by class \code{"\linkS4class{PcaRobust}"}, distance 2. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaGrid")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaClassic-class}} } \examples{ showClass("PcaGrid") } \keyword{robust} \keyword{multivariate} rrcov/man/Cov-class.Rd0000644000176200001440000000730312763517421014314 0ustar liggesusers\name{Cov-class} \docType{class} \alias{Cov-class} \alias{getCenter-method} \alias{getCenter,Cov-method} \alias{getCov,Cov-method} \alias{getCorr,Cov-method} \alias{getData,Cov-method} \alias{getDistance,Cov-method} \alias{getEvals,Cov-method} \alias{getDet,Cov-method} \alias{getShape,Cov-method} \alias{getFlag,Cov-method} \alias{isClassic,method} \alias{isClassic,Cov-method} \alias{plot} \alias{plot,Cov,missing-method} \alias{show,Cov-method} \alias{summary,Cov-method} \alias{Uvector-class} \alias{Ulist-class} \alias{Utable-class} \alias{Umatrix-class} \alias{Ufunction-class} \title{Class "Cov" -- a base class for estimates of multivariate location and scatter} \description{The class \code{Cov} represents an estimate of the multivariate location and scatter of a data set. The objects of class \code{Cov} contain the classical estimates and serve as base for deriving other estimates, i.e. different types of robust estimates. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("Cov", ...)}, but the usual way of creating \code{Cov} objects is a call to the function \code{Cov} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"language"} } \item{\code{cov}:}{covariance matrix} \item{\code{center}:}{location} \item{\code{n.obs}:}{number of observations used for the computation of the estimates} \item{\code{mah}:}{mahalanobis distances} \item{\code{det}:}{determinant} \item{\code{flag}:}{flags (FALSE if suspected an outlier)} \item{\code{method}:}{a character string describing the method used to compute the estimate: "Classic"} \item{\code{singularity}:}{a list with singularity information for the covariance matrix (or \code{NULL} of not singular)} \item{\code{X}:}{data} } } \section{Methods}{ \describe{ \item{getCenter}{\code{signature(obj = "Cov")}: location vector } \item{getCov}{\code{signature(obj = "Cov")}: covariance matrix } \item{getCorr}{\code{signature(obj = "Cov")}: correlation matrix } \item{getData}{\code{signature(obj = "Cov")}: data frame } \item{getDistance}{\code{signature(obj = "Cov")}: distances } \item{getEvals}{\code{signature(obj = "Cov")}: Computes and returns the eigenvalues of the covariance matrix } \item{getDet}{\code{signature(obj = "Cov")}: Computes and returns the determinant of the covariance matrix (or 0 if the covariance matrix is singular) } \item{getShape}{\code{signature(obj = "Cov")}: Computes and returns the shape matrix corresponding to the covariance matrix (i.e. the covariance matrix scaled to have determinant =1) } \item{getFlag}{\code{signature(obj = "Cov")}: Flags observations as outliers if the corresponding mahalanobis distance is larger then \code{qchisq(prob, p)} where \code{prob} defaults to 0.975. } \item{isClassic}{\code{signature(obj = "Cov")}: returns TRUE by default. If necessary, the robust classes will override } \item{plot}{\code{signature(x = "Cov")}: plot the object } \item{show}{\code{signature(object = "Cov")}: display the object } \item{summary}{\code{signature(object = "Cov")}: calculate summary information } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ showClass("Cov") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMest-class.Rd0000644000176200001440000000431312763517421016504 0ustar liggesusers\name{CovControlMest-class} \docType{class} \alias{CovControlMest-class} \title{Class 'CovControlMest' - contains control parameters for "CovMest"} \description{ This class extends the \code{CovControl} class and contains the control parameters for CovMest} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlMest", ...)} or by calling the constructor-function \code{CovControlMest}. } \section{Slots}{ \describe{ \item{\code{r}:}{a numeric value specifying the required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is 0.45} \item{\code{arp}:}{a numeric value specifying the asympthotic rejection point, i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{0.05} } \item{\code{eps}:}{a numeric value specifying the relative precision of the solution of the M-estimate. Defaults to \code{1e-3}} \item{\code{maxiter}:}{maximum number of iterations allowed in the computation of the M-estimate. Defaults to 120 } \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlMest")}: the generic function \code{restimate} allowes the different methods for robust estimation to be used polymorphically - this function will call \code{CovMest} passing it the control object and will return the obtained \code{CovRobust} object} } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMest", r=0.4) ctrl2 <- CovControlMest(r=0.4) data(hbk) CovMest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMrcd-class.Rd0000644000176200001440000000565513372560725016475 0ustar liggesusers\name{CovControlMrcd-class} \Rdversion{1.1} \docType{class} \alias{CovControlMrcd-class} \alias{restimate,CovControlMrcd-method} \title{Class 'CovControlMrcd' - contains control parameters for CovMrcd()} \description{ This class extends the \code{CovControl} class and contains the control parameters for \code{"CovMrcd"} } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlMrcd", ...)} or by calling the constructor-function \code{CovControlMrcd}. } \section{Slots}{ \describe{ \item{\code{alpha}:}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{h}{the size of the subset (can be between ceiling(n/2) and n). Normally NULL and then it \code{h} will be calculated as \code{h=ceiling(alpha*n)}. If \code{h} is provided, \code{alpha} will be calculated as \code{alpha=h/n}.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{rho}{regularization parameter. Normally NULL and will be estimated from the data.} \item{target}{structure of the robust positive definite target matrix: a) "identity": target matrix is diagonal matrix with robustly estimated univariate scales on the diagonal or b) "equicorrelation": non-diagonal target matrix that incorporates an equicorrelation structure (see (17) in paper).} \item{maxcond}{maximum condition number allowed (see step 3.4 in algorithm 1).} \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlMrcd")}: the generic function \code{restimate} allows the different methods for robust estimation to be used polymorphically - this function will call \code{CovMrcd} passing it the control object and will return the obtained \code{CovRobust} object} }} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} \seealso{ \code{"\linkS4class{CovControlMcd}"} } \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMrcd", alpha=0.75) ctrl2 <- CovControlMrcd(alpha=0.75) data(hbk) CovMrcd(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/OsloTransect.Rd0000644000176200001440000001160612763517421015103 0ustar liggesusers\name{OsloTransect} \alias{OsloTransect} \docType{data} \title{ Oslo Transect Data } \description{ The oslo Transect data set contains 360 samples of different plant species collected along a 120 km transect running through the city of Oslo, Norway. } \usage{data(OsloTransect)} \format{ A data frame with 360 observations on the following 38 variables. \describe{ \item{\code{X.ID}}{a numeric vector, unique ID of the sample} \item{\code{X.MAT}}{a factor with levels \code{BBA} \code{BIL} \code{BWO} \code{FER} \code{MOS} \code{ROG} \code{SNE} \code{STW} \code{TWI}} \item{\code{XCOO}}{a numeric vector, X coordinate} \item{\code{YCOO}}{a numeric vector, Y coordinate} \item{\code{XCOO_km}}{a numeric vector} \item{\code{YCOO_km}}{a numeric vector} \item{\code{X.FOREST}}{a factor with levels \code{BIRSPR} \code{MIXDEC} \code{PINE} \code{SPRBIR} \code{SPRPIN} \code{SPRUCE}} \item{\code{DAY}}{a numeric vector} \item{\code{X.WEATHER}}{a factor with levels \code{CLOUD} \code{MOIST} \code{NICE} \code{RAIN}} \item{\code{ALT}}{a numeric vector} \item{\code{X.ASP}}{a factor with levels \code{} \code{E} \code{FLAT} \code{N} \code{NE} \code{NW} \code{S} \code{SE} \code{SW} \code{W}} \item{\code{X.GRVEG}}{a factor with levels \code{BLGR} \code{BLLY} \code{BLMOLI} \code{BLUE} \code{BLUGRA} \code{GRAS} \code{GRBLU} \code{GRFE} \code{GRMO} \code{LYLI} \code{MIX} \code{MOGR} \code{MOSS}} \item{\code{X.FLITHO}}{a factor with levels \code{CAMSED} \code{GNEID_O} \code{GNEIS_O} \code{GNEIS_R} \code{MAGM} \code{MICSH}} \item{\code{Ag_ppb}}{a numeric vector} \item{\code{As_ash}}{a numeric vector} \item{\code{B}}{a numeric vector} \item{\code{Ba}}{a numeric vector} \item{\code{Ca}}{a numeric vector} \item{\code{Cd}}{a numeric vector} \item{\code{Co}}{a numeric vector} \item{\code{Cr}}{a numeric vector} \item{\code{Cu}}{a numeric vector} \item{\code{Fe}}{a numeric vector} \item{\code{Hg_ppb}}{a numeric vector} \item{\code{K}}{a numeric vector} \item{\code{La}}{a numeric vector} \item{\code{LOI}}{a numeric vector} \item{\code{Mg}}{a numeric vector} \item{\code{Mn}}{a numeric vector} \item{\code{Mo}}{a numeric vector} \item{\code{Ni}}{a numeric vector} \item{\code{P}}{a numeric vector} \item{\code{Pb}}{a numeric vector} \item{\code{S}}{a numeric vector} \item{\code{Sb}}{a numeric vector} \item{\code{Sr}}{a numeric vector} \item{\code{Ti}}{a numeric vector} \item{\code{Zn}}{a numeric vector} } } \details{ Samples of different plant species were collected along a 120 km transect running through the city of Oslo, Norway (forty samples each of leaves, needles,roots or barks of several plant species), and the concentrations of 25 chemical elements for the sample materials are reported. The factors that influenced the observed element concentrations in the sample materials were investigated. This data set was used in Todorov and Filzmoser (2007) for illustration of the robust statistics for one-way MANOVA implemented in the function \code{\link{Wilks.test}}. } \source{ REIMANN,C., ARNOLDUSSEN,A., BOYD,R., FINNE,T.E., NORDGULEN,Oe., VOLDEN,T. and ENGLMAIER,P. (2006) The Influence of a city on element contents of a terrestrial moss (Hylocomium splendens), \emph{The Science of the Total Environment} \bold{369} 419--432. REIMANN,C., ARNOLDUSSEN,A., BOYD,R., FINNE,T.E., KOLLER,F., NORDGULEN,Oe., and ENGLMAIER,P. (2007) Element contents in leaves of four plant species (birch, mountain ash, fern and spruce) along anthropogenic and geogenic concentration gradients, \emph{The Science of the Total Environment} \bold{377} 416--433. REIMANN,C., ARNOLDUSSEN,A., FINNE,T.E., KOLLER,F., NORDGULEN,Oe., and ENGLMAIER,P., (2007) Element contents in birch leaves, bark and wood under different anthropogenic and geogenic conditions, \emph{Applied Geochemistry}, \bold{22} 1549--1566. } \references{ Todorov V. and Filzmoser P. (2007) Robust statistic for the one-way MANOVA, \emph{submetted to the Journal of Environmetrics}. } \examples{ data(OsloTransect) str(OsloTransect) ## ## Log-transform the numerical part of the data, ## choose the desired groups and variables and ## perform the classical Wilks' Lambda test ## OsloTransect[,14:38] <- log(OsloTransect[,14:38]) grp <- OsloTransect$X.FLITHO ind <- which(grp =="CAMSED" | grp == "GNEIS_O" | grp == "GNEIS_R" | grp=="MAGM") (cwl <- Wilks.test(X.FLITHO~K+P+Zn+Cu,data=OsloTransect[ind,])) ## ## Perform now the robust MCD based Wilks' Lambda test. ## Use the already computed multiplication factor 'xd' and ## degrees of freedom 'xq' for the approximate distribution. ## xd <- -0.003708238 xq <- 11.79073 (mcdwl <- Wilks.test(X.FLITHO~K+P+Zn+Cu,data=OsloTransect[ind,], method="mcd", xd=xd, xq=xq)) } \keyword{datasets} rrcov/man/PcaGrid.Rd0000644000176200001440000001034212763517421013770 0ustar liggesusers\name{PcaGrid} \alias{PcaGrid} \alias{PcaGrid.formula} \alias{PcaGrid.default} \title{ Robust Principal Components based on Projection Pursuit (PP): GRID search Algorithm } \description{ Computes an approximation of the PP-estimators for PCA using the grid search algorithm in the plane. } \usage{ PcaGrid(x, ...) \method{PcaGrid}{default}(x, k = 0, kmax = ncol(x), scale=FALSE, na.action = na.fail, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaGrid}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, it is set to the number of columns of the data. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=0}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{scale}{a value indicating whether and how the variables should be scaled. If \code{scale = FALSE} (default) or \code{scale = NULL} no scaling is performed (a vector of 1s is returned in the \code{scale} slot). If \code{scale = TRUE} the data are scaled to have unit variance. Alternatively it can be a function like \code{sd} or \code{mad} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the \code{scale} slot. Default is \code{scale = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } \details{ \code{PcaGrid}, serving as a constructor for objects of class \code{\link{PcaGrid-class}} is a generic function with "formula" and "default" methods. For details see \code{\link[pcaPP]{PCAgrid}} and the relevant references. } \value{ An S4 object of class \code{\link{PcaGrid-class}} which is a subclass of the virtual class \code{\link{PcaRobust-class}}. } \references{ C. Croux, P. Filzmoser, M. Oliveira, (2007). Algorithms for Projection-Pursuit Robust Principal Component Analysis, \emph{Chemometrics and Intelligent Laboratory Systems}, 87, 225. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } %\note{} \examples{ # multivariate data with outliers library(mvtnorm) x <- rbind(rmvnorm(200, rep(0, 6), diag(c(5, rep(1,5)))), rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6)))) # Here we calculate the principal components with PCAgrid pc <- PcaGrid(x, 6) # we could draw a biplot too: biplot(pc) # we could use another objective function, and # maybe only calculate the first three principal components: pc <- PcaGrid(x, 3, method="qn") biplot(pc) # now we want to compare the results with the non-robust principal components pc <- PcaClassic(x, k=3) # again, a biplot for comparision: biplot(pc) } \keyword{robust} \keyword{multivariate} rrcov/man/PcaRobust-class.Rd0000644000176200001440000000520512763517421015466 0ustar liggesusers\name{PcaRobust-class} \docType{class} \alias{PcaRobust-class} \title{Class "PcaRobust" is a virtual base class for all robust PCA classes } \description{ The class \code{PcaRobust} searves as a base class for deriving all other classes representing the results of the robust Principal Component Analisys methods} \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"language"} } \item{\code{center}:}{Object of class \code{"vector"} the center of the data } \item{\code{loadings}:}{Object of class \code{"matrix"} the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors) } \item{\code{eigenvalues}:}{Object of class \code{"vector"} the eigenvalues } \item{\code{scores}:}{Object of class \code{"matrix"} the scores - the value of the projected on the space of the principal components data (the centred (and scaled if requested) data multiplied by the \code{loadings} matrix) is returned. Hence, \code{cov(scores)} is the diagonal matrix \code{diag(eigenvalues)} } \item{\code{k}:}{Object of class \code{"numeric"} number of (choosen) principal components } \item{\code{sd}:}{Object of class \code{"Uvector"} Score distances within the robust PCA subspace } \item{\code{od}:}{Object of class \code{"Uvector"} Orthogonal distances to the robust PCA subspace } \item{\code{cutoff.sd}:}{Object of class \code{"numeric"} Cutoff value for the score distances} \item{\code{cutoff.od}:}{Object of class \code{"numeric"} Cutoff values for the orthogonal distances } \item{\code{flag}:}{Object of class \code{"Uvector"} The observations whose score distance is larger than cutoff.sd or whose orthogonal distance is larger than cutoff.od can be considered as outliers and receive a flag equal to zero. The regular observations receive a flag 1 } \item{\code{n.obs}:}{Object of class \code{"numeric"} the number of observations } } } \section{Extends}{ Class \code{"\linkS4class{Pca}"}, directly. } \section{Methods}{ No methods defined with class "PcaRobust" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{Pca-class}}, \code{\link{PcaClassic-class}}, } \examples{ showClass("PcaRobust") } \keyword{robust} \keyword{multivariate} rrcov/man/CovMrcd-class.Rd0000644000176200001440000000522313372132034015107 0ustar liggesusers\name{CovMrcd-class} \Rdversion{1.1} \docType{class} \alias{CovMrcd-class} \title{ MRCD Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates MRCD Estimates of multivariate location and scatter computed by a variant of the \sQuote{Fast MCD} algorithm. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovMrcd", ...)}, but the usual way of creating \code{CovMrcd} objects is a call to the function \code{CovMrcd} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{alpha}:}{Object of class \code{"numeric"} - the size of the subsets over which the determinant is minimized (the default is (n+p+1)/2) } \item{\code{quan}:}{Object of class \code{"numeric"} - the number of observations on which the MCD is based. If \code{quan} equals \code{n.obs}, the MCD is the classical covariance matrix. } \item{\code{best}:}{Object of class \code{"Uvector"} - the best subset found and used for computing the raw estimates. The size of \code{best} is equal to \code{quan} } \item{\code{cnp2}:}{Object of class \code{"numeric"} - containing the consistency correction factor of the estimate of the covariance matrix. } \item{\code{icov}:}{The inverse of the covariance matrix. } \item{\code{rho}:}{The estimated regularization parameter. } \item{\code{target}:}{The estimated target matrix. } \item{\code{crit}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class \code{"CovMrcd"} in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMrcd}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}}, \code{\link{CovMcd-class}} } \examples{ showClass("CovMrcd") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovControlSest.Rd0000644000176200001440000000440712763517421015413 0ustar liggesusers\name{CovControlSest} \alias{CovControlSest} \title{ Constructor function for objects of class "CovControlSest" } \concept{High breakdown point} \description{ This function will create a control object \code{CovControlSest} containing the control parameters for \code{CovSest} } \usage{ CovControlSest(bdp = 0.5, arp = 0.1, eps = 1e-5, maxiter = 120, nsamp = 500, seed = NULL, trace = FALSE, tolSolve = 1e-14, method= "sfast") } \arguments{ \item{bdp}{ a numeric value specifying the required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is 0.45 } \item{arp}{a numeric value specifying the asympthotic rejection point (for the Rocke type S estimates), i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{0.1} } \item{eps}{a numeric value specifying the relative precision of the solution of the S-estimate (bisquare and Rocke type). Defaults to \code{1e-5}. } \item{maxiter}{maximum number of iterations allowed in the computation of the S-estimate (bisquare and Rocke type). Defaults to 120. } \item{nsamp}{the number of random subsets considered. Default is \code{nsamp = 500}.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{tolSolve}{numeric tolerance to be used for inversion (\code{\link{solve}}) of the covariance matrix in \code{\link{mahalanobis}}. } \item{method}{ Which algorithm to use: 'sfast'=FAST-S or 'surreal'=SURREAL } } %\details{} \value{ A \code{CovControlSest} object. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlSest", bdp=0.4) ctrl2 <- CovControlSest(bdp=0.4) data(hbk) CovSest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovClassic-class.Rd0000644000176200001440000000472712763517421015625 0ustar liggesusers\name{CovClassic-class} \docType{class} \alias{CovClassic-class} \title{Class "CovClassic" - classical estimates of multivariate location and scatter } \description{ The class \code{CovClassic} represents an estimate of the multivariate location and scatter of a data set. The objects of class \code{CovClassic} contain the classical estimates. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovClassic", ...)}, but the usual way of creating \code{CovClassic} objects is a call to the function \code{CovClassic} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"language"} } \item{\code{cov}:}{covariance matrix} \item{\code{center}:}{location} \item{\code{n.obs}:}{number of observations used for the computation of the estimates} \item{\code{mah}:}{mahalanobis distances} \item{\code{method}:}{a character string describing the method used to compute the estimate: "Classic"} \item{\code{singularity}:}{a list with singularity information for the ocvariance matrix (or \code{NULL} of not singular)} \item{\code{X}:}{data} } } \section{Methods}{ \describe{ \item{getCenter}{\code{signature(obj = "CovClassic")}: location vector } \item{getCov}{\code{signature(obj = "CovClassic")}: covariance matrix } \item{getCorr}{\code{signature(obj = "CovClassic")}: correlation matrix } \item{getData}{\code{signature(obj = "CovClassic")}: data frame } \item{getDistance}{\code{signature(obj = "CovClassic")}: distances } \item{getEvals}{\code{signature(obj = "CovClassic")}: Computes and returns the eigenvalues of the covariance matrix } \item{plot}{\code{signature(x = "CovClassic")}: plot the object } \item{show}{\code{signature(object = "CovClassic")}: display the object } \item{summary}{\code{signature(object = "CovClassic")}: calculate summary information } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cv <- CovClassic(hbk.x) cv summary(cv) plot(cv) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/LdaPP.Rd0000644000176200001440000001356012763517421013424 0ustar liggesusers\name{LdaPP} \alias{LdaPP} \alias{LdaPP.formula} \alias{LdaPP.default} \title{ Robust Linear Discriminant Analysis by Projection Pursuit} \description{ Performs robust linear discriminant analysis by the projection-pursuit approach - proposed by Pires and Branco (2010) - and returns the results as an object of class \code{LdaPP} (aka constructor). } \usage{ LdaPP(x, ...) \method{LdaPP}{formula}(formula, data, subset, na.action, \dots) \method{LdaPP}{default}(x, grouping, prior = proportions, tol = 1.0e-4, method = c("huber", "mad", "sest", "class"), optim = FALSE, trace=FALSE, ...) } \arguments{ \item{formula}{a formula of the form \code{y~x}, it describes the response and the predictors. The formula can be more complicated, such as \code{y~log(x)+z} etc (see \code{\link{formula}} for more details). The response should be a factor representing the response variable, or any vector that can be coerced to such (such as a logical variable).} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{x}{a matrix or data frame containing the explanatory variables (training set). } \item{grouping}{grouping variable: a factor specifying the class for each observation.} \item{prior}{prior probabilities, default to the class proportions for the training set.} \item{tol}{tolerance} \item{method}{method} \item{optim}{wheather to perform the approximation using the Nelder and Mead simplex method (see function \code{optim()} from package \code{stats}). Default is \code{optim = FALSE}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{\dots}{arguments passed to or from other methods.} } \details{ Currently the algorithm is implemented only for binary classification and in the following will be assumed that only two groups are present. The PP algorithm searches for low-dimensional projections of higher-dimensional data where a projection index is maximized. Similar to the original Fisher's proposal the squared standardized distance between the observations in the two groups is maximized. Instead of the sample univariate mean and standard deviation \code{(T,S)} robust alternatives are used. These are selected through the argument \code{method} and can be one of \describe{ \item{huber}{the pair \code{(T,S)} are the robust M-estimates of location and scale} \item{mad}{\code{(T,S)} are the Median and the Median Absolute Deviation} \item{sest}{the pair \code{(T,S)} are the robust S-estimates of location and scale} \item{class}{\code{(T,S)} are the mean and the standard deviation.} } The first approximation \emph{A1} to the solution is obtained by investigating a finite number of candidate directions, the unit vectors defined by all pairs of points such that one belongs to the first group and the other to the second group. The found solution is stored in the slots \code{raw.ldf} and \code{raw.ldfconst}. The second approximation \emph{A2} (optional) is performed by a numerical optimization algorithm using \emph{A1} as initial solution. The Nelder and Mead method implemented in the function \code{\link{optim}} is applied. Whether this refinement will be used is controlled by the argument \code{optim}. If \code{optim=TRUE} the result of the optimization is stored into the slots \code{ldf} and \code{ldfconst}. Otherwise these slots are set equal to \code{raw.ldf} and \code{raw.ldfconst}. } \value{ Returns an S4 object of class \code{\link[rrcov]{LdaPP-class}} } \references{ Pires, A. M. and A. Branco, J. (2010) Projection-pursuit approach to robust linear discriminant analysis \emph{Journal Multivariate Analysis}, Academic Press, Inc., \bold{101}, 2464--2485. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} and Ana Pires \email{apires@math.ist.utl.pt} } \section{Warning }{Still an experimental version! Only binary classification is supported.} \seealso{ \code{\link[rrcov]{Linda}}, \code{\link[rrcov]{LdaClassic}} } \examples{ ## ## Function to plot a LDA separation line ## lda.line <- function(lda, ...) { ab <- lda@ldf[1,] - lda@ldf[2,] cc <- lda@ldfconst[1] - lda@ldfconst[2] abline(a=-cc/ab[2], b=-ab[1]/ab[2],...) } data(pottery) x <- pottery[,c("MG", "CA")] grp <- pottery$origin col <- c(3,4) gcol <- ifelse(grp == "Attic", col[1], col[2]) gpch <- ifelse(grp == "Attic", 16, 1) ## ## Reproduce Fig. 2. from Pires and branco (2010) ## plot(CA~MG, data=pottery, col=gcol, pch=gpch) ppc <- LdaPP(x, grp, method="class", optim=TRUE) lda.line(ppc, col=1, lwd=2, lty=1) pph <- LdaPP(x, grp, method="huber",optim=TRUE) lda.line(pph, col=3, lty=3) pps <- LdaPP(x, grp, method="sest", optim=TRUE) lda.line(pps, col=4, lty=4) ppm <- LdaPP(x, grp, method="mad", optim=TRUE) lda.line(ppm, col=5, lty=5) rlda <- Linda(x, grp, method="mcd") lda.line(rlda, col=6, lty=1) fsa <- Linda(x, grp, method="fsa") lda.line(fsa, col=8, lty=6) ## Use the formula interface: ## LdaPP(origin~MG+CA, data=pottery) ## use the same two predictors LdaPP(origin~., data=pottery) ## use all predictor variables ## ## Predict method data(pottery) fit <- LdaPP(origin~., data = pottery) predict(fit) } \keyword{robust} \keyword{multivariate} rrcov/man/Wilks.test.Rd0000644000176200001440000001523012763517421014527 0ustar liggesusers\name{Wilks.test} \alias{Wilks.test} \alias{Wilks.test.default} \alias{Wilks.test.data.frame} \alias{Wilks.test.formula} \alias{Wilks.test.matrix} \alias{model.frame.Wilks.test} \title{ Classical and Robust One-way MANOVA: Wilks Lambda } \description{ Classical and Robust One-way MANOVA: Wilks Lambda } \usage{ \method{Wilks.test}{formula}(formula, data, \dots, subset, na.action) \method{Wilks.test}{default}(x, grouping, method=c("c", "mcd", "rank"), approximation=c("Bartlett", "Rao", "empirical"), xd=NULL, xq=NULL, xfn = NULL, xwl=NULL, nrep=3000, trace=FALSE, \dots) \method{Wilks.test}{data.frame}(x, \dots) \method{Wilks.test}{matrix}(x, grouping, \dots, subset, na.action) } \arguments{ \item{formula}{ A formula of the form \code{groups ~ x1 + x2 + \dots} That is, the response is the grouping factor and the right hand side specifies the (non-factor) variables. } \item{data}{ Data frame from which variables specified in \code{formula} are to be taken. } \item{x}{ (required if no formula is given as the principal argument.) a matrix or data frame or Matrix containing the explanatory variables. } \item{grouping}{ grouping variable - a factor specifying the class for each observation (required if no formula argument is given.) } \item{subset}{ An index vector specifying the cases to be used. } \item{na.action}{ A function to specify the action to be taken if \code{NA}s are found. The default action is for the procedure to fail. An alternative is \code{na.omit}, which leads to rejection of cases with missing values on any required variable. } \item{method}{ \code{"c"} for standard estimators of the mean and variance, \code{"mcd"} for MCD estimators of mean and variances and \code{"rank"} for rank based wilks' lambda as proposed by Nath and Pavur (1985). } \item{approximation}{ \code{"Bartlett"} for Bartlett approximation (default), \code{"Rao"} for rao approximation (only for method="c") and \code{"empirical"} for simulated empirical distribution. } \item{xd}{multiplication factor for the approximate distribution of the robust Lambda statistic. If \code{xd=NULL} the factor will computed by simulation and will be returned in the value (see Details) } \item{xq}{the degrees of freedom for the approximate \eqn{\chi^2} distribution of the robust Lambda statistic. If \code{xq=NULL} the degrees of freedom will computed by simulation and will be returned in the value (see Details) } \item{xfn}{the empirical distribution function. If \code{xfn=NULL} the empirical function will be estimated by simulation and will be returned in the value (see Details) } \item{xwl}{the simulated values of the robust statistic. If \code{xwl=NULL} the simulation will be performed and the calculated result will be returned in the value (see Details) } \item{nrep}{number of trials for the simulations for computing the multiplication factor \code{xd} and the degrees of freedom \code{xq}. Default is \code{nrep=3000}. } \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{\dots}{arguments passed to or from other methods.} } \value{ A list with class \code{"htest"} containing the following components: \item{statistic}{the value of the Wilks' Lambda statistic.} \item{parameter}{The corresponding approximation of the Wilks' lambda statistic and the degrees of freedom.} \item{p.value}{the p-value for the test.} \item{estimate}{the estimated mean vectors.} \item{method}{a character string indicating what type of test was performed.} \item{data.name}{a character string giving the name of the data.} \item{xd}{multiplication factor for the approximate distribution of the robust Lambda statistic. } \item{xq}{the degrees of freedom for the approximate \eqn{\chi^2} distribution of the robust Lambda statistic. } } \details{ The classical Wilks' Lambda statistic for testing the equality of the group means of two or more groups is modified into a robust one through substituting the classical estimates by the highly robust and efficient reweighted MCD estimates, which can be computed efficiently by the FAST-MCD algorithm - see \code{\link{CovMcd}}. An approximation for the finite sample distribution of the Lambda statistic is obtained, based on matching the mean and variance of a multiple of an \eqn{\chi^2} distribution which are computed by simultaion. } \note{ This function may be called giving either a formula and optional data frame, or a matrix and grouping factor as the first two arguments. All other arguments are optional. } \references{ Todorov, V. and Filzmoser, P. (2007) Robust statistic for the one-way MANOVA, \emph{submetted to the Journal of Environmetrics}. Todorov, V. (2007) Robust selection of variables in linear discriminant analysis, \emph{Statistical Methods and Applications}, \bold{15}, 395.407, doi:10.1007/s10260-006-0032-6. Nath, R. and Pavur, R. (1985) A new statistic in the one way multivariate analysis of variance, \emph{Computatational Statistics and Data Analysis}, \bold{2}, 297--315 } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMcd}}, \code{\link{T2.test}}} \examples{ library(MASS) data(anorexia) grp <- as.factor(anorexia[,1]) x <- as.matrix(anorexia[,2:3]) ## Using the default interface, classical test Wilks.test(x, grouping=grp, method="c") ## Using the default interface, rank based test Wilks.test(x, grouping=grp, method="rank") ## For this data set: p=2, n=n1+n2+n3=29+26+17 ## were computed the following multiplication factor xd and degrees of freedom xq ## for the MCD estimates with alpha=0.5 xd <- -0.02162666 xq <- 3.63971 Wilks.test(x, grouping=grp, method="mcd", xd=xd, xq=xq) ## Now the same with the formula interface Wilks.test(Treat~Prewt+Postwt, data=anorexia, method="mcd", xd=xd, xq=xq) ##Iris data with formula interface data(iris) Wilks.test(Species~., data=iris, method="c") ## and with default interface Wilks.test(iris[,1:4],grouping=iris[,5], method="c") # hemophilia data - classical, rank and MCD test data(hemophilia) hemophilia$gr <- as.factor(hemophilia$gr) Wilks.test(gr~., data=hemophilia, method="c") Wilks.test(gr~., data=hemophilia, method="rank") ## already simulated parameters for MCD with alpha=0.5 xd <- -0.01805436 xq <- 1.950301 Wilks.test(gr~., data=hemophilia, xd=xd, xq=xq, method="mcd") } \keyword{multivariate} \keyword{robust} rrcov/man/PcaClassic.Rd0000644000176200001440000000746012763517421014473 0ustar liggesusers\name{PcaClassic} \alias{PcaClassic} \alias{PcaClassic.formula} \alias{PcaClassic.default} \title{ Principal Components Analysis } \description{ Performs a principal components analysis and returns the results as an object of class PcaClassic (aka constructor). } \usage{ PcaClassic(x, ...) \method{PcaClassic}{default}(x, k = ncol(x), kmax = ncol(x), scale=FALSE, signflip=TRUE, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaClassic}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, the algorithm itself will determine the number of components by finding such \code{k} that \eqn{l_k/l_1 >= 10.E-3} and \eqn{\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j >= 0.8}. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=ncol(x)}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{scale}{a value indicating whether and how the variables should be scaled to have unit variance (only possible if there are no constant variables). If \code{scale=FALSE} (default) or \code{scale=NULL} no scaling is performed (a vector of 1s is returned in the scale slot). If \code{scale=TRUE} the data are scaled to have unit variance. Alternatively it can be a function like \code{sd} or \code{Qn} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the scale slot. Default is \code{scale=FALSE}.} \item{signflip}{a logical value indicating wheather to try to solve the sign indeterminancy of the loadings - ad hoc approach setting the maximum element in a singular vector to be positive. Default is \code{signflip = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } %\details{} \value{ An S4 object of class \code{\link{PcaClassic-class}} which is a subclass of the virtual class \code{\link{Pca-class}}. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \note{ This function can be seen as a wrapper arround prcomp() from \code{stats} which returns the results of the PCA in a class compatible with the object model for robust PCA. } \seealso{ \code{\link{Pca-class}}, \code{\link{PcaClassic-class}}, } %\examples{} \keyword{robust} \keyword{multivariate} rrcov/man/salmon.Rd0000644000176200001440000000206712763517421013755 0ustar liggesusers\name{salmon} \alias{salmon} \docType{data} \title{ Salmon data } \description{ The salmon data contains two measurements of the growth rings on the scale of Alaskan and Canadian salmon as well as the gender of the fishes. There are 50 Alaskan-born and 50 Canadian-born salmon, and this information is coded in the variable \code{Origin}. } \usage{data(salmon)} \format{ A data frame with 100 observations on the following 4 variables. \describe{ \item{\code{Gender}}{female=1 and male=2} \item{\code{Freshwater}}{diameter of rings for the first-year freshwater growth (hundrets of an inch)} \item{\code{Marine}}{diameter of rings for the first-year marine growth (hundrets of an inch)} \item{\code{Origin}}{Origin of the fish: a factor with levels \code{Alaskan} \code{Canadian}} } } %\details{} \source{ Johnson, R.A. and Wichern, D. W. \emph{Applied Multivariate Statistical Analysis} (Prentice Hall, International Editions, 2002, fifth edition)} %\references{} \examples{ data(salmon) } \keyword{datasets} rrcov/man/CovRobust.Rd0000644000176200001440000000541112763517421014406 0ustar liggesusers\name{CovRobust} \alias{CovRobust} \title{ Robust Location and Scatter Estimation } \description{ Computes a robust multivariate location and scatter estimate with a high breakdown point, using one of the available estimators. } \usage{ CovRobust(x, control, na.action = na.fail) } \arguments{ \item{x}{a matrix or data frame. } \item{control}{ a control object (S4) for one of the available control classes, e.g. \code{\link{CovControlMcd-class}}, \code{\link{CovControlOgk-class}}, \code{\link{CovControlSest-class}}, etc., containing estimation options. The class of this object defines which estimator will be used. Alternatively a character string can be specified which names the estimator - one of auto, sde, mcd, ogk, m, mve, sfast, surreal, bisquare, rocke. If 'auto' is specified or the argument is missing, the function will select the estimator (see below for details)} \item{na.action}{ A function to specify the action to be taken if missing values are found. The default action is for the procedure to fail. An alternative is na.omit, which leads to rejection of cases with missing values on any required variable.} } \details{ This function simply calls the \code{restimate} method of the control object \code{control}. If a character string naming an estimator is specified, a new control object will be created and used (with default estimation options). If this argument is missing or a character string 'auto' is specified, the function will select the robust estimator according to the size of the dataset. If there are less than 1000 observations and less than 10 variables or less than 5000 observations and less than 5 variables, Stahel-Donoho estimator will be used. Otherwise, if there are less than 50000 observations either bisquare S-estimates (for less than 10 variables) or Rocke type S-estimates (for 10 to 20 variables) will be used. In both cases the S iteration starts at the initial MVE estimate. And finally, if there are more than 50000 observations and/or more than 20 variables the Orthogonalized Quadrant Correlation estimator (\code{CovOgk} with the corresponding parameters) is used. } \value{ An object derived from a \code{CovRobust} object, depending on the selected estimator. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovRobust(hbk.x) CovRobust(hbk.x, CovControlSest(method="bisquare")) } \keyword{robust} \keyword{multivariate} rrcov/man/CovSde-class.Rd0000644000176200001440000000316112763517421014746 0ustar liggesusers\name{CovSde-class} \Rdversion{1.1} \docType{class} \alias{CovSde-class} \title{ Stahel-Donoho Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates Stahel-Donoho estimates of multivariate location and scatter.} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovSde", ...)}, but the usual way of creating \code{CovSde} objects is a call to the function \code{CovSde} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovSde" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovSde}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovSde") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/fish.Rd0000644000176200001440000000554212763517421013416 0ustar liggesusers\name{fish} \alias{fish} \docType{data} \title{ Fish Catch Data Set} \description{ The Fish Catch data set contains measurements on 159 fish caught in the lake Laengelmavesi, Finland. } \usage{data(fish)} \format{ A data frame with 159 observations on the following 7 variables. \describe{ \item{\code{Weight}}{Weight of the fish (in grams)} \item{\code{Length1}}{Length from the nose to the beginning of the tail (in cm)} \item{\code{Length2}}{Length from the nose to the notch of the tail (in cm)} \item{\code{Length3}}{Length from the nose to the end of the tail (in cm)} \item{\code{Height}}{Maximal height as \% of Length3} \item{\code{Width}}{Maximal width as \% of Length3} \item{\code{Species}}{Species} } } \details{ The Fish Catch data set contains measurements on 159 fish caught in the lake Laengelmavesi, Finland. For the 159 fishes of 7 species the weight, length, height, and width were measured. Three different length measurements are recorded: from the nose of the fish to the beginning of its tail, from the nose to the notch of its tail and from the nose to the end of its tail. The height and width are calculated as percentages of the third length variable. This results in 6 observed variables, Weight, Length1, Length2, Length3, Height, Width. Observation 14 has a missing value in variable Weight, therefore this observation is usually excluded from the analysis. The last variable, Species, represents the grouping structure: the 7 species are 1=Bream, 2=Whitewish, 3=Roach, 4=Parkki, 5=Smelt, 6=Pike, 7=Perch. This data set was also analyzed in the context of robust Linear Discriminant Analysis by Todorov (2007), Todorov and Pires (2007). } \source{ Journal of Statistical Education, Fish Catch Data Set, [http://www.amstat.org/publications/jse/datasets/fishcatch.txt] accessed August, 2006. } \references{ Todorov, V. (2007 Robust selection of variables in linear discriminant analysis, \emph{Statistical Methods and Applications}, \bold{15}, 395--407, doi:10.1007/s10260-006-0032-6. Todorov, V. and Pires, A.M. (2007) Comparative performance of several robust linear discriminant analysis methods, \emph{REVSTAT Statistical Journal}, \bold{5}, 63--83. } \examples{ data(fish) # remove observation #14 containing missing value fish <- fish[-14,] # The height and width are calculated as percentages # of the third length variable fish[,5] <- fish[,5]*fish[,4]/100 fish[,6] <- fish[,6]*fish[,4]/100 # plot a matrix of scatterplots pairs(fish[1:6], main="Fish Catch Data", pch=21, bg=c("red", "green3", "blue", "yellow", "magenta", "violet", "turquoise")[unclass(fish$Species)]) } \keyword{datasets} rrcov/man/PcaProj.Rd0000644000176200001440000001042412763517421014016 0ustar liggesusers\name{PcaProj} \alias{PcaProj} \alias{PcaProj.formula} \alias{PcaProj.default} \title{ Robust Principal Components based on Projection Pursuit (PP): Croux and Ruiz-Gazen (2005) algorithm } \description{ A fast and simple algorithm for approximating the PP-estimators for PCA: Croux and Ruiz-Gazen (2005) } \usage{ PcaProj(x, ...) \method{PcaProj}{default}(x, k = 0, kmax = ncol(x), scale=FALSE, na.action = na.fail, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaProj}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, it is set to the number of columns of the data. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=0}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{scale}{a value indicating whether and how the variables should be scaled. If \code{scale = FALSE} (default) or \code{scale = NULL} no scaling is performed (a vector of 1s is returned in the \code{scale} slot). If \code{scale = TRUE} the data are scaled to have unit variance. Alternatively it can be a function like \code{sd} or \code{mad} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the \code{scale} slot. Default is \code{scale = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } \details{ \code{PcaProj}, serving as a constructor for objects of class \code{\link{PcaProj-class}} is a generic function with "formula" and "default" methods. For details see \code{\link[pcaPP]{PCAproj}} and the relevant references. } \value{ An S4 object of class \code{\link{PcaProj-class}} which is a subclass of the virtual class \code{\link{PcaRobust-class}}. } \references{ C. Croux, A. Ruiz-Gazen (2005). High breakdown estimators for principal components: The projection-pursuit approach revisited, \emph{Journal of Multivariate Analysis}, 95, 206--226. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } %\note{} \examples{ # multivariate data with outliers library(mvtnorm) x <- rbind(rmvnorm(200, rep(0, 6), diag(c(5, rep(1,5)))), rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6)))) # Here we calculate the principal components with PcaProj pc <- PcaProj(x, 6) # we could draw a biplot too: biplot(pc) # we could use another calculation method and another objective function, and # maybe only calculate the first three principal components: pc <- PcaProj(x, k=3, method="qn", CalcMethod="sphere") biplot(pc) # now we want to compare the results with the non-robust principal components pc <- PcaClassic(x, k=3) # again, a biplot for comparision: biplot(pc) } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlOgk-class.Rd0000644000176200001440000000535412763517421016322 0ustar liggesusers\name{CovControlOgk-class} \Rdversion{1.1} \docType{class} \alias{CovControlOgk-class} \alias{restimate,CovControlOgk-method} \title{ Class 'CovControlOgk' - contains control parameters for CovOgk } \description{ This class extends the \code{CovControl} class and contains the control parameters for \code{"CovOgk"} } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlOgk", ...)} or by calling the constructor-function \code{CovControlOgk}. } \section{Slots}{ \describe{ \item{niter}{ number of iterations, usually 1 or 2 since iterations beyond the second do not lead to improvement. } \item{beta}{ coverage parameter for the final reweighted estimate } \item{mrob}{ function for computing the robust univariate location and dispersion - defaults to the \code{tau scale} defined in Yohai and Zamar (1998) } \item{vrob}{ function for computing robust estimate of covariance between two random vectors - defaults the one proposed by Gnanadesikan and Kettenring (1972) } \item{smrob}{A string indicating the name of the function for computing the robust univariate location and dispersion - defaults to \code{scaleTau2} - the scale 'tau' function defined in Yohai and Zamar (1998)} \item{svrob}{A string indicating the name of the function for computing robust estimate of covariance between two random vectors - defaults to \code{gk}, the one proposed by Gnanadesikan and Kettenring (1972). } \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlOgk")}: the generic function \code{restimate} allowes the different methods for robust estimation to be used polymorphically - this function will call \code{CovOgk} passing it the control object and will return the obtained \code{CovRobust} object} }} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlOgk", beta=0.95) ctrl2 <- CovControlOgk(beta=0.95) data(hbk) CovOgk(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovMrcd.Rd0000644000176200001440000001356313566472462014033 0ustar liggesusers\name{CovMrcd} \alias{CovMrcd} % \title{ Robust Location and Scatter Estimation via Minimum Regularized Covariance Determonant (MRCD)} \description{ Computes a robust multivariate location and scatter estimate with a high breakdown point, using the Minimum Regularized Covariance Determonant (MRCD) estimator. } \usage{ CovMrcd(x, alpha=control@alpha, h=control@h, maxcsteps=control@maxcsteps, initHsets=NULL, save.hsets=FALSE, rho=control@rho, target=control@target, maxcond=control@maxcond, trace=control@trace, control=CovControlMrcd()) } \arguments{ \item{x}{a matrix or data frame. } \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{h}{the size of the subset (can be between ceiling(n/2) and n). Normally NULL and then it \code{h} will be calculated as \code{h=ceiling(alpha*n)}. If \code{h} is provided, \code{alpha} will be calculated as \code{alpha=h/n}.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{initHsets}{NULL or a \eqn{K x h} integer matrix of initial subsets of observations of size \eqn{h} (specified by the indices in \code{1:n}).} \item{save.hsets}{(for deterministic MCD) logical indicating if the initial subsets should be returned as \code{initHsets}.} \item{rho}{regularization parameter. Normally NULL and will be estimated from the data.} \item{target}{structure of the robust positive definite target matrix: a) "identity": target matrix is diagonal matrix with robustly estimated univariate scales on the diagonal or b) "equicorrelation": non-diagonal target matrix that incorporates an equicorrelation structure (see (17) in paper). Default is \code{target="identity"}} \item{maxcond}{maximum condition number allowed (see step 3.4 in algorithm 1). Default is \code{maxcond=50}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{control}{ a control object (S4) of class \code{\link{CovControlMrcd-class}} containing estimation options - same as these provided in the function specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} } \details{ This function computes the minimum regularized covariance determinant estimator (MRCD) of location and scatter and returns an S4 object of class \code{\link{CovMrcd-class}} containing the estimates. Similarly like the MCD method, MRCD looks for the \eqn{h (> n/2)} observations (out of \eqn{n}) whose classical covariance matrix has the lowest possible determinant, but replaces the subset-based covariance by a regularized covariance estimate, defined as a weighted average of the sample covariance of the h-subset and a predetermined positive definite target matrix. The Minimum Regularized Covariance Determinant (MRCD) estimator is then the regularized covariance based on the h-subset which makes the overall determinant the smallest. A data-driven procedure sets the weight of the target matrix (\code{rho}), so that the regularization is only used when needed. } \value{ An S4 object of class \code{\link{CovMrcd-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ Kris Boudt, Peter Rousseeuw, Steven Vanduffel and Tim Verdonck (2018) The Minimum Regularized Covariance Determinant estimator. submitted, available at \url{https://arxiv.org/abs/1701.07086}. Mia Hubert, Peter Rousseeuw and Tim Verdonck (2012) A deterministic algorithm for robust location and scatter. \emph{Journal of Computational and Graphical Statistics} \bold{21}(3), 618--637. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Kris Boudt, Peter Rousseeuw, Steven Vanduffel and Tim Verdonk. Improved by Joachim Schreurs and Iwein Vranckx. Adapted for \pkg{rrcov} by Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMcd}} } \examples{ ## The result will be (almost) identical to the raw MCD ## (since we do not do reweighting of MRCD) ## data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) c0 <- CovMcd(hbk.x, alpha=0.75, use.correction=FALSE) cc <- CovMrcd(hbk.x, alpha=0.75) cc$rho all.equal(c0$best, cc$best) all.equal(c0$raw.center, cc$center) all.equal(c0$raw.cov/c0$raw.cnp2[1], cc$cov/cc$cnp2) summary(cc) ## the following three statements are equivalent c1 <- CovMrcd(hbk.x, alpha = 0.75) c2 <- CovMrcd(hbk.x, control = CovControlMrcd(alpha = 0.75)) ## direct specification overrides control one: c3 <- CovMrcd(hbk.x, alpha = 0.75, control = CovControlMrcd(alpha=0.95)) c1 \dontrun{ data(octane) n <- nrow(octane) p <- ncol(octane) out <- CovMrcd(octane, h=33) robpca = PcaHubert(octane, k=2, alpha=0.75, mcd=FALSE) (outl.robpca = which(robpca@flag==FALSE)) # Observations flagged as outliers by ROBPCA: # 25, 26, 36, 37, 38, 39 # Plot the orthogonal distances versus the score distances: pch = rep(20,n); pch[robpca@flag==FALSE] = 17 col = rep('black',n); col[robpca@flag==FALSE] = 'red' plot(robpca, pch=pch, col=col, id.n.sd=6, id.n.od=6) ## Plot now the MRCD mahalanobis distances pch = rep(20,n); pch[!getFlag(out)] = 17 col = rep('black',n); col[!getFlag(out)] = 'red' plot(out, pch=pch, col=col, id.n=6) } } \keyword{robust} \keyword{multivariate} rrcov/man/PcaProj-class.Rd0000644000176200001440000000333112763517421015120 0ustar liggesusers\name{PcaProj-class} \Rdversion{1.1} \docType{class} \alias{PcaProj-class} \alias{getQuan,PcaProj-method} \title{Class "PcaProj" - Robust PCA using PP - Croux and Ruiz-Gazen (2005) algorithm } \description{ Holds the results of an approximation of the PP-estimators for PCA by a fast and simple algorithm: Croux and Ruiz-Gazen (2005) algorithm. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaProj", ...)} but the usual way of creating \code{PcaProj} objects is a call to the function \code{PcaProj()} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}, \code{center}, \code{scale}, \code{loadings}, \code{eigenvalues}, \code{scores}, \code{k}, \code{sd}, \code{od}, \code{cutoff.sd}, \code{cutoff.od}, \code{flag}, \code{n.obs}:}{ from the \code{"\linkS4class{Pca}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{PcaRobust}"}, directly. Class \code{"\linkS4class{Pca}"}, by class \code{"\linkS4class{PcaRobust}"}, distance 2. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaProj")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaClassic-class}} } \examples{ showClass("PcaProj") } \keyword{robust} \keyword{multivariate} rrcov/man/soil.Rd0000644000176200001440000000370613563642202013426 0ustar liggesusers\name{soil} \alias{soil} \docType{data} \title{ Exchangable cations in forest soil data set } \description{ The forest soil data set contains measurements on 58 soil pits in the Hubbard Brook Experimental Forest in north-central New Hampshire. The excavations were done in 1983 and 1986. The soil samples were analyzed for the exchangeable cations of aluminium, calcium, magnesium, potassium and sodium. The pit locations in both data sets can be classified by the type of the forest: \itemize{ \item 1: spruce-fir (11 samples), \item 2: high elevation hardwood (23 samples) and \item 3: low elevation hardwood (24 samples)). } Additionally the degree of logging disturbance can be considered (all 0 in the 1983 data set): \itemize{ \item 0: uncut forest, \item 1: cut, undisturbed by machinery and \item 2: cut, disturbed. } The observations are expressed in grams of exchangeable cations per square meter. } \usage{data(soil)} \format{ A data frame with 116 observations on the following 7 variables. \describe{ \item{\code{F}}{Type of forest} \item{\code{D}}{Degree of logging disturbance} \item{\code{Al}}{Level of the exchangable cations in Al} \item{\code{Ca}}{Level of the exchangable cations in Ca} \item{\code{Mg}}{Level of the exchangable cations in Mg} \item{\code{K}}{Level of the exchangable cations in K} \item{\code{Na}}{Level of the exchangable cations in Na} } } \source{ Morrison D.F., 2005, Multivariate Statistical Methods, Thompson } \references{ Vanden Branden K, Hubert M (2005). Robust Classiffication in High Dimensions Based on the SIMCA Method. \emph{Cbemometrics and Intelligent Laboratoty Sysiem}, 79: 10--21. } \examples{ data(soil) soil1983 <- soil[soil$D == 0, -2] # only 1983, remove column D (always 0) (cc <- Linda(F~., data=soil)) (pr <- predict(cc)) pr@classification } \keyword{datasets} rrcov/man/wages.Rd0000644000176200001440000000415412763517421013571 0ustar liggesusers\name{wages} \alias{wages} \docType{data} \title{Wages and Hours} \description{ The data are from a national sample of 6000 households with a male head earning less than USD 15,000 annually in 1966. The data were clasified into 39 demographic groups for analysis. The study was undertaken in the context of proposals for a guaranteed annual wage (negative income tax). At issue was the response of labor supply (average hours) to increasing hourly wages. The study was undertaken to estimate this response from available data. } \usage{data(wages)} \format{ A data frame with 39 observations on the following 10 variables: \describe{ \item{\code{HRS}}{Average hours worked during the year} \item{\code{RATE}}{Average hourly wage (USD)} \item{\code{ERSP}}{Average yearly earnings of spouse (USD)} \item{\code{ERNO}}{Average yearly earnings of other family members (USD)} \item{\code{NEIN}}{Average yearly non-earned income} \item{\code{ASSET}}{Average family asset holdings (Bank account, etc.) (USD)} \item{\code{AGE}}{Average age of respondent} \item{\code{DEP}}{Average number of dependents} \item{\code{RACE}}{Percent of white respondents} \item{\code{SCHOOL}}{Average highest grade of school completed} } } %%\details{} \source{ DASL library %% \url{http://lib.stat.cmu.edu/DASL/Datafiles/wagesdat.html} 'http://lib.stat.cmu.edu/DASL/Datafiles/wagesdat.html' } \references{ D.H. Greenberg and M. Kosters, (1970). Income Guarantees and the Working Poor, The Rand Corporation. } \examples{ data(wages) names(wages) x <- as.matrix(wages) ok <- is.finite(x \%*\% rep(1, ncol(x))) wages <- wages[ok, , drop = FALSE] wages.lm <- lm(HRS~AGE, data=wages) plot(HRS ~ AGE, data = wages) abline(wages.lm) class(wages.lm) names(wages.lm) summary(wages.lm) wages.mm <- lmrob(HRS~AGE, data=wages) plot(HRS ~ AGE, data = wages) abline(wages.mm) class(wages.mm) names(wages.mm) summary(wages.mm) } \keyword{datasets} rrcov/man/CovControlSde.Rd0000644000176200001440000000500012763517421015176 0ustar liggesusers\name{CovControlSde} \Rdversion{1.1} \alias{CovControlSde} \title{ Constructor function for objects of class "CovControlSde" } \concept{High breakdown point} \description{ This function will create a control object \code{CovControlSde} containing the control parameters for \code{CovSde} } \usage{ CovControlSde(nsamp = 0, maxres = 0, tune = 0.95, eps = 0.5, prob = 0.99, seed = NULL, trace = FALSE, tolSolve = 1e-14) } \arguments{ \item{nsamp}{a positive integer giving the number of resamples required; \code{nsamp} may not be reached if too many of the \code{p}-subsamples, chosen out of the observed vectors, are in a hyperplane. If \code{nsamp = 0} all possible subsamples are taken. If \code{nsamp} is omitted, it is calculated to provide a breakdown point of \code{eps} with probability \code{prob}.} \item{maxres}{a positive integer specifying the maximum number of resamples to be performed including those that are discarded due to linearly dependent subsamples. If \code{maxres} is omitted it will be set to 2 times \code{nsamp}.} \item{tune}{a numeric value between 0 and 1 giving the fraction of the data to receive non-zero weight. Defaults to \code{0.95}. } \item{prob}{a numeric value between 0 and 1 specifying the probability of high breakdown point; used to compute \code{nsamp} when \code{nsamp} is omitted. Defaults to \code{0.99}. } \item{eps}{a numeric value between 0 and 0.5 specifying the breakdown point; used to compute \code{nsamp} when \code{nresamp} is omitted. Defaults to \code{0.5}. } \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}. } \item{tolSolve}{numeric tolerance to be used for inversion (\code{\link{solve}}) of the covariance matrix in \code{\link{mahalanobis}}.} } \value{ A \code{CovControlSde} object. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlSde", nsamp=2000) ctrl2 <- CovControlSde(nsamp=2000) data(hbk) CovSde(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovSde.Rd0000644000176200001440000001114412763517421013643 0ustar liggesusers\encoding{latin1} \name{CovSde} \Rdversion{1.1} \alias{CovSde} % \title{Stahel-Donoho Estimates of Multivariate Location and Scatter} \description{ Compute a robust estimate of location and scale using the Stahel-Donoho projection based estimator } \usage{ CovSde(x, nsamp, maxres, tune = 0.95, eps = 0.5, prob = 0.99, seed = NULL, trace = FALSE, control) } \arguments{ \item{x}{ a matrix or data frame. } \item{nsamp}{a positive integer giving the number of resamples required; \code{nsamp} may not be reached if too many of the \code{p}-subsamples, chosen out of the observed vectors, are in a hyperplane. If \code{nsamp = 0} all possible subsamples are taken. If \code{nsamp} is omitted, it is calculated to provide a breakdown point of \code{eps} with probability \code{prob}.} \item{maxres}{a positive integer specifying the maximum number of resamples to be performed including those that are discarded due to linearly dependent subsamples. If \code{maxres} is omitted it will be set to 2 times \code{nsamp}.} \item{tune}{a numeric value between 0 and 1 giving the fraction of the data to receive non-zero weight. Defaults to \code{0.95}} \item{prob}{a numeric value between 0 and 1 specifying the probability of high breakdown point; used to compute \code{nsamp} when \code{nsamp} is omitted. Defaults to \code{0.99}.} \item{eps}{a numeric value between 0 and 0.5 specifying the breakdown point; used to compute \code{nsamp} when \code{nresamp} is omitted. Defaults to \code{0.5}. } \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}. } \item{control}{ a control object (S4) of class \code{\link{CovControlSde-class}} containing estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} } \details{ The projection based Stahel-Donoho estimator posses very good statistical properties, but it can be very slow if the number of variables is too large. It is recommended to use this estimator if \code{n <= 1000} and \code{p<=10} or \code{n <= 5000} and \code{p<=5}. The number of subsamples required is calculated to provide a breakdown point of \code{eps} with probability \code{prob} and can reach values larger than the larger integer value - in such case it is limited to \code{.Machine$integer.max}. Of course you could provide \code{nsamp} in the call, i.e. \code{nsamp=1000} but this will not guarantee the required breakdown point of th eestimator. For larger data sets it is better to use \code{\link{CovMcd}} or \code{\link{CovOgk}}. If you use \code{\link{CovRobust}}, the estimator will be selected automatically according on the size of the data set.} \value{ An S4 object of class \code{\link{CovSde-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ R. A. Maronna and V.J. Yohai (1995) The Behavior of the Stahel-Donoho Robust Multivariate Estimator. \emph{Journal of the American Statistical Association} \bold{90} (429), 330--341. R. A. Maronna, D. Martin and V. Yohai (2006). \emph{Robust Statistics: Theory and Methods}. Wiley, New York. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} and Kjell Konis \email{kjell.konis@epfl.ch} } \note{ The Fortran code for the Stahel-Donoho method was taken almost with no changes from package \code{robust} which in turn has it from the \emph{Insightful Robust Library} (thanks to by Kjell Konis). } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovSde(hbk.x) ## the following four statements are equivalent c0 <- CovSde(hbk.x) c1 <- CovSde(hbk.x, nsamp=2000) c2 <- CovSde(hbk.x, control = CovControlSde(nsamp=2000)) c3 <- CovSde(hbk.x, control = new("CovControlSde", nsamp=2000)) ## direct specification overrides control one: c4 <- CovSde(hbk.x, nsamp=100, control = CovControlSde(nsamp=2000)) c1 summary(c1) plot(c1) ## Use the function CovRobust() - if no estimation method is ## specified, for small data sets CovSde() will be called cr <- CovRobust(hbk.x) cr } \keyword{robust} \keyword{multivariate} rrcov/man/CovRobust-class.Rd0000644000176200001440000000537212763517421015517 0ustar liggesusers\name{CovRobust-class} \Rdversion{1.1} \docType{class} \alias{CovRobust-class} \alias{isClassic,CovRobust-method} \alias{getMeth,CovRobust-method} \alias{show,CovRobust-method} \alias{summary,CovRobust-method} \alias{getRaw,CovRobust-method} \title{Class "CovRobust" - virtual base class for robust estimates of multivariate location and scatter} \description{ \code{CovRobust} is a virtual base class used for deriving the concrete classes representing different robust estimates of multivariate location and scatter. Here are implemeted the standard methods common for all robust estimates like \code{show}, \code{summary} and \code{plot}. The derived classes can override these methods and can define new ones.} \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{iter}:}{number of iterations used to compute the estimates} \item{\code{crit}:}{value of the criterion function} \item{\code{wt}:}{weights} \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{Cov}"}, directly. } \section{Methods}{ \describe{ \item{isClassic}{\code{signature(obj = "CovRobust")}: Will return FALSE, since this is a 'Robust' object } \item{getMeth}{\code{signature(obj = "CovRobust")}: Return the name of the particular robust method used (as a character string) } \item{show}{\code{signature(object = "CovRobust")}: display the object } \item{plot}{\code{signature(x = "CovRobust")}: plot the object } \item{getRaw}{\code{signature(obj = "CovRobust")}: Return the object with the reweighted estimates replaced by the raw ones (only relevant for CovMcd, CovMve and CovOgk) } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Cov-class}}, \code{\link{CovMcd-class}}, \code{\link{CovMest-class}}, \code{\link{CovOgk-class}} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cv <- CovMest(hbk.x) # it is not possible to create an object of # class CovRobust, since it is a VIRTUAL class cv summary(cv) # summary method for class CovRobust plot(cv) # plot method for class CovRobust } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/PcaCov.Rd0000644000176200001440000001157212763517421013640 0ustar liggesusers\name{PcaCov} \alias{PcaCov} \alias{PcaCov.formula} \alias{PcaCov.default} \title{ Robust PCA based on a robust covariance matrix } \description{ Robust PCA are obtained by replacing the classical covariance matrix by a robust covariance estimator. This can be one of the available in \code{rrcov} estimators, i.e. MCD, OGK, M or S estimator. } \usage{ PcaCov(x, ...) \method{PcaCov}{default}(x, k = ncol(x), kmax = ncol(x), cov.control=CovControlMcd(), scale = FALSE, signflip = TRUE, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaCov}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, the algorithm itself will determine the number of components by finding such \code{k} that \eqn{l_k/l_1 >= 10.E-3} and \eqn{\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j >= 0.8}. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=ncol(x)}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{cov.control}{specifies which covariance estimator to use by providing a \code{\link{CovControl-class}} object. The default is \code{\link{CovControlMcd-class}} which will indirectly call \code{\link{CovMcd}}. If \code{cov.control=NULL} is specified, the classical estimates will be used by calling \code{\link{CovClassic}}}. \item{scale}{a value indicating whether and how the variables should be scaled to have unit variance (only possible if there are no constant variables). If \code{scale=FALSE} (default) or \code{scale=NULL} no scaling is performed (a vector of 1s is returned in the scale slot). If \code{scale=TRUE} the data are scaled by the estimator used to compute the covariance matrix (\code{MCD} by default). Alternatively it can be a function like \code{sd} or \code{Qn} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the scale slot. Default is \code{scale=FALSE}.} \item{signflip}{a logical value indicating wheather to try to solve the sign indeterminancy of the loadings - ad hoc approach setting the maximum element in a singular vector to be positive. Default is \code{signflip = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } \details{ \code{PcaCov}, serving as a constructor for objects of class \code{\link{PcaCov-class}} is a generic function with "formula" and "default" methods. For details see the relevant references. } \value{ An S4 object of class \code{\link{PcaCov-class}} which is a subclass of the virtual class \code{\link{PcaRobust-class}}. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } %\note{} \examples{ ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaCov(hbk) pca ## Compare with the classical PCA prcomp(hbk) ## or PcaClassic(hbk) ## If you want to print the scores too, use print(pca, print.x=TRUE) ## Using the formula interface PcaCov(~., data=hbk) ## To plot the results: plot(pca) # distance plot pca2 <- PcaCov(hbk, k=2) plot(pca2) # PCA diagnostic plot (or outlier map) ## Use the standard plots available for for prcomp and princomp screeplot(pca) biplot(pca) } \keyword{robust} \keyword{multivariate} rrcov/man/CovControl-class.Rd0000644000176200001440000000212512763517421015652 0ustar liggesusers\name{CovControl-class} \docType{class} \alias{CovControl-class} \title{Class "CovControl" is a VIRTUAL base control class } \description{ The class "CovControl" is a VIRTUAL base control class for the derived classes representing the control parameters for the different robust methods } \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \arguments{ \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{tolSolve}{numeric tolerance to be used for inversion (\code{\link{solve}}) of the covariance matrix in \code{\link{mahalanobis}}.} } \section{Methods}{ No methods defined with class "CovControl" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/bus.Rd0000644000176200001440000001233112763517421013250 0ustar liggesusers\name{bus} \alias{bus} \docType{data} \title{ Automatic vehicle recognition data} \description{ The data set bus (Hettich and Bay, 1999) corresponds to a study in automatic vehicle recognition (see Maronna et al. 2006, page 213, Example 6.3)). This data set from the Turing Institute, Glasgow, Scotland, contains measures of shape features extracted from vehicle silhouettes. The images were acquired by a camera looking downward at the model vehicle from a fixed angle of elevation. Each of the 218 rows corresponds to a view of a bus silhouette, and contains 18 attributes of the image. } \usage{data(bus)} \format{ A data frame with 218 observations on the following 18 variables: \describe{ \item{\code{V1}}{compactness} \item{\code{V2}}{circularity} \item{\code{V3}}{distance circularity} \item{\code{V4}}{radius ratio} \item{\code{V5}}{principal axis aspect ratio} \item{\code{V6}}{maximum length aspect ratio} \item{\code{V7}}{scatter ratio} \item{\code{V8}}{elongatedness} \item{\code{V9}}{principal axis rectangularity} \item{\code{V10}}{maximum length rectangularity} \item{\code{V11}}{scaled variance along major axis} \item{\code{V12}}{scaled variance along minor axis} \item{\code{V13}}{scaled radius of gyration} \item{\code{V14}}{skewness about major axis} \item{\code{V15}}{skewness about minor axis} \item{\code{V16}}{kurtosis about minor axis} \item{\code{V17}}{kurtosis about major axis} \item{\code{V18}}{hollows ratio} } } %%\details{} \source{ Hettich, S. and Bay, S.D. (1999), The UCI KDD Archive, Irvine, CA:University of California, Department of Information and Computer Science, %% \url{http://kdd.ics.uci.edu} 'http://kdd.ics.uci.edu' } \references{ Maronna, R., Martin, D. and Yohai, V., (2006). Robust Statistics: Theory and Methods. Wiley, New York. } \examples{ ## Reproduce Table 6.3 from Maronna et al. (2006), page 213 data(bus) bus <- as.matrix(bus) ## calculate MADN for each variable xmad <- apply(bus, 2, mad) cat("\nMin, Max of MADN: ", min(xmad), max(xmad), "\n") ## MADN vary between 0 (for variable 9) and 34. Therefore exclude ## variable 9 and divide the remaining variables by their MADNs. bus1 <- bus[, -9] madbus <- apply(bus1, 2, mad) bus2 <- sweep(bus1, 2, madbus, "/", check.margin = FALSE) ## Compute classical and robust PCA (Spherical/Locantore, Hubert, MCD and OGK) pca <- PcaClassic(bus2) rpca <- PcaLocantore(bus2) pcaHubert <- PcaHubert(bus2, k=17, kmax=17, mcd=FALSE) pcamcd <- PcaCov(bus2, cov.control=CovControlMcd()) pcaogk <- PcaCov(bus2, cov.control=CovControlOgk()) ev <- getEigenvalues(pca) evrob <- getEigenvalues(rpca) evhub <- getEigenvalues(pcaHubert) evmcd <- getEigenvalues(pcamcd) evogk <- getEigenvalues(pcaogk) uvar <- matrix(nrow=6, ncol=6) svar <- sum(ev) svarrob <- sum(evrob) svarhub <- sum(evhub) svarmcd <- sum(evmcd) svarogk <- sum(evogk) for(i in 1:6){ uvar[i,1] <- i uvar[i,2] <- round((svar - sum(ev[1:i]))/svar, 3) uvar[i,3] <- round((svarrob - sum(evrob[1:i]))/svarrob, 3) uvar[i,4] <- round((svarhub - sum(evhub[1:i]))/svarhub, 3) uvar[i,5] <- round((svarmcd - sum(evmcd[1:i]))/svarmcd, 3) uvar[i,6] <- round((svarogk - sum(evogk[1:i]))/svarogk, 3) } uvar <- as.data.frame(uvar) names(uvar) <- c("q", "Classical","Spherical", "Hubert", "MCD", "OGK") cat("\nBus data: proportion of unexplained variability for q components\n") print(uvar) ## Reproduce Table 6.4 from Maronna et al. (2006), page 214 ## ## Compute classical and robust PCA extracting only the first 3 components ## and take the squared orthogonal distances to the 3-dimensional hyperplane ## pca3 <- PcaClassic(bus2, k=3) # classical rpca3 <- PcaLocantore(bus2, k=3) # spherical (Locantore, 1999) hpca3 <- PcaHubert(bus2, k=3) # Hubert dist <- pca3@od^2 rdist <- rpca3@od^2 hdist <- hpca3@od^2 ## calculate the quantiles of the distances to the 3-dimensional hyperplane qclass <- round(quantile(dist, probs = seq(0, 1, 0.1)[-c(1,11)]), 1) qspc <- round(quantile(rdist, probs = seq(0, 1, 0.1)[-c(1,11)]), 1) qhubert <- round(quantile(hdist, probs = seq(0, 1, 0.1)[-c(1,11)]), 1) qq <- cbind(rbind(qclass, qspc, qhubert), round(c(max(dist), max(rdist), max(hdist)), 0)) colnames(qq)[10] <- "Max" rownames(qq) <- c("Classical", "Spherical", "Hubert") cat("\nBus data: quantiles of distances to hiperplane\n") print(qq) ## ## Reproduce Fig 6.1 from Maronna et al. (2006), page 214 ## cat("\nBus data: Q-Q plot of logs of distances to hyperplane (k=3) \nfrom classical and robust estimates. The line is the identity diagonal\n") plot(sort(log(dist)), sort(log(rdist)), xlab="classical", ylab="robust") lines(sort(log(dist)), sort(log(dist))) } \keyword{datasets} rrcov/man/LdaPP-class.Rd0000644000176200001440000000666112763517421014533 0ustar liggesusers\name{LdaPP-class} \docType{class} \alias{LdaPP-class} \alias{predict,LdaPP-method} \title{Class "LdaPP" - Robust method for Linear Discriminant Analysis by Projection-pursuit} \description{ The class \code{LdaPP} represents an algorithm for robust linear discriminant analysis by projection-pursuit approach. The objects of class \code{LdaPP} contain the results of the robust linear discriminant analysis by projection-pursuit approach. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("LdaPP", ...)} but the usual way of creating \code{LdaPP} objects is a call to the function \code{LdaPP} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the common covariance matrix} \item{\code{raw.ldf}:}{a matrix containing the raw linear discriminant functions - see Details in \code{\link{LdaPP}}} \item{\code{raw.ldfconst}:}{a vector containing the raw constants of each raw linear discriminant function - see Details in \code{\link{LdaPP}}} \item{\code{ldf}:}{a matrix containing the linear discriminant functions} \item{\code{ldfconst}:}{a vector containing the constants of each linear discriminant function} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} } } \section{Extends}{ Class \code{"\linkS4class{LdaRobust}"}, directly. Class \code{"\linkS4class{Lda}"}, by class "LdaRobust", distance 2. } \section{Methods}{ \describe{ \item{predict}{\code{signature(object = "LdaPP")}: calculates prediction using the results in \code{object}. An optional data frame or matrix in which to look for variables with which to predict. If omitted, the training data set is used. If the original fit used a formula or a data frame or a matrix with column names, newdata must contain columns with the same names. Otherwise it must contain the same number of columns, to be used in the same order. If the argument \code{raw=TRUE} is set the raw (obtained by the first approximation algorithm) linear discriminant function and constant will be used.} } } \references{ Pires, A. M. and A. Branco, J. (2010) Projection-pursuit approach to robust linear discriminant analysis \emph{Journal Multivariate Analysis}, Academic Press, Inc., \bold{101}, 2464--2485. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} and Ana Pires \email{apires@math.ist.utl.pt} } \seealso{ \code{\link{LdaRobust-class}}, \code{\link{Lda-class}}, \code{\link{LdaClassic}}, \code{\link{LdaClassic-class}}, \code{\link{Linda}}, \code{\link{Linda-class}} } \examples{ showClass("LdaPP") } \keyword{robust} \keyword{multivariate} rrcov/man/olitos.Rd0000644000176200001440000000453413372331044013766 0ustar liggesusers\name{olitos} \alias{olitos} \docType{data} \title{ Olive Oil Data } \description{ This dataset consists of 120 olive oil samples on measurements on 25 chemical compositions (fatty acids, sterols, triterpenic alcohols) of olive oils from Tuscany, Italy (Armanino et al. 1989). There are 4 classes corresponding to different production areas. Class 1, Class 2, Class 3, and Class 4 contain 50, 25, 34, and 11 observations, respectively. } \usage{data(olitos)} \format{ A data frame with 120 observations on the following 26 variables. \describe{ \item{\code{X1}}{Free fatty acids} \item{\code{X2}}{Refractive index} \item{\code{X3}}{K268} \item{\code{X4}}{delta K} \item{\code{X5}}{Palmitic acid} \item{\code{X6}}{Palmitoleic acid} \item{\code{X7}}{a numeric vector} \item{\code{X8}}{a numeric vector} \item{\code{X9}}{a numeric vector} \item{\code{X10}}{a numeric vector} \item{\code{X11}}{a numeric vector} \item{\code{X12}}{a numeric vector} \item{\code{X13}}{a numeric vector} \item{\code{X14}}{a numeric vector} \item{\code{X15}}{a numeric vector} \item{\code{X16}}{a numeric vector} \item{\code{X17}}{a numeric vector} \item{\code{X18}}{a numeric vector} \item{\code{X19}}{a numeric vector} \item{\code{X20}}{a numeric vector} \item{\code{X21}}{a numeric vector} \item{\code{X22}}{a numeric vector} \item{\code{X23}}{a numeric vector} \item{\code{X24}}{a numeric vector} \item{\code{X25}}{a numeric vector} \item{\code{grp}}{a factor with levels \code{1} \code{2} \code{3} \code{4}} } } \source{ Prof. Roberto Todeschini, Milano Chemometrics and QSAR Research Group \url{http://michem.disat.unimib.it/chm/download/datasets.htm} } \references{ C. Armanino, R. Leardi, S. Lanteri and G. Modi, 1989. Chemometric analysis of Tuscan olive oils. \emph{Cbemometrics and Intelligent Laboratoty Sysiem}, 5: 343--354. R. Todeschini, V. Consonni, A. Mauri, M. Pavan (2004) Software for the calculation of molecular descriptors. Pavan M. Talete slr, Milan, Italy, \url{http://www.talete.mi.it} } \examples{ data(olitos) cc <- Linda(grp~., data=olitos, method="mcdC", l1med=TRUE) cc pr <- predict(cc) tt <- mtxconfusion(cc@grp, pr@classification, printit=TRUE) } \keyword{datasets} rrcov/man/LdaRobust-class.Rd0000644000176200001440000000344212763517421015464 0ustar liggesusers\name{LdaRobust-class} \docType{class} \alias{LdaRobust-class} \title{Class "LdaRobust" is a virtual base class for all robust LDA classes } \description{ The class \code{LdaRobust} searves as a base class for deriving all other classes representing the results of the robust Linear Discriminant Analysis methods} \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the common covariance matrix} \item{\code{ldf}:}{a matrix containing the linear discriminant functions} \item{\code{ldfconst}:}{a vector containing the constants of each linear discriminant function} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} } } \section{Extends}{ Class \code{"\linkS4class{Lda}"}, directly. } \section{Methods}{ No methods defined with class "LdaRobust" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{Lda-class}}, \code{\link{LdaClassic-class}}, } \examples{ showClass("LdaRobust") } \keyword{robust} \keyword{multivariate} rrcov/man/CovMMest-class.Rd0000644000176200001440000000417012763517421015261 0ustar liggesusers\name{CovMMest-class} \Rdversion{1.1} \docType{class} \alias{CovMMest-class} \title{ MM Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates MM Estimates of multivariate location and scatter.} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovMMest", ...)}, but the usual way of creating \code{CovSest} objects is a call to the function \code{CovMMest} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{det}, \code{flag}, \code{iter}, \code{crit}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{c1}{tuning parameter of the loss function for MM-estimation (depend on control parameters \code{eff} and \code{eff.shape}). Can be computed by the internal function \code{.csolve.bw.MM(p, eff, eff.shape=TRUE)}. For the tuning parameters of the underlying S-estimate see the slot \code{sest} and \code{"\linkS4class{CovSest}"}. } \item{sest}{an \code{CovSest} object containing the initial S-estimate. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovMMest" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMMest}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovMMest") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovClassic.Rd0000644000176200001440000000247012763517421014513 0ustar liggesusers\name{CovClassic} \alias{CovClassic} \alias{Cov} \title{Classical Estimates of Multivariate Location and Scatter} \concept{High breakdown point} \description{ Computes the classical estimates of multivariate location and scatter. Returns an S4 class \code{CovClassic} with the estimated \code{center}, \code{cov}, Mahalanobis distances and weights based on these distances. } \usage{ CovClassic(x, unbiased=TRUE) Cov(x, unbiased=TRUE) } \arguments{ \item{x}{a matrix or data frame. As usual, rows are observations and columns are variables. } \item{unbiased}{ whether to return the unbiased estimate of the covariance matrix. Default is \code{unbiased = TRUE}} } %\details{} \value{ An object of class \code{"CovClassic"}. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} \seealso{ \code{\link{Cov-class}}, \code{\link{CovClassic-class}} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cv <- CovClassic(hbk.x) cv summary(cv) plot(cv) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovControlSde-class.Rd0000644000176200001440000000455312763517421016315 0ustar liggesusers\name{CovControlSde-class} \Rdversion{1.1} \docType{class} \alias{CovControlSde-class} \alias{restimate,CovControlSde-method} \title{Class 'CovControlSde' - contains control parameters for "CovSde"} \description{ This class extends the \code{CovControl} class and contains the control parameters for CovSde } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlSde", ...)} or by calling the constructor-function \code{CovControlSde}. } \section{Slots}{ \describe{ \item{\code{nsamp}}{a positive integer giving the number of resamples required} \item{\code{maxres}}{a positive integer specifying the maximum number of resamples to be performed including those that are discarded due to linearly dependent subsamples.} \item{\code{tune}}{a numeric value between 0 and 1 giving the fraction of the data to receive non-zero weight. Default is \code{tune = 0.95}.} \item{\code{prob}}{a numeric value between 0 and 1 specifying the probability of high breakdown point; used to compute \code{nsamp} when \code{nsamp} is omitted. Default is \code{prob = 0.99}.} \item{\code{eps}}{a numeric value between 0 and 0.5 specifying the breakdown point; used to compute \code{nsamp} when \code{nresamp} is omitted. Default is \code{eps = 0.5}.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlSde")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlSde", nsamp=2000) ctrl2 <- CovControlSde(nsamp=2000) data(hbk) CovSde(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/scorePlot.Rd0000644000176200001440000000244012763517421014431 0ustar liggesusers\name{scorePlot-methods} \docType{methods} \alias{scorePlot} \alias{scorePlot-methods} \alias{scorePlot,ANY-method} \alias{scorePlot,Pca-method} \title{ Score plot for Principal Components (objects of class 'Pca') } \description{ Produces a score plot from an object (derived from) \code{\link{Pca-class}}. } \usage{ \S4method{scorePlot}{Pca}(x, i=1, j=2, \dots) } \arguments{ \item{x}{an object of class (derived from) \code{"Pca"}.} \item{i}{First score coordinate, defaults to \code{i=1}.} \item{j}{Second score coordinate, defaults to \code{j=2}.} \item{\dots}{optional arguments to be passed to the internal graphical functions.} } \section{Side Effects}{ a plot is produced on the current graphics device. } \section{Methods}{ \describe{ \item{scorePlot}{\code{signature(x = Pca)}: Plot a scatter plot of ith against jth score of the Pca object with superimposed tollerance (0.975) ellipse. See also \code{\link{biplot}}, \code{\link{screeplot}}.} }} %\references{} \seealso{ \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaRobust-class}}. } \examples{ require(graphics) ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaHubert(hbk) pca scorePlot(pca) } \keyword{multivariate} \keyword{hplot} rrcov/man/rice.Rd0000644000176200001440000000250012763517421013376 0ustar liggesusers\name{rice} \alias{rice} \docType{data} \title{ Rice taste data} \description{ The rice taste data consists of five inputs and a single output whose values are associated with subjective evaluations as follows: xl: flavor, x2: appearance, x3: taste, x4: stickiness, x5: toughness, y: overall evaluation. Sensory test data have been obtained by such subjective evaluations for 105 kinds of rice (e.g., Sasanishiki, Akita-Komachi, etc.). The data set was used by Nozaki et al. (1997) to demonstrate the high performance of a proposed for automatically generating fuzzy if-then rules from numerical data. } \usage{data(rice)} \format{ A data frame with 105 observations on the following 6 variables: \describe{ \item{\code{Favor}}{compactness} \item{\code{Appearance}}{circularity} \item{\code{Taste}}{distance circularity} \item{\code{Stickiness}}{radius ratio} \item{\code{Toughness}}{principal axis aspect ratio} \item{\code{Overall_evaluation}}{maximum length aspect ratio} } } %%\details{} \source{ Nozaki, K., Ishibuchi, H, and Tanaka, H. (1997) A simple but powerful heuristic method for generating fuzzy rules from numerical data \emph{Fuzzy Sets and Systems} \bold{86} 3 p. 251--270. } %\references{} %\examples{} \keyword{datasets} rrcov/man/PcaClassic-class.Rd0000644000176200001440000000570112763517421015572 0ustar liggesusers\name{PcaClassic-class} \docType{class} \alias{PcaClassic-class} \alias{getQuan,PcaClassic-method} \title{Class "PcaClassic" - Principal Components Analysis } \description{ Contains the results of a classical Principal Components Analysis } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaClassic", ...)} but the usual way of creating \code{PcaClassic} objects is a call to the function \code{PcaClassic} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"language"} } \item{\code{center}:}{Object of class \code{"vector"} the center of the data } \item{\code{scale}:}{Object of class \code{"vector"} the scaling applied to each variable } \item{\code{loadings}:}{Object of class \code{"matrix"} the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors) } \item{\code{eigenvalues}:}{Object of class \code{"vector"} the eigenvalues } \item{\code{scores}:}{Object of class \code{"matrix"} the scores - the value of the projected on the space of the principal components data (the centred (and scaled if requested) data multiplied by the \code{loadings} matrix) is returned. Hence, \code{cov(scores)} is the diagonal matrix \code{diag(eigenvalues)} } \item{\code{k}:}{Object of class \code{"numeric"} number of (choosen) principal components } \item{\code{sd}:}{Object of class \code{"Uvector"} Score distances within the robust PCA subspace } \item{\code{od}:}{Object of class \code{"Uvector"} Orthogonal distances to the robust PCA subspace } \item{\code{cutoff.sd}:}{Object of class \code{"numeric"} Cutoff value for the score distances} \item{\code{cutoff.od}:}{Object of class \code{"numeric"} Cutoff values for the orthogonal distances } \item{\code{flag}:}{Object of class \code{"Uvector"} The observations whose score distance is larger than cutoff.sd or whose orthogonal distance is larger than cutoff.od can be considered as outliers and receive a flag equal to zero. The regular observations receive a flag 1 } \item{\code{n.obs}:}{Object of class \code{"numeric"} the number of observations } } } \section{Extends}{ Class \code{"\linkS4class{Pca}"}, directly. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaClassic")}: returns the number of observations used in the computation, i.e. n.obs } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}} } \examples{ showClass("PcaClassic") } \keyword{robust} \keyword{multivariate} rrcov/man/CovMest.Rd0000644000176200001440000001213612763517421014042 0ustar liggesusers\name{CovMest} \alias{CovMest} \title{Constrained M-Estimates of Location and Scatter} \concept{High breakdown point} \usage{ CovMest(x, r = 0.45, arp = 0.05, eps=1e-3, maxiter=120, control, t0, S0, initcontrol) } \description{ Computes constrained M-Estimates of multivariate location and scatter based on the translated biweight function (\sQuote{t-biweight}) using a High breakdown point initial estimate as defined by Rocke (1996). The default initial estimate is the Minimum Volume Ellipsoid computed with \code{\link{CovMve}}. The raw (not reweighted) estimates are taken and the covariance matrix is standardized to determinant 1. } \arguments{ \item{x}{a matrix or data frame. } \item{r}{ required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is 0.45} \item{arp}{ asympthotic rejection point, i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{0.05}.} \item{eps}{ a numeric value specifying the relative precision of the solution of the M-estimate. Defaults to \code{1e-3}} \item{maxiter}{ maximum number of iterations allowed in the computation of the M-estimate. Defaults to 120} \item{control}{ a control object (S4) of class \code{\link{CovControlMest-class}} containing estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} \item{t0}{ optional initial high breakdown point estimates of the location. If not supplied MVE will be used. } \item{S0}{ optional initial high breakdown point estimates of the scatter. If not supplied MVE will be used. } \item{initcontrol}{ optional control object - of class CovControl - specifing the initial high breakdown point estimates of location and scatter. If not supplied MVE will be used. } } \details{ Rocke (1996) has shown that the S-estimates of multivariate location and scatter in high dimensions can be sensitive to outliers even if the breakdown point is set to be near 0.5. To mitigate this problem he proposed to utilize the translated biweight (or t-biweight) method with a standardization step consisting of equating the median of \code{rho(d)} with the median under normality. This is then not an S-estimate, but is instead a constrained M-estimate. In order to make the smooth estimators to work, a reasonable starting point is necessary, which will lead reliably to a good solution of the estimator. In \code{CovMest} the MVE computed by \code{\link{CovMve}} is used, but the user has the possibility to give her own initial estimates. } \note{ The psi, rho and weight functions for the M estimation are encapsulated in a virtual S4 class \code{PsiFun} from which a \code{PsiBwt} class, implementing the translated biweight (t-biweight), is dervied. The base class \code{PsiFun} contains also the M-iteration itself. Although not documented and not accessibale directly by the user these classes will form the bases for adding other functions (biweight, LWS, etc.) as well as S-estimates. } \author{Valentin Todorov \email{valentin.todorov@chello.at}, (some code from C. Becker - http://www.sfb475.uni-dortmund.de/dienst/de/content/struk-d/bereicha-d/tpa1softw-d.html) } \value{ An object of class \code{\link{CovMest-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ D.L.Woodruff and D.M.Rocke (1994) Computable robust estimation of multivariate location and shape on high dimension using compound estimators, \emph{Journal of the American Statistical Association}, \bold{89}, 888--896. D.M.Rocke (1996) Robustness properties of S-estimates of multivariate location and shape in high dimension, \emph{Annals of Statistics}, \bold{24}, 1327-1345. D.M.Rocke and D.L.Woodruff (1996) Identification of outliers in multivariate data \emph{Journal of the American Statistical Association}, \bold{91}, 1047--1061. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \seealso{ \code{\link[robustbase]{covMcd}}, \code{\link{Cov-class}}, \code{\link{CovMve}}, \code{\link{CovRobust-class}}, \code{\link{CovMest-class}} } \examples{ library(rrcov) data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovMest(hbk.x) ## the following four statements are equivalent c0 <- CovMest(hbk.x) c1 <- CovMest(hbk.x, r = 0.45) c2 <- CovMest(hbk.x, control = CovControlMest(r = 0.45)) c3 <- CovMest(hbk.x, control = new("CovControlMest", r = 0.45)) ## direct specification overrides control one: c4 <- CovMest(hbk.x, r = 0.40, control = CovControlMest(r = 0.25)) c1 summary(c1) plot(c1) } \keyword{robust} \keyword{multivariate} rrcov/man/octane.Rd0000644000176200001440000000251713372401407013726 0ustar liggesusers\name{octane} \alias{octane} \docType{data} \title{ Octane data } \description{ The octane data contains near infrared absorbance spectra (NIR) of \code{n=39} gasoline samples over \code{p=226} wavelengths ranging from 1102 nm to 1552 nm with measurements every two nanometers. For each of the 39 production gasoline samples the octane number was measured. Six of the samples (25, 26, and 36-39) contain added alcohol. } \usage{data(octane)} \format{ A data frame with 39 observations and 226 columns, the wavelengts are by column. } %\details{} \source{ K.H. Esbensen, S. Schoenkopf and T. Midtgaard \emph{Multivariate Analysis in Practice}, Trondheim, Norway: Camo, 1994. } \references{ M. Hubert, P. J. Rousseeuw, K. Vanden Branden (2005), ROBPCA: a new approach to robust principal components analysis, \emph{Technometrics}, \bold{47}, 64--79. P. J. Rousseeuw, M. Debruyne, S. Engelen and M. Hubert (2006), Robustness and Outlier Detection in Chemometrics, \emph{Critical Reviews in Analytical Chemistry}, \bold{36}(3--4), 221--242. } \examples{ data(octane) pca=PcaHubert(octane, k=10) screeplot(pca, type="lines") pca2 <- PcaHubert(octane, k=2) plot(pca2, id.n.sd=6) pca7 <- PcaHubert(octane, k=7) plot(pca7, id.n.sd=6) } \keyword{datasets} rrcov/man/CovControlMve-class.Rd0000644000176200001440000000476512763517421016336 0ustar liggesusers\name{CovControlMve-class} \docType{class} \alias{CovControlMve-class} \alias{restimate,CovControlMve-method} \title{Class 'CovControlMve' - contains control parameters for CovMve } \description{ This class extends the \code{CovControl} class and contains the control parameters for \code{"CovMve"} } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlMve", ...)} or by calling the constructor-function \code{CovControlMve}. } \section{Slots}{ \describe{ \item{\code{alpha}:}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{\code{nsamp}:}{ number of subsets used for initial estimates or \code{"best"} or \code{"exact"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time.} \item{\code{seed}:}{starting value for random generator. Default is \code{seed = NULL}} \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlMve")}: the generic function \code{restimate} allowes the different methods for robust estimation to be used polymorphically - this function will call \code{CovMve} passing it the control object and will return the obtained \code{CovRobust} object} }} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMve", alpha=0.75) ctrl2 <- CovControlMve(alpha=0.75) data(hbk) CovMve(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovMest-class.Rd0000644000176200001440000000362212763517421015145 0ustar liggesusers\name{CovMest-class} \Rdversion{1.1} \docType{class} \alias{CovMest-class} \title{Constrained M-estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class "CovRobust" accomodates constrained M-Estimates of multivariate location and scatter based on the translated biweight function (\sQuote{t-biweight}) using a High breakdown point initial estimate (Minimum Covariance Determinant - \sQuote{Fast MCD})} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovMest", ...)}, but the usual way of creating \code{CovMest} objects is a call to the function \code{CovMest} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{vt}:}{Object of class \code{"vector"} - vector of weights (v)} \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovMest" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{CovMest}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovMest") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovOgk-class.Rd0000644000176200001440000000441412763517421014755 0ustar liggesusers\name{CovOgk-class} \Rdversion{1.1} \docType{class} \alias{CovOgk-class} \title{ OGK Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates OGK Estimates of multivariate location and scatter computed by the algorithm proposed by Marona and Zamar (2002). } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovOgk", ...)}, but the usual way of creating \code{CovOgk} objects is a call to the function \code{CovOgk} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{raw.cov}:}{Object of class \code{"matrix"} the raw (not reweighted) estimate of covariance matrix } \item{\code{raw.center}:}{Object of class \code{"vector"} - the raw (not reweighted) estimate of the location vector} \item{\code{raw.mah}:}{Object of class \code{"Uvector"} - mahalanobis distances of the observations based on the raw estimate of the location and scatter } \item{\code{raw.wt}:}{Object of class \code{"Uvector"} - weights of the observations based on the raw estimate of the location and scatter } \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovOgk" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMcd-class}}, \code{\link{CovMest-class}} } \examples{ showClass("CovOgk") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/SummaryCov-class.Rd0000644000176200001440000000334712763517421015676 0ustar liggesusers\name{SummaryCov-class} \docType{class} \alias{SummaryCov-class} \alias{getCenter,SummaryCov-method} \alias{getCov,SummaryCov-method} \alias{getDistance,SummaryCov-method} \alias{getEvals,SummaryCov-method} \alias{isClassic,SummaryCov-method} \alias{show,SummaryCov-method} \title{Class "SummaryCov" - summary of "Cov" objects } \description{The "Cov" object plus some additional summary information} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("SummaryCov", ...)}, but most often by invoking 'summary' on a "Cov" object. They contain values meant for printing by 'show'. } \section{Slots}{ \describe{ \item{\code{covobj}:}{Object of class \code{"Cov"}} \item{\code{evals}:}{eigenvalues of the covariance or correlation matrix } } } \section{Methods}{ \describe{ \item{getCenter}{\code{signature(obj = "SummaryCov")}: location vector } \item{getCov}{\code{signature(obj = "SummaryCov")}: covariance matrix } \item{getDistance}{\code{signature(obj = "SummaryCov")}: vector of distances } \item{getEvals}{\code{signature(obj = "SummaryCov")}: vector of eignevalues } \item{isClassic}{\code{signature(obj = "SummaryCov")}: is the estimate a classic one } \item{show}{\code{signature(object = "SummaryCov")}: display the object } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Cov-class}} } \examples{ showClass("SummaryCov") } \keyword{classes} rrcov/man/getLoadings-methods.Rd0000644000176200001440000000177413365444614016373 0ustar liggesusers\name{getLoadings-methods} \docType{methods} \alias{getLoadings-methods} \alias{getLoadings} \alias{getEigenvalues,methods} \alias{getEigenvalues} \alias{getPrcomp,methods} \alias{getPrcomp} \alias{getScores,methods} \alias{getScores} \alias{getSdev,methods} \alias{getSdev} \alias{getQuan,methods} \alias{getQuan} \alias{getScale,methods} \alias{getScale} \alias{names,Pca-method} \alias{$,Pca-method} \title{ Accessor methods to the essential slots of Pca and its subclasses} \description{ Accessor methods to the slots of objects of class \code{Pca} and its subclasses } \arguments{ \item{obj}{an object of class \code{"Pca"} or of a class derived from \code{"Pca"} } } \section{Methods}{ \describe{ \item{obj = "Pca"}{Accessors for object of class \code{Pca}} \item{obj = "PcaRobust"}{Accessors for object of class \code{PcaRobust}} \item{obj = "PcaClassic"}{Accessors for object of class \code{PcaClassic}} }} \keyword{methods} \keyword{multivariate} \keyword{robust} rrcov/man/biplot.Rd0000644000176200001440000000330712763517421013753 0ustar liggesusers\name{biplot-methods} \docType{methods} \alias{biplot} \alias{biplot-methods} \alias{biplot,ANY-method} \alias{biplot,Pca-method} \title{ Biplot for Principal Components (objects of class 'Pca') } \description{ Produces a biplot from an object (derived from) \code{\link{Pca-class}}. } \usage{ \S4method{biplot}{Pca}(x, choices=1L:2L, scale=1, \dots) } \arguments{ \item{x}{an object of class (derived from) \code{"Pca"}.} \item{choices}{length 2 vector specifying the components to plot. Only the default is a biplot in the strict sense.} \item{scale}{ The variables are scaled by \code{lambda ^ scale} and the observations are scaled by \code{lambda ^ (1-scale)} where \code{lambda} are the singular values as computed by the Principal Components function. Normally \code{0 <= scale <= 1}, and a warning will be issued if the specified \code{scale} is outside this range. } \item{\dots}{optional arguments to be passed to the internal graphical functions.} } \section{Side Effects}{ a plot is produced on the current graphics device. } \section{Methods}{ \describe{ \item{biplot}{\code{signature(x = Pca)}: Plot a biplot, i.e. represent both the observations and variables of a matrix of multivariate data on the same plot. See also \code{\link{biplot.princomp}}.} }} \references{ Gabriel, K. R. (1971). The biplot graphical display of matrices with applications to principal component analysis. \emph{Biometrika}, \bold{58}, 453--467. } \seealso{ \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaRobust-class}}. } \examples{ require(graphics) biplot(PcaClassic(USArrests, k=2)) } \keyword{multivariate} \keyword{hplot} rrcov/man/PcaHubert.Rd0000644000176200001440000002103112763517421014331 0ustar liggesusers\name{PcaHubert} \alias{PcaHubert} \alias{PcaHubert.formula} \alias{PcaHubert.default} \title{ ROBPCA - ROBust method for Principal Components Analysis } \description{ The ROBPCA algorithm was proposed by Hubert et al (2005) and stays for 'ROBust method for Principal Components Analysis'. It is resistant to outliers in the data. The robust loadings are computed using projection-pursuit techniques and the MCD method. Therefore ROBPCA can be applied to both low and high-dimensional data sets. In low dimensions, the MCD method is applied. } \usage{ PcaHubert(x, ...) \method{PcaHubert}{default}(x, k = 0, kmax = 10, alpha = 0.75, mcd = TRUE, maxdir=250, scale = FALSE, signflip = TRUE, crit.pca.distances = 0.975, trace=FALSE, \dots) \method{PcaHubert}{formula}(formula, data = NULL, subset, na.action, \dots) } \arguments{ \item{formula}{a formula with no response variable, referring only to numeric variables.} \item{data}{an optional data frame (or similar: see \code{\link{model.frame}}) containing the variables in the formula \code{formula}.} \item{subset}{an optional vector used to select rows (observations) of the data matrix \code{x}.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is set by the \code{na.action} setting of \code{\link{options}}, and is \code{\link{na.fail}} if that is unset. The default is \code{\link{na.omit}}.} \item{\dots}{arguments passed to or from other methods.} \item{x}{a numeric matrix (or data frame) which provides the data for the principal components analysis.} \item{k}{number of principal components to compute. If \code{k} is missing, or \code{k = 0}, the algorithm itself will determine the number of components by finding such \code{k} that \eqn{l_k/l_1 >= 10.E-3} and \eqn{\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j >= 0.8}. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is \code{k=0}. } \item{kmax}{maximal number of principal components to compute. Default is \code{kmax=10}. If \code{k} is provided, \code{kmax} does not need to be specified, unless \code{k} is larger than 10.} \item{alpha}{this parameter measures the fraction of outliers the algorithm should resist. In MCD alpha controls the size of the subsets over which the determinant is minimized, i.e. alpha*n observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.75. } \item{mcd}{Logical - when the number of variables is sufficiently small, the loadings are computed as the eigenvectors of the MCD covariance matrix, hence the function \code{\link{CovMcd}()} is automatically called. The number of principal components is then taken as k = rank(x). Default is \code{mcd=TRUE}. If \code{mcd=FALSE}, the ROBPCA algorithm is always applied.} \item{maxdir}{maximal number of random directions to use for computing the outlyingness of the data points. Default is \code{maxdir=250}. If the number \code{n} of observations is small all possible \code{n*(n-1)/2} pairs of observations are taken to generate the directions.} \item{scale}{a value indicating whether and how the variables should be scaled. If \code{scale=FALSE} (default) or \code{scale=NULL} no scaling is performed (a vector of 1s is returned in the scale slot). If \code{scale=TRUE} the data are scaled to have unit variance. Alternatively it can be a function like \code{sd} or \code{mad} or a vector of length equal the number of columns of \code{x}. The value is passed to the underlying function and the result returned is stored in the scale slot. Default is \code{scale=FALSE}.} \item{signflip}{a logical value indicating wheather to try to solve the sign indeterminancy of the loadings - ad hoc approach setting the maximum element in a singular vector to be positive. Default is \code{signflip = FALSE}} \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } \details{ \code{PcaHubert}, serving as a constructor for objects of class \code{\link{PcaHubert-class}} is a generic function with "formula" and "default" methods. The calculation is done using the ROBPCA method of Hubert et al (2005) which can be described briefly as follows. For details see the relevant references. Let \code{n} denote the number of observations, and \code{p} the number of original variables in the input data matrix \code{X}. The ROBPCA algorithm finds a robust center \code{M (p x 1)} of the data and a loading matrix \code{P} which is \code{(p x k)} dimensional. Its columns are orthogonal and define a new coordinate system. The scores T, an \code{(n x k)} matrix, are the coordinates of the centered observations with respect to the loadings: \deqn{T=(X-M)P} The ROBPCA algorithm also yields a robust covariance matrix (often singular) which can be computed as \deqn{S=PLP^t} where \eqn{L} is the diagonal matrix with the eigenvalues \eqn{l_1, \dots, \l_k}. This is done in the following three main steps: \bold{Step 1:} The data are preprocessed by reducing their data space to the subspace spanned by the \code{n} observations. This is done by singular value decomposition of the input data matrix. As a result the data are represented using at most \code{n-1=rank(X)} without loss of information. \bold{Step 2:} In this step for each data point a measure of outlyingness is computed. For this purpose the high-dimensional data points are projected on many univariate directions, each time the univariate MCD estimator of location and scale is computed and the standardized distance to the center is measured. The largest of these distances (over all considered directions) is the outlyingness measure of the data point. The \code{h} data points with smallest outlyingness measure are used to compute the covariance matrix \eqn{\Sigma_h} and to select the number \code{k} of principal components to retain. This is done by finding such \code{k} that \eqn{l_k/l_1 >= 10.E-3} and \eqn{\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j >= 0.8} Alternatively the number of principal components \code{k} can be specified by the user after inspecting the scree plot. \bold{Step 3:} The data points are projected on the k-dimensional subspace spanned by the \code{k} eigenvectors corresponding to the largest \code{k} eigenvalues of the matrix \eqn{\Sigma_h}. The location and scatter of the projected data are computed using the reweighted MCD estimator and the eigenvectors of this scatter matrix yield the robust principal components. } \value{ An S4 object of class \code{\link{PcaHubert-class}} which is a subclass of the virtual class \code{\link{PcaRobust-class}}. } \references{ M. Hubert, P. J. Rousseeuw, K. Vanden Branden (2005), ROBPCA: a new approach to robust principal components analysis, \emph{Technometrics}, \bold{47}, 64--79. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \note{ The ROBPCA algorithm is implemented on the bases of the Matlab implementation, available as part of \emph{LIBRA, a Matlab Library for Robust Analysis} to be found at www.wis.kuleuven.ac.be/stat/robust.html } \examples{ ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaHubert(hbk) pca ## Compare with the classical PCA prcomp(hbk) ## or PcaClassic(hbk) ## If you want to print the scores too, use print(pca, print.x=TRUE) ## Using the formula interface PcaHubert(~., data=hbk) ## To plot the results: plot(pca) # distance plot pca2 <- PcaHubert(hbk, k=2) plot(pca2) # PCA diagnostic plot (or outlier map) ## Use the standard plots available for prcomp and princomp screeplot(pca) biplot(pca) ## Restore the covraiance matrix py <- PcaHubert(hbk) cov.1 <- py@loadings \%*\% diag(py@eigenvalues) \%*\% t(py@loadings) cov.1 } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMrcd.Rd0000644000176200001440000000446013372561326015361 0ustar liggesusers\name{CovControlMrcd} \alias{CovControlMrcd} % \title{ Constructor function for objects of class "CovControlMrcd"} \description{ This function will create a control object \code{CovControlMrcd} containing the control parameters for \code{CovMrcd} } \usage{ CovControlMrcd(alpha = 0.5, h=NULL, maxcsteps=200, rho=NULL, target=c("identity", "equicorrelation"), maxcond=50, trace= FALSE) } \arguments{ \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{h}{the size of the subset (can be between ceiling(n/2) and n). Normally NULL and then it \code{h} will be calculated as \code{h=ceiling(alpha*n)}. If \code{h} is provided, \code{alpha} will be calculated as \code{alpha=h/n}.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{rho}{regularization parameter. Normally NULL and will be estimated from the data.} \item{target}{structure of the robust positive definite target matrix: a) "identity": target matrix is diagonal matrix with robustly estimated univariate scales on the diagonal or b) "equicorrelation": non-diagonal target matrix that incorporates an equicorrelation structure (see (17) in paper). Default is \code{target="identity"}} \item{maxcond}{maximum condition number allowed (see step 3.4 in algorithm 1). Default is \code{maxcond=50}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } %\details{} \value{ A \code{CovControlMrcd} object } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMrcd", alpha=0.75) ctrl2 <- CovControlMrcd(alpha=0.75) data(hbk) CovMrcd(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovControlSest-class.Rd0000644000176200001440000000562512763517421016521 0ustar liggesusers\name{CovControlSest-class} \Rdversion{1.1} \docType{class} \alias{CovControlSest-class} \alias{restimate,CovControlSest-method} \title{Class 'CovControlSest' - contains control parameters for "CovSest"} \description{ This class extends the \code{CovControl} class and contains the control parameters for CovSest } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlSest", ...)} or by calling the constructor-function \code{CovControlSest}. } \section{Slots}{ \describe{ \item{bdp}{a numeric value specifying the required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is \code{bdp=0.45}. } \item{arp}{a numeric value specifying the asympthotic rejection point (for the Rocke type S estimates), i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{arp=0.1}. } \item{eps}{a numeric value specifying the relative precision of the solution of the S-estimate (bisquare and Rocke type). Default is to \code{eps=1e-5}. } \item{maxiter}{maximum number of iterations allowed in the computation of the S-estimate (bisquare and Rocke type). Default is \code{maxiter=120}. } \item{nsamp}{the number of random subsets considered. Default is \code{nsamp = 500}.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{method}{Which algorithm to use: 'sfast'=FAST-S, 'surreal'=Ruppert's SURREAL algorithm, 'bisquare'=Bisquare S-estimation with HBDP start or 'rocke' for Rocke type S-estimates} \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlSest")}: the generic function \code{restimate} allowes the different methods for robust estimation to be used polymorphically - this function will call \code{CovSest} passing it the control object and will return the obtained \code{CovRobust} object} } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlSest", bdp=0.4) ctrl2 <- CovControlSest(bdp=0.4) data(hbk) CovSest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/SummaryPca-class.Rd0000644000176200001440000000231212763517421015641 0ustar liggesusers\name{SummaryPca-class} \docType{class} \alias{SummaryPca-class} \alias{show,SummaryPca-method} \title{Class "SummaryPca" - summary of "Pca" objects } \description{The "Pca" object plus some additional summary information} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("SummaryPca", ...)}, but most often by invoking 'summary' on a "Pca" object. They contain values meant for printing by 'show'. } \section{Slots}{ \describe{ \item{\code{pcaobj}:}{Object of class \code{"Pca"}} \item{\code{importance}:}{matrix with additional information: importance of components } } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "SummaryPca")}: display the object } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Pca-class}} } \examples{ showClass("SummaryPca") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/QdaCov.Rd0000644000176200001440000000352212763517421013636 0ustar liggesusers\name{QdaCov} \alias{QdaCov} \alias{QdaCov.formula} \alias{QdaCov.default} \title{ Robust Quadratic Discriminant Analysis } \description{ Performs robust quadratic discriminant analysis and returns the results as an object of class \code{QdaCov} (aka constructor). } \usage{ QdaCov(x, ...) \method{QdaCov}{default}(x, grouping, prior = proportions, tol = 1.0e-4, method = CovControlMcd(), ...) } \arguments{ \item{x}{a matrix or data frame containing the explanatory variables (training set). } \item{grouping}{grouping variable: a factor specifying the class for each observation.} \item{prior}{prior probabilities, default to the class proportions for the training set.} \item{tol}{tolerance} \item{method}{method} \item{\dots}{arguments passed to or from other methods} } \details{ details } \value{ Returns an S4 object of class \code{QdaCov} } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \section{Warning }{Still an experimental version!} \seealso{ \code{\link[rrcov]{CovMcd}} } \examples{ ## Example anorexia library(MASS) data(anorexia) ## start with the classical estimates qda <- QdaClassic(Treat~., data=anorexia) predict(qda)@classification ## try now the robust LDA with the default method (MCD with pooled whitin cov matrix) rqda <- QdaCov(Treat~., data= anorexia) predict(rqda)@classification ## try the other methods QdaCov(Treat~., data= anorexia, method="sde") QdaCov(Treat~., data= anorexia, method="M") QdaCov(Treat~., data= anorexia, method=CovControlOgk()) } \keyword{robust} \keyword{multivariate} rrcov/man/Lda-class.Rd0000644000176200001440000000563013577531211014263 0ustar liggesusers\name{Lda-class} \docType{class} \alias{Lda-class} \alias{predict,Lda-method} \alias{show,Lda-method} \alias{summary,Lda-method} \title{Class "Lda" - virtual base class for all classic and robust LDA classes } \description{ The class \code{Lda} serves as a base class for deriving all other classes representing the results of classical and robust Linear Discriminant Analisys methods } \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{the (matched) function call.} \item{\code{prior}:}{prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the common covariance matrix} \item{\code{ldf}:}{a matrix containing the linear discriminant functions} \item{\code{ldfconst}:}{a vector containing the constants of each linear discriminant function} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{covobj}:}{object of class \code{"Cov"} containing the estimate of the common covariance matrix of the centered data. It is not NULL only in case of method "B".} \item{\code{control}:}{object of class \code{"CovControl"} specifying which estimate and with what estimation options to use for the group means and common covariance (or \code{NULL} for classical linear discriminant analysis)} } } \section{Methods}{ \describe{ \item{predict}{\code{signature(object = "Lda")}: calculates prediction using the results in \code{object}. An optional data frame or matrix in which to look for variables with which to predict. If omitted, the training data set is used. If the original fit used a formula or a data frame or a matrix with column names, newdata must contain columns with the same names. Otherwise it must contain the same number of columns, to be used in the same order. } \item{show}{\code{signature(object = "Lda")}: prints the results } \item{summary}{\code{signature(object = "Lda")}: prints summary information } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{LdaClassic}}, \code{\link{LdaClassic-class}}, \code{\link{LdaRobust-class}} } \examples{ showClass("Lda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/un86.Rd0000644000176200001440000000236512763517421013265 0ustar liggesusers\name{un86} \alias{un86} \docType{data} \title{ United Nations Data - 1986} \description{ This data set consists of seven socioeconomic variables observed for 73 countries. } \usage{data(un86)} \format{ A data frame with 73 observations on the following 7 variables. \describe{ \item{\code{POP}}{Total population in milions} \item{\code{MOR}}{Number of infant deaths per thousand births} \item{\code{CAR}}{Number of motorized vehicles per hundred inhabitants} \item{\code{DR}}{Number of medical doctors per thousand inhabitants} \item{\code{GNP}}{Gross national product per inhabitant in thousands of US dollars} \item{\code{DEN}}{Density in inhabitants per square kilometer} \item{\code{TB}}{Trade balance, defined as total exports/(total exports + total imports)} } } \details{ The data set is from World Statistics in Brief, Number 10, a 1986 UN publication. It was used in Daigle et al. (1992) to illustrate a robust biplot method. } \source{ World Statistics in Brief, Number 10, a 1986 United Nations publication Daigle, G. and Rivest, L. (1992) A robust biplot, The canadian Journal of Statistics, 20, pp 241--255 } \examples{ data(un86) pairs(un86) } \keyword{datasets} rrcov/man/QdaRobust-class.Rd0000644000176200001440000000364712763517421015500 0ustar liggesusers\name{QdaRobust-class} \docType{class} \alias{QdaRobust-class} \title{Class "QdaRobust" is a virtual base class for all robust QDA classes } \description{ The class \code{QdaRobust} searves as a base class for deriving all other classes representing the results of robust Quadratic Discriminant Analysis methods} \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the group covariance matrices} \item{\code{covinv}:}{the inverse of the group covariance matrices} \item{\code{covdet}:}{the determinants of the group covariance matrices} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{control}:}{Object of class \code{"CovControl"} specifying which estimate to use for the group means and covariances } } } \section{Extends}{ Class \code{"\linkS4class{Qda}"}, directly. } \section{Methods}{ No methods defined with class "QdaRobust" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{Qda-class}}, \code{\link{QdaClassic-class}}, } \examples{ showClass("QdaRobust") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/lmom32.Rd0000644000176200001440000000415412763517421013574 0ustar liggesusers\name{lmom32} \alias{lmom32} \docType{data} \title{ Hosking and Wallis Data Set, Table 3.2} \description{ The data on annual maximum streamflow at 18 sites with smallest drainage area basin in southeastern USA contains the sample L-moments ratios (L-CV, L-skewness and L-kurtosis) as used by Hosking and Wallis (1997) to illustrate the discordancy measure in regional freqency analysis (RFA). } \usage{data(lmom32)} \format{ A data frame with 18 observations on the following 3 variables. \describe{ \item{\code{L-CV}}{L-coefficient of variation} \item{\code{L-skewness}}{L-coefficient of skewness} \item{\code{L-kurtosis}}{L-coefficient of kurtosis} } } \details{ The sample L-moment ratios (L-CV, L-skewness and L-kurtosis) of a site are regarded as a point in three dimensional space. } \source{ Hosking, J. R. M. and J. R. Wallis (1997), \emph{Regional Frequency Analysis: An Approach Based on L-moments.} Cambridge University Press, p.49, Table 3.2 } \references{ Neykov, N.M., Neytchev, P.N., Van Gelder, P.H.A.J.M. and Todorov V. (2007), Robust detection of discordant sites in regional frequency analysis, \emph{Water Resources Research}, 43, W06417, doi:10.1029/2006WR005322, \url{http://www.agu.org/pubs/crossref/2007/2006WR005322.shtml} } \examples{ data(lmom32) # plot a matrix of scatterplots pairs(lmom32, main="Hosking and Wallis Data Set, Table 3.3", pch=21, bg=c("red", "green3", "blue")) mcd<-CovMcd(lmom32) mcd plot(mcd, which="dist", class=TRUE) plot(mcd, which="dd", class=TRUE) ## identify the discordant sites using robust distances and compare ## to the classical ones mcd <- CovMcd(lmom32) rd <- sqrt(getDistance(mcd)) ccov <- CovClassic(lmom32) cd <- sqrt(getDistance(ccov)) r.out <- which(rd > sqrt(qchisq(0.975,3))) c.out <- which(cd > sqrt(qchisq(0.975,3))) cat("Robust: ", length(r.out), " outliers: ", r.out,"\n") cat("Classical: ", length(c.out), " outliers: ", c.out,"\n") } \keyword{datasets} rrcov/man/pca.scoreplot.Rd0000644000176200001440000000220112763517421015226 0ustar liggesusers\name{pca.scoreplot} \alias{pca.scoreplot} \title{ Score plot for Principal Components (objects of class 'Pca') } \description{ Produces a score plot from an object (derived from) \code{\link{Pca-class}}. } \usage{ pca.scoreplot(obj, i=1, j=2, main, id.n=0, \dots) } \arguments{ \item{obj}{an object of class (derived from) \code{"Pca"}.} \item{i}{First score coordinate, defaults to \code{i=1}.} \item{j}{Second score coordinate, defaults to \code{j=2}.} \item{main}{The main title of the plot.} \item{id.n}{ Number of observations to identify by a label. Defaults to \code{id.n=0}.} \item{\dots}{optional arguments to be passed to the internal graphical functions.} } %\details{} %\value{} %\references{} %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} \seealso{ \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaRobust-class}}. } \examples{ require(graphics) ## PCA of the Hawkins Bradu Kass's Artificial Data ## using all 4 variables data(hbk) pca <- PcaHubert(hbk) pca pca.scoreplot(pca) } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMMest.Rd0000644000176200001440000000345112763517421015520 0ustar liggesusers\name{CovControlMMest} \alias{CovControlMMest} \title{ Constructor function for objects of class "CovControlMMest" } \concept{High breakdown point} \description{ This function will create a control object \code{CovControlMMest} containing the control parameters for \code{CovMMest} } \usage{ CovControlMMest(bdp = 0.5, eff=0.95, maxiter = 50, sest=CovControlSest(), trace = FALSE, tolSolve = 1e-7) } \arguments{ \item{bdp}{ a numeric value specifying the required breakdown point. Allowed values are between 0.5 and 1 and the default is 0.5 } \item{eff}{a numeric value specifying the required efficiency for the MM estimates. Default is \code{eff=0.95}. } \item{sest}{an \code{CovControlSest} object containing control parameters for the initial S-estimate. } \item{maxiter}{maximum number of iterations allowed in the computation of the MM-estimate. Defaults to 150. } \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{tolSolve}{numeric tolerance to be used as a convergence tolerance for the MM-iteration. } } %\details{} \value{ A \code{CovControlSest} object. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMMest", bdp=0.25) ctrl2 <- CovControlMMest(bdp=0.25) data(hbk) CovMMest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/maryo.Rd0000644000176200001440000000364412763517421013615 0ustar liggesusers\name{maryo} \alias{maryo} \docType{data} \title{ Marona and Yohai Artificial Data} \description{ Simple artificial data set generated according the example by Marona and Yohai (1998). The data set consists of 20 bivariate normal observations generated with zero means, unit variances and correlation 0.8. The sample correlation is 0.81. Two outliers are introduced (i.e. these are 10\% of the data) in the following way: two points are modified by interchanging the largest (observation 19) and smallest (observation 9) value of the first coordinate. The sample correlation becomes 0.05. This example provides a good example of the fact that a multivariate outlier need not be an outlier in any of its coordinate variables. } \usage{data(maryo)} \format{ A data frame with 20 observations on 2 variables. To introduce the outliers x[9,1] with x[19,1] are interchanged. % \describe{ % \item{V1}{x[1]} % \item{V2}{x[2]} % } } %\details{} \source{ R. A. Marona and V. J. Yohai (1998) Robust estimation of multivariate location and scatter. In \emph{Encyclopedia of Statistical Sciences, Updated Volume 2} (Eds. S.Kotz, C.Read and D.Banks). Wiley, New York p. 590 } %\references{} \examples{ data(maryo) getCorr(CovClassic(maryo)) ## the sample correlation is 0.81 ## Modify 10%% of the data in the following way: ## modify two points (out of 20) by interchanging the ## largest and smallest value of the first coordinate imin <- which(maryo[,1]==min(maryo[,1])) # imin = 9 imax <- which(maryo[,1]==max(maryo[,1])) # imax = 19 maryo1 <- maryo maryo1[imin,1] <- maryo[imax,1] maryo1[imax,1] <- maryo[imin,1] ## The sample correlation becomes 0.05 plot(maryo1) getCorr(CovClassic(maryo1)) ## the sample correlation becomes 0.05 getCorr(CovMcd(maryo1)) ## the (reweighted) MCD correlation is 0.79 } \keyword{datasets} rrcov/man/estimate-methods.Rd0000644000176200001440000000242012763517421015731 0ustar liggesusers\name{restimate-methods} \docType{methods} \alias{restimate} \alias{restimate-methods} \alias{restimate,CovControlMest-method} \title{ Methods for Function estimate in Package 'rrcov'} \description{ Each concrete control class, like \code{CovControlMest}, \code{CovControlOgk}, etc., should implement an \code{restimate} method which will call the correponding (constructor)-function and will return the obtained S4 class, derived from \code{CovRobust}. } \usage{ \S4method{restimate}{CovControlMest}(obj, x, ...) } \arguments{ \item{obj}{an object of class \code{"CovControlEstimate"}} \item{x}{ Data frame or matrix containing the data }. \item{... }{ other parameters to be passed through to the estimation function. } } \section{Methods}{ \describe{ \item{obj = "CovControlMcd"}{ Compute the MCD estimates of multivariate location and scatter by calling\code{CovMcd} } \item{obj = "CovControlMest"}{ Compute the constrained M-estimates of multivariate location and scatter by calling\code{CovMest} } \item{obj = "CovControlOgk"}{ Compute the Ortogonalized Gnanadesikan-Kettenring (OGK) estimates of multivariate location and scatter by calling\code{CovOgk} } }} \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/PcaHubert-class.Rd0000644000176200001440000000436312763517421015445 0ustar liggesusers\name{PcaHubert-class} \Rdversion{1.1} \docType{class} \alias{PcaHubert-class} \alias{getQuan,PcaHubert-method} \title{Class "PcaHubert" - ROBust method for Principal Components Analysis } \description{ The ROBPCA algorithm was proposed by Hubert et al (2005) and stays for 'ROBust method for Principal Components Analysis'. It is resistant to outliers in the data. The robust loadings are computed using projection-pursuit techniques and the MCD method. Therefore ROBPCA can be applied to both low and high-dimensional data sets. In low dimensions, the MCD method is applied.} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaHubert", ...)} but the usual way of creating \code{PcaHubert} objects is a call to the function \code{PcaHubert} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{alpha}:}{Object of class \code{"numeric"} the fraction of outliers the algorithm should resist - this is the argument alpha} \item{\code{quan}:}{Object of class \code{"numeric"} The quantile \code{h} used throughout the algorithm } \item{\code{call}, \code{center}, \code{loadings}, \code{eigenvalues}, \code{scores}, \code{k}, \code{sd}, \code{od}, \code{cutoff.sd}, \code{cutoff.od}, \code{flag}, \code{n.obs}:}{ from the \code{"\linkS4class{Pca}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{PcaRobust}"}, directly. Class \code{"\linkS4class{Pca}"}, by class "PcaRobust", distance 2. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaHubert")}: Returns the quantile used throughout the algorithm } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaClassic-class}} } \examples{ showClass("PcaHubert") } \keyword{robust} \keyword{multivariate} rrcov/man/PcaCov-class.Rd0000644000176200001440000000353712763517421014745 0ustar liggesusers\name{PcaCov-class} \Rdversion{1.1} \docType{class} \alias{PcaCov-class} \alias{getQuan,PcaCov-method} \title{Class "PcaCov" - Robust PCA based on a robust covariance matrix } \description{ Robust PCA are obtained by replacing the classical covariance matrix by a robust covariance estimator. This can be one of the available in \code{rrcov} estimators, i.e. MCD, OGK, M, S or Stahel-Donoho estimator. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaCov", ...)} but the usual way of creating \code{PcaCov} objects is a call to the function \code{PcaCov} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{quan}:}{Object of class \code{"numeric"} The quantile \code{h} used throughout the algorithm } \item{\code{call}, \code{center}, \code{loadings}, \code{eigenvalues}, \code{scores}, \code{k}, \code{sd}, \code{od}, \code{cutoff.sd}, \code{cutoff.od}, \code{flag}, \code{n.obs}:}{ from the \code{"\linkS4class{Pca}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{PcaRobust}"}, directly. Class \code{"\linkS4class{Pca}"}, by class "PcaRobust", distance 2. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaCov")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaClassic-class}} } \examples{ showClass("PcaCov") } \keyword{robust} \keyword{multivariate} rrcov/man/bushmiss.Rd0000644000176200001440000000512212763517421014314 0ustar liggesusers\name{bushmiss} \alias{bushmiss} \docType{data} \title{ Campbell Bushfire Data with added missing data items} \description{ This data set is based on the bushfire data set which was used by Campbell (1984) to locate bushfire scars - see \code{\link[robustbase]{bushfire}} in package \code{robustbase}. The original dataset contains satelite measurements on five frequency bands, corresponding to each of 38 pixels. } \usage{data(bushmiss)} \format{ A data frame with 190 observations on 6 variables. The original data set consists of 38 observations in 5 variables. Based on it four new data sets are created in which some of the data items are replaced by missing values with a simple "missing completely at random " mechanism. For this purpose independent Bernoulli trials are realized for each data item with a probability of success 0.1, 0.2, 0.3, 0.4, where success means that the corresponding item is set to missing. The obtained five data sets, including the original one (each with probability of a data item to be missing equal to 0, 0.1, 0.2, 0.3 and 0.4 which is reflected in the new variable \code{MPROB}) are merged. (See also Beguin and Hulliger (2004).) %\describe{} } %\Note{} \source{ Maronna, R.A. and Yohai, V.J. (1995) The Behavoiur of the Stahel-Donoho Robust Multivariate Estimator. \emph{Journal of the American Statistical Association} \bold{90}, 330--341. Beguin, C. and Hulliger, B. (2004) Multivariate outlier detection in incomplete survey data: the epidemic algorithm and transformed rank correlations. \emph{Journal of the Royal Statistical Society: Series B (Statistical Methodology)} \bold{127}, 2, 275--294. } %\seealso{} \examples{ ## The following code will result in exactly the same output ## as the one obtained from the original data set data(bushmiss) bf <- bushmiss[bushmiss$MPROB==0,1:5] plot(bf) covMcd(bf) \dontrun{ ## This is the code with which the missing data were created: ## ## Creates a data set with missing values (for testing purposes) ## from a complete data set 'x'. The probability of ## each item being missing is 'pr' (Bernoulli trials). ## getmiss <- function(x, pr=0.1) { n <- nrow(x) p <- ncol(x) done <- FALSE iter <- 0 while(iter <= 50){ bt <- rbinom(n*p, 1, pr) btmat <- matrix(bt, nrow=n) btmiss <- ifelse(btmat==1, NA, 0) y <- x+btmiss if(length(which(rowSums(nanmap(y)) == p)) == 0) return (y) iter <- iter + 1 } y } } } \keyword{datasets} rrcov/man/isSingular.Rd0000644000176200001440000000152312763517421014600 0ustar liggesusers\name{isSingular-methods} \docType{methods} \alias{isSingular} \alias{isSingular-methods} \alias{isSingular,ANY-method} \alias{isSingular,Cov-method} \title{ Check if a covariance matrix (object of class 'Cov') is singular } \description{ Returns TRUE if the covariance matrix contained in a \code{\link{Cov-class}} object (or derived from) is singular. } \usage{ \S4method{isSingular}{Cov}(obj) } \arguments{ \item{obj}{an object of class (derived from) \code{"Cov"}.} } \section{Methods}{ \describe{ \item{isSingular}{\code{signature(x = Cov)}: Check if a covariance matrix (object of class \code{\link{Cov-class}}) is singular.} }} \seealso{ \code{\link{Cov-class}}, \code{\link{CovClassic}}, \code{\link{CovRobust-class}}. } \examples{ data(hbk) cc <- CovClassic(hbk) isSingular(cc) } \keyword{multivariate} rrcov/man/CovMve.Rd0000644000176200001440000001171713565050022013653 0ustar liggesusers\name{CovMve} \alias{CovMve} % \title{ Robust Location and Scatter Estimation via MVE } \description{ Computes a robust multivariate location and scatter estimate with a high breakdown point, using the \sQuote{MVE} (Minimum Volume Ellipsoid) estimator. } \usage{ CovMve(x, alpha = 1/2, nsamp = 500, seed = NULL, trace = FALSE, control) } \arguments{ \item{x}{a matrix or data frame. } \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{nsamp}{ number of subsets used for initial estimates or \code{"best"} or \code{"exact"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{control}{ a control object (S4) of class \code{\link{CovControlMve-class}} containing estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} } \details{ This function computes the minimum volume ellipsoid estimator of location and scatter and returns an S4 object of class \code{\link{CovMve-class}} containing the estimates. The approximate estimate is based on a subset of size \code{alpha*n} with an enclosing ellipsoid of smallest volume. The mean of the best found subset provides the raw estimate of the location, and the rescaled covariance matrix is the raw estimate of scatter. The rescaling of the raw covariance matrix is by \code{median(dist)/qchisq(0.5, p)} and this scale factor is returned in the slot \code{raw.cnp2}. Currently no finite sample corrction factor is applied. The Mahalanobis distances of all observations from the location estimate for the raw covariance matrix are calculated, and those points within the 97.5% point under Gaussian assumptions are declared to be good. The final (reweightd) estimates are the mean and rescaled covariance of the good points. The reweighted covariance matrix is rescaled by \code{1/pgamma(qchisq(alpha, p)/2, p/2 + 1)/alpha} (see Croux and Haesbroeck, 1999) and this scale factor is returned in the slot \code{cnp2}. The search for the approximate solution is made over ellipsoids determined by the covariance matrix of \code{p+1} of the data points and applying a simple but effective improvement of the subsampling procedure as described in Maronna et al. (2006), p. 198. Although there exists no formal proof of this improvement (as for MCD and LTS), simulations show that it can be recommended as an approximation of the MVE. } \note{ Main reason for implementing the MVE estimate was that it is the recommended initial estimate for S estimation (see Maronna et al. (2006), p. 199) and will be used by default in \code{\link{CovMest}} (after removing the correction factors from the covariance matrix and rescaling to determinant 1). } \value{ An S4 object of class \code{\link{CovMve-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ P. J. Rousseeuw and A. M. Leroy (1987) \emph{Robust Regression and Outlier Detection.} Wiley. C. Croux and G. Haesbroeck (1999). Influence function and efficiency of the minimum covariance determinant scatter matrix estimator. \emph{Journal of Multivariate Analysis}, \bold{71}, 161--190. R. A. Maronna, D. Martin and V. Yohai (2006). \emph{Robust Statistics: Theory and Methods}. Wiley, New York. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} and Matias Salibian-Barrera \email{matias@stat.ubc.ca} } \seealso{ \code{\link[MASS]{cov.rob}} from package \pkg{MASS} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovMve(hbk.x) ## the following three statements are equivalent c1 <- CovMve(hbk.x, alpha = 0.75) c2 <- CovMve(hbk.x, control = CovControlMve(alpha = 0.75)) ## direct specification overrides control one: c3 <- CovMve(hbk.x, alpha = 0.75, control = CovControlMve(alpha=0.95)) c1 } \keyword{robust} \keyword{multivariate} rrcov/man/Linda.Rd0000644000176200001440000001035113577531732013513 0ustar liggesusers\name{Linda} \alias{Linda} \alias{Linda.formula} \alias{Linda.default} \title{ Robust Linear Discriminant Analysis } \description{ Robust linear discriminant analysis based on MCD and returns the results as an object of class \code{Linda} (aka constructor). } \usage{ Linda(x, ...) \method{Linda}{default}(x, grouping, prior = proportions, tol = 1.0e-4, method = c("mcd", "mcdA", "mcdB", "mcdC", "fsa", "mrcd", "ogk"), alpha=0.5, l1med=FALSE, cov.control, trace=FALSE, ...) } \arguments{ \item{x}{a matrix or data frame containing the explanatory variables (training set). } \item{grouping}{grouping variable: a factor specifying the class for each observation.} \item{prior}{prior probabilities, default to the class proportions for the training set.} \item{tol}{tolerance} \item{method}{method} \item{alpha}{this parameter measures the fraction of outliers the algorithm should resist. In MCD alpha controls the size of the subsets over which the determinant is minimized, i.e. alpha*n observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{l1med}{whether to use L1 median (space median) instead of MCD to compute the group means locations in order to center the data in methods \code{mcdB} and \code{mcdC}. useful in case of groups with small size. Default is \code{l1med = FALSE}.} \item{cov.control}{specifies which covariance estimator to use by providing a \code{\link{CovControl-class}} object. The default is \code{\link{CovControlMcd-class}} which will indirectly call \code{\link{CovMcd}}. If \code{cov.control=NULL} is specified, the classical estimates will be used by calling \code{\link{CovClassic}}}. \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{\dots}{arguments passed to or from other methods} } \details{ details } \value{ Returns an S4 object of class \code{Linda} } \references{ Hawkins, D.M. and McLachlan, G.J. (1997) High-Breakdown Linear Discriminant Analysis, \emph{Journal of the American Statistical Association}, \bold{92}, 136--143. Todorov V. (2007) Robust selection of variables in linear discriminant analysis, \emph{Statistical Methods and Applications}, \bold{15}, 395--407, doi:10.1007/s10260-006-0032-6. Todorov, V. and Pires, A.M. (2007) Comparative Performance of Several Robust Linear Discriminant Analysis Methods. \emph{REVSTAT Statistical Journal}, \bold{5}, p 63--83. URL \url{http://www.ine.pt/revstat/pdf/rs070104.pdf}. Todorov V and Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link[rrcov]{CovMcd}}, \code{\link[rrcov]{CovMrcd}} } \examples{ ## Example anorexia library(MASS) data(anorexia) ## start with the classical estimates lda <- LdaClassic(Treat~., data=anorexia) predict(lda)@classification ## try now the robust LDA with the default method (MCD with pooled whitin cov matrix) rlda <- Linda(Treat~., data= anorexia) predict(rlda)@classification ## try the other methods Linda(Treat~., data= anorexia, method="mcdA") Linda(Treat~., data= anorexia, method="mcdB") Linda(Treat~., data= anorexia, method="mcdC") ## try the Hawkins&McLachlan method ## use the default method grp <- anorexia[,1] grp <- as.factor(grp) x <- anorexia[,2:3] Linda(x, grp, method="fsa") ## Do DA with Linda and method mcdB or mcdC, when some classes ## have very few observations. Use L1 median instead of MCD ## to compute the group means (l1med=TRUE). data(fish) # remove observation #14 containing missing value fish <- fish[-14,] # The height and width are calculated as percentages # of the third length variable fish[,5] <- fish[,5]*fish[,4]/100 fish[,6] <- fish[,6]*fish[,4]/100 table(fish$Species) Linda(Species~., data=fish, l1med=TRUE) Linda(Species~., data=fish, method="mcdC", l1med=TRUE) } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMcd-class.Rd0000644000176200001440000000643112763517421016302 0ustar liggesusers\name{CovControlMcd-class} \Rdversion{1.1} \docType{class} \alias{CovControlMcd-class} \alias{restimate,CovControlMcd-method} \title{Class 'CovControlMcd' - contains control parameters for CovMcd } \description{ This class extends the \code{CovControl} class and contains the control parameters for \code{"CovMcd"} } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlMcd", ...)} or by calling the constructor-function \code{CovControlMcd}. } \section{Slots}{ \describe{ \item{\code{alpha}:}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{nsamp}{ number of subsets used for initial estimates or \code{"best"}, \code{"exact"} or \code{"deterministic"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time. For \code{"deterministic"}, the \emph{deterministic} MCD is computed; as proposed by Hubert et al. (2012) it starts from the \eqn{h} most central observations of \emph{six} (deterministic) estimators. } \item{scalefn}{\code{\link{function}} to compute a robust scale estimate or character string specifying a rule determining such a function.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{\code{seed}:}{starting value for random generator. Default is \code{seed = NULL}} \item{\code{use.correction}:}{ whether to use finite sample correction factors. Default is \code{use.correction=TRUE}. } \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlMcd")}: the generic function \code{restimate} allows the different methods for robust estimation to be used polymorphically - this function will call \code{CovMcd} passing it the control object and will return the obtained \code{CovRobust} object} }} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMcd", alpha=0.75) ctrl2 <- CovControlMcd(alpha=0.75) data(hbk) CovMcd(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovSest.Rd0000644000176200001440000001716012763517421014052 0ustar liggesusers\encoding{latin1} \name{CovSest} \alias{CovSest} \title{ S Estimates of Multivariate Location and Scatter } \concept{High breakdown point} \description{ Computes S-Estimates of multivariate location and scatter based on Tukey's biweight function using a fast algorithm similar to the one proposed by Salibian-Barrera and Yohai (2006) for the case of regression. Alternativley, the Ruppert's SURREAL algorithm, bisquare or Rocke type estimation can be used. } \usage{ CovSest(x, bdp = 0.5, arp = 0.1, eps = 1e-5, maxiter = 120, nsamp = 500, seed = NULL, trace = FALSE, tolSolve = 1e-14, scalefn, maxisteps=200, initHsets = NULL, save.hsets = FALSE, method = c("sfast", "surreal", "bisquare", "rocke", "suser", "sdet"), control, t0, S0, initcontrol) } \arguments{ \item{x}{ a matrix or data frame. } \item{bdp}{a numeric value specifying the required breakdown point. Allowed values are between \code{(n - p)/(2 * n)} and 1 and the default is \code{bdp=0.5}. } \item{arp}{a numeric value specifying the asympthotic rejection point (for the Rocke type S estimates), i.e. the fraction of points receiving zero weight (see Rocke (1996)). Default is \code{arp=0.1}. } \item{eps}{a numeric value specifying the relative precision of the solution of the S-estimate (bisquare and Rocke type). Default is to \code{eps=1e-5}. } \item{maxiter}{maximum number of iterations allowed in the computation of the S-estimate (bisquare and Rocke type). Default is \code{maxiter=120}. } \item{nsamp}{the number of random subsets considered. The default is different for the different methods: (i) for \code{sfast} it is \code{nsamp = 20}, (ii) for \code{surreal} it is \code{nsamp = 600*p} and (iii) for \code{bisquare} or \code{rocke} it is \code{nsamp = 500}.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}.} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{tolSolve}{numeric tolerance to be used for inversion (\code{\link{solve}}) of the covariance matrix in \code{\link{mahalanobis}}.} \item{scalefn}{\code{\link{function}} to compute a robust scale estimate or character string specifying a rule determining such a function. Used for computing the "deterministic" S-estimates (\code{method="sdet"}). If \code{scalefn} is missing or is \code{NULL}, the function is selected depending on the data set size, following the recomendation of Hubert et al. (2012) - \code{\link[robustbase]{Qn}} if \code{n <= 1000} and \code{\link[robustbase]{scaleTau2}} otherwise.} \item{maxisteps}{maximal number of concentration steps in the deterministic S-estimates; should not be reached.} \item{initHsets}{NULL or a \eqn{K x n} integer matrix of initial subsets of observations of size (specified by the indices in \code{1:n}).} \item{save.hsets}{(for deterministic S-estimates) logical indicating if the initial subsets should be returned as \code{initHsets}.} \item{method}{ Which algorithm to use: 'sfast'=C implementation of FAST-S, 'surreal'=SURREAL, 'bisquare', 'rocke'. The method 'suser' currently calls the R implementation of FAST-S but in the future will allow the user to supply own \code{rho} function. The method 'sdet' invokes the deterministic algorihm of Hubert et al. (2012).} \item{control}{ a control object (S4) of class \code{\link{CovControlSest-class}} containing estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} \item{t0}{ optional initial HBDP estimate for the center } \item{S0}{ optional initial HBDP estimate for the covariance matrix } \item{initcontrol}{ optional control object to be used for computing the initial HBDP estimates } } \details{ Computes multivariate S-estimator of location and scatter. The computation will be performed by one of the following algorithms: \describe{ \item{FAST-S}{An algorithm similar to the one proposed by Salibian-Barrera and Yohai (2006) for the case of regression} \item{SURREAL}{Ruppert's SURREAL algorithm when \code{method} is set to 'surreal'} \item{BISQUARE}{Bisquare S-Estimate with \code{method} set to 'bisquare'} \item{ROCKE}{Rocke type S-Estimate with \code{method} set to 'rocke'} } Except for the last algorithm, \emph{ROCKE}, all other use Tukey biweight loss function. The tuning parameters used in the loss function (as determined by bdp) are returned in the slots \code{cc} and \code{kp} of the result object. They can be computed by the internal function \code{.csolve.bw.S(bdp, p)}. } \value{ An S4 object of class \code{\link{CovSest-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ M. Hubert, P. Rousseeuw and T. Verdonck (2012) A deterministic algorithm for robust location and scatter. \emph{Journal of Computational and Graphical Statistics} \bold{21}(3), 618--637. M. Hubert, P. Rousseeuw, D. Vanpaemel and T. Verdonck (2015) The DetS and DetMM estimators for multivariate location and scatter. \emph{Computational Statistics and Data Analysis} \bold{81}, 64--75. H.P. Lopuha (1989) On the Relation between S-estimators and M-estimators of Multivariate Location and Covariance. \emph{Annals of Statistics} \bold{17} 1662--1683. D. Ruppert (1992) Computing S Estimators for Regression and Multivariate Location/Dispersion. \emph{Journal of Computational and Graphical Statistics} \bold{1} 253--270. M. Salibian-Barrera and V. Yohai (2006) A fast algorithm for S-regression estimates, \emph{Journal of Computational and Graphical Statistics}, \bold{15}, 414--427. R. A. Maronna, D. Martin and V. Yohai (2006). \emph{Robust Statistics: Theory and Methods}. Wiley, New York. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at}, Matias Salibian-Barrera \email{matias@stat.ubc.ca} and Victor Yohai \email{vyohai@dm.uba.ar}. See also the code from Kristel Joossens, K.U. Leuven, Belgium and Ella Roelant, Ghent University, Belgium. } %\note{} %\seealso{} \examples{ library(rrcov) data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cc <- CovSest(hbk.x) cc ## summry and different types of plots summary(cc) plot(cc) plot(cc, which="dd") plot(cc, which="pairs") plot(cc, which="xydist") ## the following four statements are equivalent c0 <- CovSest(hbk.x) c1 <- CovSest(hbk.x, bdp = 0.25) c2 <- CovSest(hbk.x, control = CovControlSest(bdp = 0.25)) c3 <- CovSest(hbk.x, control = new("CovControlSest", bdp = 0.25)) ## direct specification overrides control one: c4 <- CovSest(hbk.x, bdp = 0.40, control = CovControlSest(bdp = 0.25)) c1 summary(c1) plot(c1) ## Use the SURREAL algorithm of Ruppert cr <- CovSest(hbk.x, method="surreal") cr ## Use Bisquare estimation cr <- CovSest(hbk.x, method="bisquare") cr ## Use Rocke type estimation cr <- CovSest(hbk.x, method="rocke") cr ## Use Deterministic estimation cr <- CovSest(hbk.x, method="sdet") cr } \keyword{robust} \keyword{multivariate} rrcov/man/LdaClassic-class.Rd0000644000176200001440000000356312763517421015573 0ustar liggesusers\name{LdaClassic-class} \docType{class} \alias{LdaClassic-class} \title{Class "LdaClassic" - Linear Discriminant Analysis } \description{ Contains the results of a classical Linear Discriminant Analysis } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("LdaClassic", ...)} but the usual way of creating \code{LdaClassic} objects is a call to the function \code{LdaClassic} which serves as a constructor. }\section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the common covariance matrix} \item{\code{ldf}:}{a matrix containing the linear discriminant functions} \item{\code{ldfconst}:}{a vector containing the constants of each linear discriminant function} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} } } \section{Extends}{ Class \code{"\linkS4class{Lda}"}, directly. } \section{Methods}{ No methods defined with class "LdaClassic" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{LdaRobust-class}}, \code{\link{Lda-class}}, \code{\link{LdaClassic}} } \examples{ showClass("LdaClassic") } \keyword{robust} \keyword{multivariate} rrcov/man/CovSest-class.Rd0000644000176200001440000000426112763517421015153 0ustar liggesusers\name{CovSest-class} \Rdversion{1.1} \docType{class} \alias{CovSest-class} \title{ S Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates S Estimates of multivariate location and scatter computed by the \sQuote{Fast S} or \sQuote{SURREAL} algorithm.} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovSest", ...)}, but the usual way of creating \code{CovSest} objects is a call to the function \code{CovSest} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{iBest}, \code{nsteps}, \code{initHsets}:}{parameters for deterministic S-estimator (the best initial subset, number of concentration steps to convergence for each of the initial subsets, and the computed initial subsets, respectively). } \item{\code{cc}, \code{kp}}{tuning parameters used in Tukey biweight loss function, as determined by bdp. Can be computed by the internal function \code{.csolve.bw.S(bdp, p)}. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovSest" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovSest}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovSest") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/PcaLocantore-class.Rd0000644000176200001440000000413012763517421016132 0ustar liggesusers\name{PcaLocantore-class} \Rdversion{1.1} \docType{class} \alias{PcaLocantore-class} \alias{getQuan,PcaLocantore-method} \title{Class "PcaLocantore" Spherical Principal Components } \description{ The Spherical Principal Components procedure was proposed by Locantore et al., (1999) as a functional data analysis method. The idea is to perform classical PCA on the the data, \ projected onto a unit sphere. The estimates of the eigenvectors are consistent and the procedure is extremly fast. The simulations of Maronna (2005) show that this method has very good performance. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PcaLocantore", ...)} but the usual way of creating \code{PcaLocantore} objects is a call to the function \code{PcaLocantore} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{delta}:}{Accuracy parameter} \item{\code{quan}:}{Object of class \code{"numeric"} The quantile h used throughout the algorithm } \item{\code{call}, \code{center}, \code{scale}, \code{loadings}, \code{eigenvalues}, \code{scores}, \code{k}, \code{sd}, \code{od}, \code{cutoff.sd}, \code{cutoff.od}, \code{flag}, \code{n.obs}:}{ from the \code{"\linkS4class{Pca}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{PcaRobust}"}, directly. Class \code{"\linkS4class{Pca}"}, by class "PcaRobust", distance 2. } \section{Methods}{ \describe{ \item{getQuan}{\code{signature(obj = "PcaLocantore")}: ... } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{PcaRobust-class}}, \code{\link{Pca-class}}, \code{\link{PcaClassic}}, \code{\link{PcaClassic-class}} } \examples{ showClass("PcaLocantore") } \keyword{robust} \keyword{multivariate} rrcov/man/CovControlMcd.Rd0000644000176200001440000000507312763517421015200 0ustar liggesusers\name{CovControlMcd} \alias{CovControlMcd} % \title{ Constructor function for objects of class "CovControlMcd"} \description{ This function will create a control object \code{CovControlMcd} containing the control parameters for \code{CovMcd} } \usage{ CovControlMcd(alpha = 0.5, nsamp = 500, scalefn=NULL, maxcsteps=200, seed = NULL, trace= FALSE, use.correction = TRUE) } \arguments{ \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{nsamp}{ number of subsets used for initial estimates or \code{"best"}, \code{"exact"} or \code{"deterministic"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time. For \code{"deterministic"}, the \emph{deterministic} MCD is computed; as proposed by Hubert et al. (2012) it starts from the \eqn{h} most central observations of \emph{six} (deterministic) estimators. } \item{scalefn}{\code{\link{function}} to compute a robust scale estimate or character string specifying a rule determining such a function, see \code{\link{rrcov.control}}.} \item{maxcsteps}{maximal number of concentration steps in the deterministic MCD; should not be reached.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} \item{use.correction}{ whether to use finite sample correction factors. Default is \code{use.correction=TRUE}} } %\details{} \value{ A \code{CovControlMcd} object } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMcd", alpha=0.75) ctrl2 <- CovControlMcd(alpha=0.75) data(hbk) CovMcd(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/QdaClassic-class.Rd0000644000176200001440000000422712763517421015576 0ustar liggesusers\name{QdaClassic-class} \Rdversion{1.1} \docType{class} \alias{QdaClassic-class} \title{Class "QdaClassic" - Quadratic Discriminant Analysis } \description{ Contains the results of classical Quadratic Discriminant Analysis } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("QdaClassic", ...)} but the usual way of creating \code{QdaClassic} objects is a call to the function \code{QdaClassic} which serves as a constructor. }\section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the group covariance matrices} \item{\code{covinv}:}{the inverse of the group covariance matrices} \item{\code{covdet}:}{the determinants of the group covariance matrices} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{control}:}{Object of class \code{"CovControl"} inherited from class \code{Qda} specifying which estimate and with what estimation options to use for the group means and covariances. It is always \code{NULL} for classical discriminant analysis.} } } \section{Extends}{ Class \code{"\linkS4class{Qda}"}, directly. } \section{Methods}{ No methods defined with class "QdaClassic" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{QdaRobust-class}}, \code{\link{Qda-class}}, \code{\link{QdaClassic}} } \examples{ showClass("QdaClassic") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/hemophilia.Rd0000644000176200001440000000462512763517421014605 0ustar liggesusers\name{hemophilia} \alias{hemophilia} \docType{data} \title{ Hemophilia Data } \description{ The hemophilia data set contains two measured variables on 75 women, belonging to two groups: n1=30 of them are non-carriers (normal group) and n2=45 are known hemophilia A carriers (obligatory carriers). } \usage{data(hemophilia)} \format{ A data frame with 75 observations on the following 3 variables. \describe{ \item{\code{AHFactivity}}{AHF activity} \item{\code{AHFantigen}}{AHF antigen} \item{\code{gr}}{group - normal or obligatory carrier} } } \details{ Originally analized in the context of discriminant analysis by Habemma and Hermans (1974). The objective is to find a procedure for detecting potential hemophilia A carriers on the basis of two measured variables: X1=log10(AHV activity) and X2=log10(AHV-like antigen). The first group of n1=30 women consists of known non-carriers (normal group) and the second group of n2=45 women is selected from known hemophilia A carriers (obligatory carriers). This data set was also analyzed by Johnson and Wichern (1998) as well as, in the context of robust Linear Discriminant Analysis by Hawkins and McLachlan (1997) and Hubert and Van Driessen (2004). } \source{ Habemma, J.D.F, Hermans, J. and van den Broek, K. (1974) Stepwise Discriminant Analysis Program Using Density Estimation in \emph{Proceedings in Computational statistics, COMPSTAT`1974} (Physica Verlag, Heidelberg, 1974, pp 101--110). } \references{ Johnson, R.A. and Wichern, D. W. \emph{Applied Multivariate Statistical Analysis} (Prentice Hall, International Editions, 2002, fifth edition) Hawkins, D. M. and McLachlan, G.J. (1997) High-Breakdown Linear Discriminant Analysis \emph{J. Amer. Statist. Assoc.} \bold{92} 136--143. Hubert, M., Van Driessen, K. (2004) Fast and robust discriminant analysis, \emph{Computational Statistics and Data Analysis}, \bold{45} 301--320. } \examples{ data(hemophilia) plot(AHFantigen~AHFactivity, data=hemophilia, col=as.numeric(as.factor(gr))+1) ## ## Compute robust location and covariance matrix and ## plot the tolerance ellipses (mcd <- CovMcd(hemophilia[,1:2])) col <- ifelse(hemophilia$gr == "carrier", 2, 3) ## define clours for the groups plot(mcd, which="tolEllipsePlot", class=TRUE, col=col) %x <- hemophilia[,-3] %gr <- hemophilia[,3] %Linda(x, gr, method="ogk") } \keyword{datasets} rrcov/man/pottery.Rd0000644000176200001440000000670513607357105014174 0ustar liggesusers\name{pottery} \alias{pottery} \alias{pottery.test} \docType{data} \title{Archaic Greek Pottery data} \description{ The Archaic Greek Pottery data set contains data on fragments of Greek pottery which were classified into two groups according to their origin: Attic or Eritrean. Six chemical variables, metallic oxide constituents, were measured: Si, Al, Fe, Ca and Ti. The main data set consists of 13 Attic objects and 14 Eritrean ones. There is a separate data set with 13 observations which can be used as a test data set. It consists of 4 observations classified as "probably Attic" and the remaining 9 as "probably Eritrean". } \usage{ data(pottery) } \format{ Two data frames with 27 an 13 observations on the following 7 variables. \describe{ \item{\code{SI}}{Si content} \item{\code{AL}}{Al content} \item{\code{FE}}{Fe content} \item{\code{MG}}{Mg content} \item{\code{CA}}{Ca content} \item{\code{TI}}{Ti content} \item{\code{origin}}{Origin - factor with two levels: \code{Attic} and \code{Eritrean}} } } \details{ The Archaic Greek Pottery data set was first published by Stern and Descoeudres (1977) and later reproduced in Cooper and Weeks (1983) for illustration of linear discriminant analisys. The data set was used by Pires and Branco (2010) for illustration of their projection pursuit approach to linear discriminant analysis. } \source{ STERN, W. B. and DESCOEUDRES, J.-P. (1977) X-RAY FLUORESCENCE ANALYSIS OF ARCHAIC GREEK POTTERY \emph{Archaeometry}, Blackwell Publishing Ltd, \bold{19}, 73--86. } \references{ Cooper, R.A. and Weekes, A.J.. 1983 \emph{Data, Models, and Statistical Analysis}, (Lanham, MD: Rowman & Littlefield). Pires, A. M. and A. Branco, J. (2010) Projection-pursuit approach to robust linear discriminant analysis \emph{Journal Multivariate Analysis}, Academic Press, Inc., \bold{101}, 2464--2485. } \examples{ data(pottery) x <- pottery[,c("MG", "CA")] grp <- pottery$origin ## ## Compute robust location and covariance matrix and ## plot the tolerance ellipses library(rrcov) (mcd <- CovMcd(x)) col <- c(3,4) gcol <- ifelse(grp == "Attic", col[1], col[2]) gpch <- ifelse(grp == "Attic", 16, 1) plot(mcd, which="tolEllipsePlot", class=TRUE, col=gcol, pch=gpch) ## ## Perform classical LDA and plot the data, 0.975 tolerance ellipses ## and LDA separation line ## x <- pottery[,c("MG", "CA")] grp <- pottery$origin lda <- LdaClassic(x, grp) lda e1 <- getEllipse(loc=lda@center[1,], cov=lda@cov) e2 <- getEllipse(loc=lda@center[2,], cov=lda@cov) plot(CA~MG, data=pottery, col=gcol, pch=gpch, xlim=c(min(MG,e1[,1], e2[,1]), max(MG,e1[,1], e2[,1])), ylim=c(min(CA,e1[,2], e2[,2]), max(CA,e1[,2], e2[,2]))) ab <- lda@ldf[1,] - lda@ldf[2,] cc <- lda@ldfconst[1] - lda@ldfconst[2] abline(a=-cc/ab[2], b=-ab[1]/ab[2], col=2, lwd=2) lines(e1, type="l", col=col[1]) lines(e2, type="l", col=col[2]) ## ## Perform robust (MCD) LDA and plot data, classical and ## robust separation line ## plot(CA~MG, data=pottery, col=gcol, pch=gpch) lda <- LdaClassic(x, grp) ab <- lda@ldf[1,] - lda@ldf[2,] cc <- lda@ldfconst[1] - lda@ldfconst[2] abline(a=-cc/ab[2], b=-ab[1]/ab[2], col=2, lwd=2) abline(a=-cc/ab[2], b=-ab[1]/ab[2], col=4, lwd=2) rlda <- Linda(x, grp, method="mcd") rlda ab <- rlda@ldf[1,] - rlda@ldf[2,] cc <- rlda@ldfconst[1] - rlda@ldfconst[2] abline(a=-cc/ab[2], b=-ab[1]/ab[2], col=2, lwd=2) } \keyword{datasets} rrcov/man/CovMve-class.Rd0000644000176200001440000000652112763517421014765 0ustar liggesusers\name{CovMve-class} \Rdversion{1.1} \docType{class} \alias{CovMve-class} \title{ MVE Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates MVE Estimates of multivariate location and scatter computed by the \sQuote{Fast MVE} algorithm. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovMve", ...)}, but the usual way of creating \code{CovMve} objects is a call to the function \code{CovMve} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{alpha}:}{Object of class \code{"numeric"} - the size of the subsets over which the volume of the ellipsoid is minimized (the default is (n+p+1)/2) } \item{\code{quan}:}{Object of class \code{"numeric"} - the number of observations on which the MVE is based. If \code{quan} equals \code{n.obs}, the MVE is the classical covariance matrix. } \item{\code{best}:}{Object of class \code{"Uvector"} - the best subset found and used for computing the raw estimates. The size of \code{best} is equal to \code{quan} } \item{\code{raw.cov}:}{Object of class \code{"matrix"} the raw (not reweighted) estimate of location } \item{\code{raw.center}:}{Object of class \code{"vector"} - the raw (not reweighted) estimate of scatter} \item{\code{raw.mah}:}{Object of class \code{"Uvector"} - mahalanobis distances of the observations based on the raw estimate of the location and scatter } \item{\code{raw.wt}:}{Object of class \code{"Uvector"} - weights of the observations based on the raw estimate of the location and scatter } \item{\code{raw.cnp2}:}{Object of class \code{"numeric"} - a vector of length two containing the consistency correction factor and the finite sample correction factor of the raw estimate of the covariance matrix } \item{\code{cnp2}:}{Object of class \code{"numeric"} - a vector of length two containing the consistency correction factor and the finite sample correction factor of the final estimate of the covariance matrix. } \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class "CovMve" in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMve}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovMve") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovOgk.Rd0000644000176200001440000001165512763517421013657 0ustar liggesusers\name{CovOgk} \alias{CovOgk} % \title{ Robust Location and Scatter Estimation - Ortogonalized Gnanadesikan-Kettenring (OGK)} \description{ Computes a robust multivariate location and scatter estimate with a high breakdown point, using the pairwise algorithm proposed by Marona and Zamar (2002) which in turn is based on the pairwise robust estimator proposed by Gnanadesikan-Kettenring (1972). } \usage{ CovOgk(x, niter = 2, beta = 0.9, control) } \arguments{ \item{x}{a matrix or data frame. } \item{niter}{ number of iterations, usually 1 or 2 since iterations beyond the second do not lead to improvement. } \item{beta}{ coverage parameter for the final reweighted estimate } \item{control}{ a control object (S4) of class \code{\link{CovControlOgk-class}} containing estimation options - same as these provided in the function specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object. The control object contains also functions for computing the robust univariate location and dispersion estimate \code{mrob} and for computing the robust estimate of the covariance between two random variables \code{vrob}. } } \details{ The method proposed by Marona and Zamar (2002) allowes to obtain positive-definite and almost affine equivariant robust scatter matrices starting from any pairwise robust scatter matrix. The default robust estimate of covariance between two random vectors used is the one proposed by Gnanadesikan and Kettenring (1972) but the user can choose any other method by redefining the function in slot \code{vrob} of the control object \code{CovControlOgk}. Similarly, the function for computing the robust univariate location and dispersion used is the \code{tau scale} defined in Yohai and Zamar (1998) but it can be redefined in the control object. The estimates obtained by the OGK method, similarly as in \code{CovMcd} are returned as 'raw' estimates. To improve the estimates a reweighting step is performed using the coverage parameter \code{beta} and these reweighted estimates are returned as 'final' estimates. } \note{ If the user does not specify a scale and covariance function to be used in the computations or specifies one by using the arguments \code{smrob} and \code{svrob} (i.e. the names of the functions as strings), a native code written in C will be called which is by far faster than the R version. If the arguments \code{mrob} and \code{vrob} are not NULL, the specified functions will be used via the pure R implementation of the algorithm. This could be quite slow. See \code{\link{CovControlOgk}} for details. } \value{ An S4 object of class \code{\link{CovOgk-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ Maronna, R.A. and Zamar, R.H. (2002) Robust estimates of location and dispersion of high-dimensional datasets; \emph{Technometrics} \bold{44}(4), 307--317. Yohai, R.A. and Zamar, R.H. (1998) High breakdown point estimates of regression by means of the minimization of efficient scale \emph{JASA} \bold{86}, 403--413. Gnanadesikan, R. and John R. Kettenring (1972) Robust estimates, residuals, and outlier detection with multiresponse data. \emph{Biometrics} \bold{28}, 81--124. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} and Kjell Konis \email{kjell.konis@epfl.ch} } %\note{} \seealso{ \code{\link{CovMcd}}, \code{\link{CovMest}} } \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovOgk(hbk.x) ## the following three statements are equivalent c1 <- CovOgk(hbk.x, niter=1) c2 <- CovOgk(hbk.x, control = CovControlOgk(niter=1)) ## direct specification overrides control one: c3 <- CovOgk(hbk.x, beta=0.95, control = CovControlOgk(beta=0.99)) c1 x<-matrix(c(1,2,3,7,1,2,3,7), ncol=2) ## CovOgk(x) - this would fail because the two columns of x are exactly collinear. ## In order to fix it, redefine the default 'vrob' function for example ## in the following way and pass it as a parameter in the control ## object. cc <- CovOgk(x, control=new("CovControlOgk", vrob=function(x1, x2, ...) { r <- .vrobGK(x1, x2, ...) if(is.na(r)) r <- 0 r }) ) cc } \keyword{robust} \keyword{multivariate} rrcov/man/QdaCov-class.Rd0000644000176200001440000000431412763517421014741 0ustar liggesusers\name{QdaCov-class} \docType{class} \alias{QdaCov-class} \title{Class "QdaCov" - Robust methods for Quadratic Discriminant Analysis } \description{ Robust quadratic discriminant analysis is performed by replacing the classical group means and withing group covariance matrices by their robust equivalents. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("QdaCov", ...)} but the usual way of creating \code{QdaCov} objects is a call to the function \code{QdaCov} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the group covariance matrices} \item{\code{covinv}:}{the inverse of the group covariance matrices} \item{\code{covdet}:}{the determinants of the group covariance matrices} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{control}:}{Object of class \code{"CovControl"} specifying which estimate to use for the group means and covariances } } } \section{Extends}{ Class \code{"\linkS4class{QdaRobust}"}, directly. Class \code{"\linkS4class{Qda}"}, by class "QdaRobust", distance 2. } \section{Methods}{No methods defined with class "QdaCov" in the signature.} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{QdaRobust-class}}, \code{\link{Qda-class}}, \code{\link{QdaClassic}}, \code{\link{QdaClassic-class}} } \examples{ showClass("QdaCov") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/LdaClassic.Rd0000644000176200001440000000327612763517421014471 0ustar liggesusers\name{LdaClassic} \alias{LdaClassic} \alias{LdaClassic.formula} \alias{LdaClassic.default} \title{ Linear Discriminant Analysis } \description{ Performs a linear discriminant analysis and returns the results as an object of class \code{LdaClassic} (aka constructor). } \usage{ LdaClassic(x, ...) %%\method{LdaClassic}{formula}(formula, data = NULL, subset, na.action, \dots) \method{LdaClassic}{default}(x, grouping, prior = proportions, tol = 1.0e-4, ...) } \arguments{ \item{x}{a matrix or data frame containing the explanatory variables (training set). } \item{grouping}{grouping variable: a factor specifying the class for each observation.} \item{prior}{prior probabilities, default to the class proportions for the training set.} \item{tol}{tolerance} \item{\dots}{arguments passed to or from other methods.} } %\details{} \value{ Returns an S4 object of class \code{LdaClassic} } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{Lda-class}}, \code{\link{LdaClassic-class}}, } \examples{ ## Example anorexia library(MASS) data(anorexia) ## rrcov: LdaClassic() lda <- LdaClassic(Treat~., data=anorexia) predict(lda)@classification ## MASS: lda() lda.MASS <- lda(Treat~., data=anorexia) predict(lda.MASS)$class ## Compare the prediction results of MASS:::lda() and LdaClassic() all.equal(predict(lda)@classification, predict(lda.MASS)$class) } \keyword{robust} \keyword{multivariate} rrcov/man/Qda-class.Rd0000644000176200001440000000525512763517421014276 0ustar liggesusers\name{Qda-class} \Rdversion{1.1} \docType{class} \alias{Qda-class} \alias{predict,Qda-method} \alias{show,Qda-method} \alias{summary,Qda-method} \title{Class "Qda" - virtual base class for all classic and robust QDA classes } \description{ The class \code{Qda} serves as a base class for deriving all other classes representing the results of classical and robust Quadratic Discriminant Analisys methods } \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{the (matched) function call.} \item{\code{prior}:}{prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the group covariance matrices} \item{\code{covinv}:}{the inverse of the group covariance matrices} \item{\code{covdet}:}{the determinants of the group covariance matrices} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{control}:}{object of class \code{"CovControl"} specifying which estimate and with what estimation options to use for the group means and covariances (or \code{NULL} for classical discriminant analysis)} } } \section{Methods}{ \describe{ \item{predict}{\code{signature(object = "Qda")}: calculates prediction using the results in \code{object}. An optional data frame or matrix in which to look for variables with which to predict. If omitted, the scores are used. If the original fit used a formula or a data frame or a matrix with column names, newdata must contain columns with the same names. Otherwise it must contain the same number of columns, to be used in the same order. } \item{show}{\code{signature(object = "Qda")}: prints the results } \item{summary}{\code{signature(object = "Qda")}: prints summary information } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{QdaClassic}}, \code{\link{QdaClassic-class}}, \code{\link{QdaRobust-class}} } \examples{ showClass("Qda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/QdaClassic.Rd0000644000176200001440000000255112763517421014471 0ustar liggesusers\name{QdaClassic} \Rdversion{1.1} \alias{QdaClassic} \alias{QdaClassic.formula} \alias{QdaClassic.default} \title{ Quadratic Discriminant Analysis } \description{ Performs quadratic discriminant analysis and returns the results as an object of class \code{QdaClassic} (aka constructor). } \usage{ QdaClassic(x, ...) %%\method{QdaClassic}{formula}(formula, data = NULL, subset, na.action, \dots) \method{QdaClassic}{default}(x, grouping, prior = proportions, tol = 1.0e-4, ...) } \arguments{ \item{x}{a matrix or data frame containing the explanatory variables (training set). } \item{grouping}{grouping variable: a factor specifying the class for each observation.} \item{prior}{prior probabilities, default to the class proportions for the training set.} \item{tol}{tolerance} \item{\dots}{arguments passed to or from other methods.} } %\details{} \value{ Returns an S4 object of class \code{QdaClassic} } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{Qda-class}}, \code{\link{QdaClassic-class}}, } %\examples{} \keyword{robust} \keyword{multivariate} rrcov/man/Linda-class.Rd0000644000176200001440000000421212763517421014610 0ustar liggesusers\name{Linda-class} \docType{class} \alias{Linda-class} \title{Class "Linda" - Robust method for LINear Discriminant Analysis } \description{ Robust linear discriminant analysis is performed by replacing the classical group means and withing group covariance matrix by robust equivalents based on MCD. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("Linda", ...)} but the usual way of creating \code{Linda} objects is a call to the function \code{Linda} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{call}:}{The (matched) function call.} \item{\code{prior}:}{Prior probabilities used, default to group proportions} \item{\code{counts}:}{number of observations in each class} \item{\code{center}:}{the group means} \item{\code{cov}:}{the common covariance matrix} \item{\code{ldf}:}{a matrix containing the linear discriminant functions} \item{\code{ldfconst}:}{a vector containing the constants of each linear discriminant function} \item{\code{method}:}{a character string giving the estimation method used} \item{\code{X}:}{the training data set (same as the input parameter x of the constructor function)} \item{\code{grp}:}{grouping variable: a factor specifying the class for each observation.} \item{\code{l1med}:}{wheather L1 median was used to compute group means.} } } \section{Extends}{ Class \code{"\linkS4class{LdaRobust}"}, directly. Class \code{"\linkS4class{Lda}"}, by class "LdaRobust", distance 2. } \section{Methods}{No methods defined with class "Linda" in the signature.} \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{LdaRobust-class}}, \code{\link{Lda-class}}, \code{\link{LdaClassic}}, \code{\link{LdaClassic-class}} } \examples{ showClass("Linda") } \keyword{robust} \keyword{multivariate} rrcov/man/Cascades.Rd0000644000176200001440000000411512763517421014166 0ustar liggesusers\name{Cascades} \alias{Cascades} \docType{data} \title{ Annual precipitation totals for the North Cascades region} \description{ The data on annual precipitation totals for the North Cascades region contains the sample L-moments ratios (L-CV, L-skewness and L-kurtosis) for 19 sites as used by Hosking and Wallis (1997), page 53, Table 3.4, to illustrate screening tools for regional freqency analysis (RFA). } \usage{data(Cascades)} \format{ A data frame with 19 observations on the following 3 variables. \describe{ \item{\code{L-CV}}{L-coefficient of variation} \item{\code{L-skewness}}{L-coefficient of skewness} \item{\code{L-kurtosis}}{L-coefficient of kurtosis} } } \details{ The sample L-moment ratios (L-CV, L-skewness and L-kurtosis) of a site are regarded as a point in three dimensional space. } \source{ Hosking, J. R. M. and J. R. Wallis (1997), \emph{Regional Frequency Analysis: An Approach Based on L-moments.} Cambridge University Press, p. 52--53 } \references{ Neykov, N.M., Neytchev, P.N., Van Gelder, P.H.A.J.M. and Todorov V. (2007), Robust detection of discordant sites in regional frequency analysis, \emph{Water Resources Research}, 43, W06417, doi:10.1029/2006WR005322, \url{http://www.agu.org/pubs/crossref/2007/2006WR005322.shtml} } \examples{ data(Cascades) # plot a matrix of scatterplots pairs(Cascades, main="Cascades data set", pch=21, bg=c("red", "green3", "blue")) mcd<-CovMcd(Cascades) mcd plot(mcd, which="dist", class=TRUE) plot(mcd, which="dd", class=TRUE) ## identify the discordant sites using robust distances and compare ## to the classical ones rd <- sqrt(getDistance(mcd)) ccov <- CovClassic(Cascades) cd <- sqrt(getDistance(ccov)) r.out <- which(rd > sqrt(qchisq(0.975,3))) c.out <- which(cd > sqrt(qchisq(0.975,3))) cat("Robust: ", length(r.out), " outliers: ", r.out,"\n") cat("Classical: ", length(c.out), " outliers: ", c.out,"\n") } \keyword{datasets} rrcov/man/SummaryLda-class.Rd0000644000176200001440000000222112763517421015635 0ustar liggesusers\name{SummaryLda-class} \docType{class} \alias{SummaryLda-class} \alias{show,SummaryLda-method} \title{ Class "SummaryLda" - summary of "Lda" objects } \description{ Contains summary information about an \code{Lda} object - Linear Discriminant Analysis object } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("SummaryLda", ...)}, but most often by invoking 'summary' on an "Lda" object. They contain values meant for printing by 'show'. } \section{Slots}{ \describe{ \item{\code{ldaobj}:}{Object of class \code{"Lda"}} } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "SummaryLda")}: display the object } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Lda-class}} } \examples{ showClass("SummaryLda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/plot-methods.Rd0000644000176200001440000000451312763517421015101 0ustar liggesusers\name{plot-methods} \docType{methods} \concept{High breakdown point} \alias{plot-methods} \alias{plot,CovClassic-method} \alias{plot,CovClassic,missing-method} \alias{plot,CovRobust-method} \alias{plot,CovRobust,missing-method} \title{Methods for Function 'plot' in Package 'rrcov'} \description{ Shows the Mahalanobis distances based on robust and/or classical estimates of the location and the covariance matrix in different plots. The following plots are available: - index plot of the robust and mahalanobis distances - distance-distance plot - Chisquare QQ-plot of the robust and mahalanobis distances - plot of the tolerance ellipses (robust and classic) - Scree plot - Eigenvalues comparison plot } \usage{ \S4method{plot}{CovClassic}(x, which = c("all","distance","qqchi2","tolellipse","screeplot"), ask=(which=="all" && dev.interactive()), cutoff, id.n, tol=1e-7, \dots) \S4method{plot}{CovRobust}(x, which = c("all","dd","distance","qqchi2","tolellipse","screeplot"), classic=FALSE, ask=(which=="all" && dev.interactive()), cutoff, id.n, tol=1e-7, \dots) } \arguments{ \item{x}{an object of class \code{"Cov"} or \code{"CovRobust"}} \item{which}{ Which plot to show? See Details for description of the options. Default is \code{which}="all". }. \item{classic}{ whether to plot the classical distances too. Default is \code{classic}=FALSE. }. \item{ask}{ logical; if 'TRUE', the user is \emph{ask}ed before each plot, see 'par(ask=.)'. Default is \code{ask = which=="all" && dev.interactive()}. } \item{cutoff}{ The cutoff value for the distances. } \item{id.n}{ Number of observations to identify by a label. If not supplied, the number of observations with distance larger than \code{cutoff} is used. } \item{tol}{ tolerance to be used for computing the inverse see 'solve'. Default is \code{tol = 10e-7}} \item{... }{ other parameters to be passed through to plotting functions. } } \section{Methods}{\describe{ \item{x = "Cov", y = "missing"}{Plot mahalanobis distances for \code{x}.} \item{x = "CovRobust", y = "missing"}{Plot robust and classical mahalanobis distances for \code{x}.} }} \examples{ data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) cv <- CovClassic(hbk.x) plot(cv) rcv <- CovMest(hbk.x) plot(rcv) } \keyword{methods} rrcov/man/CovMMest.Rd0000644000176200001440000000654712763517421014170 0ustar liggesusers\encoding{latin1} \name{CovMMest} \alias{CovMMest} \title{ MM Estimates of Multivariate Location and Scatter } \concept{High breakdown point} \description{ Computes MM-Estimates of multivariate location and scatter starting from an initial S-estimate } \usage{ CovMMest(x, bdp = 0.5, eff = 0.95, eff.shape=TRUE, maxiter = 50, trace = FALSE, tolSolve = 1e-7, control) } \arguments{ \item{x}{ a matrix or data frame. } \item{bdp}{a numeric value specifying the required breakdown point. Allowed values are between 0.5 and 1 and the default is \code{bdp=0.5}. } \item{eff}{a numeric value specifying the required efficiency for the MM estimates. Default is \code{eff=0.95}. } \item{eff.shape}{logical; if TRUE, eff is with regard to shape-efficiency, otherwise location-efficiency. Default is \code{eff.shape=FALSE}. } \item{maxiter}{maximum number of iterations allowed in the computation of the S-estimate (bisquare and Rocke type). Default is \code{maxiter=50}. } \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}.} \item{tolSolve}{numeric tolerance to be used as a convergence tolerance for the MM-iteration} \item{control}{ a control object (S4) of class \code{\link{CovControlMMest-class}} containing estimation options - same as these provided in the fucntion specification. If the control object is supplied, the parameters from it will be used. If parameters are passed also in the invocation statement, they will override the corresponding elements of the control object.} } \details{ Computes MM-estimates of multivariate location and scatter starting from an initial S-estimate. } \value{ An S4 object of class \code{\link{CovMMest-class}} which is a subclass of the virtual class \code{\link{CovRobust-class}}. } \references{ Tatsuoka, K.S. and Tyler, D.E. (2000). The uniqueness of S and M-functionals under non-elliptical distributions. \emph{Annals of Statistics} 28, 1219--1243 M. Salibian-Barrera, S. Van Aelstt and G. Willems (2006). Principal components analysis based on multivariate MM-estimators with fast and robust bootstrap. \emph{Journal of the American Statistical Association} 101, 1198--1211. R. A. Maronna, D. Martin and V. Yohai (2006). \emph{Robust Statistics: Theory and Methods}. Wiley, New York. Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} %\seealso{} \examples{ library(rrcov) data(hbk) hbk.x <- data.matrix(hbk[, 1:3]) CovMMest(hbk.x) ## the following four statements are equivalent c0 <- CovMMest(hbk.x) c1 <- CovMMest(hbk.x, bdp = 0.25) c2 <- CovMMest(hbk.x, control = CovControlMMest(bdp = 0.25)) c3 <- CovMMest(hbk.x, control = new("CovControlMMest", bdp = 0.25)) ## direct specification overrides control one: c4 <- CovMMest(hbk.x, bdp = 0.40, control = CovControlMMest(bdp = 0.25)) c1 summary(c1) plot(c1) ## Deterministic MM-estmates CovMMest(hbk.x, control=CovControlMMest(sest=CovControlSest(method="sdet"))) } \keyword{robust} \keyword{multivariate} rrcov/man/PredictLda-class.Rd0000644000176200001440000000251112763517421015574 0ustar liggesusers\name{PredictLda-class} \docType{class} \alias{PredictLda-class} \alias{show,PredictLda-method} \title{Class "PredictLda" - prediction of "Lda" objects } \description{ The prediction of a "Lda" object } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PredictLda", ...)} but most often by invoking 'predict' on a "Lda" object. They contain values meant for printing by 'show'} \section{Slots}{ \describe{ \item{\code{classification}:}{a factor variable containing the classification of each object } \item{\code{posterior}:}{a matrix containing the posterior probabilities } \item{\code{x}:}{ matrix with the discriminant scores } \item{\code{ct}:}{re-classification table of the training sample} } } \section{Methods}{ \describe{ \item{show}{\code{signature(object = "PredictLda")}: Prints the results } } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\note{} \seealso{ \code{\link{Lda-class}} } \examples{ showClass("PredictLda") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/lmom33.Rd0000644000176200001440000000415612763517421013577 0ustar liggesusers\name{lmom33} \alias{lmom33} \docType{data} \title{ Hosking and Wallis Data Set, Table 3.3} \description{ The data on annual maximum streamflow at 17 sites with largest drainage area basins in southeastern USA contains the sample L-moments ratios (L-CV, L-skewness and L-kurtosis) as used by Hosking and Wallis (1997) to illustrate the discordancy measure in regional freqency analysis (RFA). } \usage{data(lmom33)} \format{ A data frame with 17 observations on the following 3 variables. \describe{ \item{\code{L-CV}}{L-coefficient of variation} \item{\code{L-skewness}}{L-coefficient of skewness} \item{\code{L-kurtosis}}{L-coefficient of kurtosis} } } \details{ The sample L-moment ratios (L-CV, L-skewness and L-kurtosis) of a site are regarded as a point in three dimensional space. } \source{ Hosking, J. R. M. and J. R. Wallis (1997), \emph{Regional Frequency Analysis: An Approach Based on L-moments.} Cambridge University Press, p.51, Table 3.3 } \references{ Neykov, N.M., Neytchev, P.N., Van Gelder, P.H.A.J.M. and Todorov V. (2007), Robust detection of discordant sites in regional frequency analysis, \emph{Water Resources Research}, 43, W06417, doi:10.1029/2006WR005322, \url{http://www.agu.org/pubs/crossref/2007/2006WR005322.shtml} } \examples{ data(lmom33) # plot a matrix of scatterplots pairs(lmom33, main="Hosking and Wallis Data Set, Table 3.3", pch=21, bg=c("red", "green3", "blue")) mcd<-CovMcd(lmom33) mcd plot(mcd, which="dist", class=TRUE) plot(mcd, which="dd", class=TRUE) ## identify the discordant sites using robust distances and compare ## to the classical ones mcd <- CovMcd(lmom33) rd <- sqrt(getDistance(mcd)) ccov <- CovClassic(lmom33) cd <- sqrt(getDistance(ccov)) r.out <- which(rd > sqrt(qchisq(0.975,3))) c.out <- which(cd > sqrt(qchisq(0.975,3))) cat("Robust: ", length(r.out), " outliers: ", r.out,"\n") cat("Classical: ", length(c.out), " outliers: ", c.out,"\n") } \keyword{datasets} rrcov/man/CovControlMve.Rd0000644000176200001440000000354612763517421015227 0ustar liggesusers\name{CovControlMve} \alias{CovControlMve} % \title{ Constructor function for objects of class "CovControlMve"} \description{ This function will create a control object \code{CovControlMve} containing the control parameters for \code{CovMve} } \usage{ CovControlMve(alpha = 0.5, nsamp = 500, seed = NULL, trace= FALSE) } \arguments{ \item{alpha}{numeric parameter controlling the size of the subsets over which the determinant is minimized, i.e., \code{alpha*n} observations are used for computing the determinant. Allowed values are between 0.5 and 1 and the default is 0.5.} \item{nsamp}{ number of subsets used for initial estimates or \code{"best"} or \code{"exact"}. Default is \code{nsamp = 500}. For \code{nsamp="best"} exhaustive enumeration is done, as long as the number of trials does not exceed 5000. For \code{"exact"}, exhaustive enumeration will be attempted however many samples are needed. In this case a warning message will be displayed saying that the computation can take a very long time.} \item{seed}{starting value for random generator. Default is \code{seed = NULL}} \item{trace}{whether to print intermediate results. Default is \code{trace = FALSE}} } %\details{} \value{ A \code{CovControlMve} object } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMve", alpha=0.75) ctrl2 <- CovControlMve(alpha=0.75) data(hbk) CovMve(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/CovMcd-class.Rd0000644000176200001440000000651412763517421014743 0ustar liggesusers\name{CovMcd-class} \Rdversion{1.1} \docType{class} \alias{CovMcd-class} \title{ MCD Estimates of Multivariate Location and Scatter } \description{ This class, derived from the virtual class \code{"CovRobust"} accomodates MCD Estimates of multivariate location and scatter computed by the \sQuote{Fast MCD} algorithm. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovMcd", ...)}, but the usual way of creating \code{CovMcd} objects is a call to the function \code{CovMcd} which serves as a constructor. } \section{Slots}{ \describe{ \item{\code{alpha}:}{Object of class \code{"numeric"} - the size of the subsets over which the determinant is minimized (the default is (n+p+1)/2) } \item{\code{quan}:}{Object of class \code{"numeric"} - the number of observations on which the MCD is based. If \code{quan} equals \code{n.obs}, the MCD is the classical covariance matrix. } \item{\code{best}:}{Object of class \code{"Uvector"} - the best subset found and used for computing the raw estimates. The size of \code{best} is equal to \code{quan} } \item{\code{raw.cov}:}{Object of class \code{"matrix"} the raw (not reweighted) estimate of location } \item{\code{raw.center}:}{Object of class \code{"vector"} - the raw (not reweighted) estimate of scatter} \item{\code{raw.mah}:}{Object of class \code{"Uvector"} - mahalanobis distances of the observations based on the raw estimate of the location and scatter } \item{\code{raw.wt}:}{Object of class \code{"Uvector"} - weights of the observations based on the raw estimate of the location and scatter } \item{\code{raw.cnp2}:}{Object of class \code{"numeric"} - a vector of length two containing the consistency correction factor and the finite sample correction factor of the raw estimate of the covariance matrix } \item{\code{cnp2}:}{Object of class \code{"numeric"} - a vector of length two containing the consistency correction factor and the finite sample correction factor of the final estimate of the covariance matrix. } \item{\code{iter}, \code{crit}, \code{wt}:}{from the \code{"\linkS4class{CovRobust}"} class. } \item{\code{call}, \code{cov}, \code{center}, \code{n.obs}, \code{mah}, \code{method}, \code{singularity}, \code{X}:}{from the \code{"\linkS4class{Cov}"} class. } } } \section{Extends}{ Class \code{"\linkS4class{CovRobust}"}, directly. Class \code{"\linkS4class{Cov}"}, by class \code{"\linkS4class{CovRobust}"}. } \section{Methods}{ No methods defined with class \code{"CovMcd"} in the signature. } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } \author{ Valentin Todorov \email{valentin.todorov@chello.at} } \seealso{ \code{\link{CovMcd}}, \code{\link{Cov-class}}, \code{\link{CovRobust-class}} } \examples{ showClass("CovMcd") } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/diabetes.Rd0000644000176200001440000000504313564365672014252 0ustar liggesusers\name{diabetes} \alias{diabetes} \docType{data} \title{Reaven and Miller diabetes data} \description{ The data set contains five measurements made on 145 non-obese adult patients classified into three groups. The three primary variables are glucose intolerance (area under the straight line connecting glucose levels), insulin response to oral glucose (area under the straight line connecting insulin levels) and insulin resistance (measured by the steady state plasma glucose (SSPG) determined after chemical suppression of endogenous insulin secretion). Two additional variables, the relative weight and fasting plasma glucose, are also included. Reaven and Miller, following Friedman and Rubin (1967), applied cluster analysis to the three primary variables and identified three clusters: "normal", "chemical diabetic", and "overt diabetic" subjects. The column \code{group} contains the classifications of the subjects into these three groups, obtained by current medical criteria. } \usage{ data(diabetes) } \format{A data frame with the following variables: \describe{ \item{rw}{relative weight, expressed as the ratio of actual weight to expected weight, given the person's height.} \item{fpg}{fasting plasma glucose level.} \item{glucose}{area under plasma glucose curve after a three hour oral glucose tolerance test (OGTT).} \item{insulin}{area under plasma insulin curve after a three hour oral glucose tolerance test (OGTT).} \item{sspg}{Steady state plasma glucose, a measure of insulin resistance.} \item{group}{the type of diabetes: a factor with levels \code{normal}, \code{chemical} and \code{overt}.}} } \source{ Reaven, G. M. and Miller, R. G. (1979). An attempt to define the nature of chemical diabetes using a multidimensional analysis. \emph{Diabetologia} 16, 17--24. Andrews, D. F. and Herzberg, A. M. (1985). \emph{Data: A Collection of Problems from Many Fields for the Student and Research Worker}, Springer-Verlag, Ch. 36. } \references{ Reaven, G. M. and Miller, R. G. (1979). An attempt to define the nature of chemical diabetes using a multidimensional analysis. \emph{Diabetologia} 16, 17--24. Friedman, H. P. and Rubin, J. (1967). On some invariant criteria for grouping data. \emph{Journal of the American Statistical Association} \bold{62}, 1159--1178. Hawkins, D. M. and McLachlan, G. J., 1997. High-breakdown linear discriminant analysis. \emph{Journal of the American Statistical Association} \bold{92} (437), 136--143. } \examples{ data(diabetes) (cc <- Linda(group~insulin+glucose+sspg, data=diabetes)) (pr <- predict(cc)) } \keyword{datasets} rrcov/man/CovControlMMest-class.Rd0000644000176200001440000000457612763517421016634 0ustar liggesusers\name{CovControlMMest-class} \Rdversion{1.1} \docType{class} \alias{CovControlMMest-class} \alias{restimate,CovControlMMest-method} \title{Class 'CovControlMMest' - contains control parameters for "CovMMest"} \description{ This class extends the \code{CovControl} class and contains the control parameters for CovMMest } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("CovControlMMest", ...)} or by calling the constructor-function \code{CovControlMMest}. } \section{Slots}{ \describe{ \item{bdp}{a numeric value specifying the required breakdown point. Allowed values are between 0.5 and 1 and the default is \code{bdp=0.5}. } \item{eff}{a numeric value specifying the required efficiency for the MM estimates. Default is \code{eff=0.95}. } \item{sest}{an \code{CovControlSest} object containing control parameters for the initial S-estimate. } \item{maxiter}{maximum number of iterations allowed in the computation of the MM-estimate. Default is \code{maxiter=50}. } \item{\code{trace}, \code{tolSolve}:}{from the \code{"\linkS4class{CovControl}"} class. \code{tolSolve} is used as a convergence tolerance for the MM-iteration. } } } \section{Extends}{ Class \code{"\linkS4class{CovControl}"}, directly. } \section{Methods}{ \describe{ \item{restimate}{\code{signature(obj = "CovControlMMest")}: the generic function \code{restimate} allowes the different methods for robust estimation to be used polymorphically - this function will call \code{CovMMest} passing it the control object and will return the obtained \code{CovRobust} object} } } \references{ Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. \emph{Journal of Statistical Software}, \bold{32}(3), 1--47. URL \url{http://www.jstatsoft.org/v32/i03/}. } %\note{} \author{Valentin Todorov \email{valentin.todorov@chello.at}} %\seealso{} \examples{ ## the following two statements are equivalent ctrl1 <- new("CovControlMMest", bdp=0.25) ctrl2 <- CovControlMMest(bdp=0.25) data(hbk) CovMMest(hbk, control=ctrl1) } \keyword{classes} \keyword{robust} \keyword{multivariate} rrcov/man/Pca-class.Rd0000644000176200001440000001317412763517421014273 0ustar liggesusers\name{Pca-class} \docType{class} \alias{Pca-class} \alias{getCenter,Pca-method} \alias{getScale,Pca-method} \alias{getEigenvalues,Pca-method} \alias{getLoadings,Pca-method} \alias{getPrcomp,Pca-method} \alias{getScores,Pca-method} \alias{getSdev,Pca-method} \alias{plot,Pca,missing-method} \alias{show,Pca-method} \alias{predict,Pca-method} \alias{predict} \alias{screeplot,Pca-method} \alias{screeplot} \alias{summary,Pca-method} \title{Class "Pca" - virtual base class for all classic and robust PCA classes } \description{ The class \code{Pca} searves as a base class for deriving all other classes representing the results of the classical and robust Principal Component Analisys methods } \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Slots}{ \describe{ \item{\code{call}:}{Object of class \code{"language"} } \item{\code{center}:}{Object of class \code{"vector"} the center of the data } \item{\code{scale}:}{Object of class \code{"vector"} the scaling applied to each variable of the data } \item{\code{loadings}:}{Object of class \code{"matrix"} the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors) } \item{\code{eigenvalues}:}{Object of class \code{"vector"} the eigenvalues } \item{\code{scores}:}{Object of class \code{"matrix"} the scores - the value of the projected on the space of the principal components data (the centred (and scaled if requested) data multiplied by the \code{loadings} matrix) is returned. Hence, \code{cov(scores)} is the diagonal matrix \code{diag(eigenvalues)} } \item{\code{k}:}{Object of class \code{"numeric"} number of (choosen) principal components } \item{\code{sd}:}{Object of class \code{"Uvector"} Score distances within the robust PCA subspace } \item{\code{od}:}{Object of class \code{"Uvector"} Orthogonal distances to the robust PCA subspace } \item{\code{cutoff.sd}:}{Object of class \code{"numeric"} Cutoff value for the score distances} \item{\code{cutoff.od}:}{Object of class \code{"numeric"} Cutoff values for the orthogonal distances } \item{\code{flag}:}{Object of class \code{"Uvector"} The observations whose score distance is larger than cutoff.sd or whose orthogonal distance is larger than cutoff.od can be considered as outliers and receive a flag equal to zero. The regular observations receive a flag 1 } \item{crit.pca.distances}{criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.} \item{\code{n.obs}:}{Object of class \code{"numeric"} the number of observations } } } \section{Methods}{ \describe{ \item{getCenter}{\code{signature(obj = "Pca")}: center of the data } \item{getScale}{\code{signature(obj = "Pca")}: return the scaling applied to each variable } \item{getEigenvalues}{\code{signature(obj = "Pca")}: the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix) } \item{getLoadings}{\code{signature(obj = "Pca")}: returns the matrix \code{loadings} (i.e., a matrix whose columns contain the eigenvectors). The function prcomp returns this matrix in the element rotation. } \item{getPrcomp}{\code{signature(obj = "Pca")}: returns an S3 object \code{prcomp} for compatibility with the functions prcomp() and princomp(). Thus the standard plots screeplot() and biplot() can be used} \item{getScores}{\code{signature(obj = "Pca")}: returns the rotated data (the centred (and scaled if requested) data multiplied by the loadings matrix). } \item{getSdev}{\code{signature(obj = "Pca")}: returns the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix) } \item{plot}{\code{signature(x = "Pca")}: produces a distance plot (if \code{k=rank}) or distance-distance plot (if\code{k sqrt(qchisq(0.975,3))) c.out <- which(cd > sqrt(qchisq(0.975,3))) cat("Robust: ", length(r.out), " outliers: ", r.out,"\n") cat("Classical: ", length(c.out), " outliers: ", c.out,"\n") } \keyword{datasets} rrcov/man/getCenter-methods.Rd0000644000176200001440000000341113363300100016014 0ustar liggesusers\name{getCenter-methods} \docType{methods} \title{Accessor methods to the essential slots of Cov and its subclasses} \alias{getCenter} \alias{getCenter-methods} \alias{getCov} \alias{getCov-methods} \alias{getCorr} \alias{getCorr-methods} \alias{getData} \alias{getData-methods} \alias{getDistance} \alias{getDistance-methods} \alias{getEvals} \alias{getEvals-methods} \alias{getDet} \alias{getDet-methods} \alias{getShape} \alias{getShape-methods} \alias{getFlag} \alias{getFlag-methods} \alias{getMeth} \alias{getMeth-methods} \alias{isClassic} \alias{isClassic-methods} \alias{getRaw} \alias{getRaw-methods} \alias{names} \alias{names-methods} \alias{names,Cov-method} \alias{$-methods} \alias{$,Cov-method} \usage{ getCenter(obj) getCov(obj) getCorr(obj) getData(obj) getDistance(obj) getEvals(obj) getDet(obj) getShape(obj) getFlag(obj, prob=0.975) getMeth(obj) isClassic(obj) getRaw(obj) } \arguments{ \item{obj}{an object of class \code{"Cov"} or of a class derived from \code{"Cov"}} \item{prob}{optional argument for \code{getFlag} - probability, defaults to 0.975} } \description{ Accessor methods to the slots of objects of class\code{Cov} and its subclasses } \section{Methods}{ \describe{ \item{obj = "Cov"}{generic functions - see \code{getCenter}, \code{getCov}, \code{getCorr}, \code{getData}, \code{getDistance}, \code{getEvals}, \code{getDet}, \code{getShape}, \code{getFlag}, \code{isClassic}} \item{obj = "CovRobust"}{generic functions - see \code{getCenter}, \code{getCov}, \code{getCorr}, \code{getData}, \code{getDistance}, \code{getEvals}, \code{getDet}, \code{getShape}, \code{getFlag}, \code{getMeth}, \code{isClassic}} }} \keyword{methods} \keyword{multivariate} \keyword{robust} rrcov/DESCRIPTION0000644000176200001440000000231613610127006013111 0ustar liggesusersPackage: rrcov Version: 1.5-2 Date: 2020-01-14 VersionNote: Released 1.4-9 on 2019-11-25 on CRAN Title: Scalable Robust Estimators with High Breakdown Point Author: Valentin Todorov Description: Robust Location and Scatter Estimation and Robust Multivariate Analysis with High Breakdown Point: principal component analysis (Filzmoser and Todorov (2013), ), linear and quadratic discriminant analysis (Todorov and Pires (2007)), multivariate tests (Todorov and Filzmoser (2010) ), outlier detection (Todorov et al. (2010) ). See also Todorov and Filzmoser (2009) , Todorov and Filzmoser (2010) and Boudt et al. (2019) . Maintainer: Valentin Todorov Depends: R (>= 2.10), robustbase (>= 0.92.1), methods Imports: stats, stats4, mvtnorm, lattice, pcaPP Suggests: grid, MASS LazyLoad: yes License: GPL (>= 2) Repository: CRAN Packaged: 2020-01-14 16:21:56 UTC; todorovv NeedsCompilation: yes Date/Publication: 2020-01-16 18:40:06 UTC rrcov/build/0000755000176200001440000000000013607365240012512 5ustar liggesusersrrcov/build/vignette.rds0000644000176200001440000000044213607365240015051 0ustar liggesusersmN0 ۵h%$}U/h8pZJU wM-)Nb;y/m&X?5ҺhI:'TbĂZ",Ea]Dh7!$%`J[VN`n3rrcov/tests/0000755000176200001440000000000013607364436012563 5ustar liggesusersrrcov/tests/tldapp.R0000644000176200001440000000223613373055001014156 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) dodata <- function(method) { options(digits = 5) set.seed(101) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("===================================================\n") data(pottery); show(lda <- LdaPP(origin~., data=pottery, method=method)); show(predict(lda)) data(hemophilia); show(lda <- LdaPP(as.factor(gr)~., data=hemophilia, method=method)); show(predict(lda)) data(anorexia); show(lda <- LdaPP(Treat~., data=anorexia, method=method)); show(predict(lda)) data(Pima.tr); show(lda <- LdaPP(type~., data=Pima.tr, method=method)); show(predict(lda)) data(crabs); show(lda <- LdaPP(sp~., data=crabs, method=method)); show(predict(lda)) cat("===================================================\n") } ## -- now do it: ## Commented out - still to slow ##dodata(method="huber") ##dodata(method="sest") ## VT::14.11.2018 - Commented out: too slow ## dodata(method="mad") ## dodata(method="class") rrcov/tests/tsest.R0000644000176200001440000001266412763517421014055 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) dodata <- function(nrep = 1, time = FALSE, full = TRUE, method) { doest <- function(x, xname, nrep = 1, method=c("sfast", "surreal", "bisquare", "rocke", "suser", "MM", "sdet")) { method <- match.arg(method) lname <- 20 n <- dim(x)[1] p <- dim(x)[2] mm <- if(method == "MM") CovMMest(x) else CovSest(x, method=method) crit <- log(mm@crit) xres <- sprintf("%3d %3d %12.6f\n", dim(x)[1], dim(x)[2], crit) lpad <- lname-nchar(xname) cat(pad.right(xname,lpad), xres) dist <- getDistance(mm) quantiel <- qchisq(0.975, p) ibad <- which(dist >= quantiel) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ",nbad,"\n") if(nbad > 0) print(ibad) cat("-------------\n") show(mm) cat("--------------------------------------------------------\n") } options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed data(heart) data(starsCYG) data(phosphor) data(stackloss) data(coleman) data(salinity) data(wood) data(hbk) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(milk) data(bushfire) ### data(rice) data(hemophilia) data(fish) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p LOG(det) Time\n") cat("===================================================\n") doest(heart[, 1:2], data(heart), nrep, method=method) doest(starsCYG, data(starsCYG), nrep, method=method) doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep, method=method) doest(stack.x, data(stackloss), nrep, method=method) doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep, method=method) doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep, method=method) doest(data.matrix(subset(wood, select = -y)), data(wood), nrep, method=method) doest(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep, method=method) doest(brain, "Animals", nrep, method=method) doest(milk, data(milk), nrep, method=method) doest(bushfire, data(bushfire), nrep, method=method) doest(data.matrix(subset(rice, select = -Overall_evaluation)), data(rice), nrep, method=method) doest(data.matrix(subset(hemophilia, select = -gr)), data(hemophilia), nrep, method=method) doest(data.matrix(subset(fish, select = -Species)), data(fish), nrep, method=method) ## from package 'datasets' doest(airquality[,1:4], data(airquality), nrep, method=method) doest(attitude, data(attitude), nrep, method=method) doest(attenu, data(attenu), nrep, method=method) doest(USJudgeRatings, data(USJudgeRatings), nrep, method=method) doest(USArrests, data(USArrests), nrep, method=method) doest(longley, data(longley), nrep, method=method) doest(Loblolly, data(Loblolly), nrep, method=method) doest(quakes[,1:4], data(quakes), nrep, method=method) cat("===================================================\n") } # generate contaminated data using the function gendata with different # number of outliers and check if the M-estimate breaks - i.e. the # largest eigenvalue is larger than e.g. 5. # For n=50 and p=10 and d=5 the M-estimate can break for number of # outliers grater than 20. dogen <- function(){ eig <- vector("numeric",26) for(i in 0:25) { gg <- gendata(eps=i) mm <- CovSRocke(gg$x, t0=gg$tgood, S0=gg$sgood) eig[i+1] <- ev <- getEvals(mm)[1] cat(i, ev, "\n") ## stopifnot(ev < 5 || i > 20) } plot(0:25, eig, type="l", xlab="Number of outliers", ylab="Largest Eigenvalue") } # # generate data 50x10 as multivariate normal N(0,I) and add # eps % outliers by adding d=5.0 to each component. # - if eps <0 and eps <=0.5, the number of outliers is eps*n # - if eps >= 1, it is the number of outliers # - use the center and cov of the good data as good start # - use the center and the cov of all data as a bad start # If using a good start, the M-estimate must iterate to # the good solution: the largest eigenvalue is less then e.g. 5 # gendata <- function(n=50, p=10, eps=0, d=5.0){ if(eps < 0 || eps > 0.5 && eps < 1.0 || eps > 0.5*n) stop("eps is out of range") library(MASS) x <- mvrnorm(n, rep(0,p), diag(p)) bad <- vector("numeric") nbad = if(eps < 1) eps*n else eps if(nbad > 0){ bad <- sample(n, nbad) x[bad,] <- x[bad,] + d } cov1 <- cov.wt(x) cov2 <- if(nbad <= 0) cov1 else cov.wt(x[-bad,]) list(x=x, bad=sort(bad), tgood=cov2$center, sgood=cov2$cov, tbad=cov1$center, sbad=cov1$cov) } pad.right <- function(z, pads) { ## Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } ## -- now do it: dodata(method="sfast") dodata(method="sdet") ##dodata(method="suser") ##dodata(method="surreal") dodata(method="bisquare") dodata(method="rocke") dodata(method="MM") ##dogen() ##cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons'' rrcov/tests/tldapp.Rout.save0000644000176200001440000000365413373056101015652 0ustar liggesusers R Under development (unstable) (2018-11-12 r75592) -- "Unsuffered Consequences" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > library(MASS) > > dodata <- function(method) { + + options(digits = 5) + set.seed(101) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + cat("===================================================\n") + + data(pottery); show(lda <- LdaPP(origin~., data=pottery, method=method)); show(predict(lda)) + data(hemophilia); show(lda <- LdaPP(as.factor(gr)~., data=hemophilia, method=method)); show(predict(lda)) + data(anorexia); show(lda <- LdaPP(Treat~., data=anorexia, method=method)); show(predict(lda)) + data(Pima.tr); show(lda <- LdaPP(type~., data=Pima.tr, method=method)); show(predict(lda)) + data(crabs); show(lda <- LdaPP(sp~., data=crabs, method=method)); show(predict(lda)) + + cat("===================================================\n") + } > > > ## -- now do it: > > ## Commented out - still to slow > ##dodata(method="huber") > ##dodata(method="sest") > > ## VT::14.11.2018 - Commented out: too slow > ## dodata(method="mad") > ## dodata(method="class") > > proc.time() user system elapsed 0.54 0.06 0.59 rrcov/tests/tmest4.Rout.save0000644000176200001440000002707212763517421015617 0ustar liggesusers R Under development (unstable) (2013-08-17 r63608) -- "Unsuffered Consequences" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > library(MASS) > dodata <- function(nrep = 1, time = FALSE, full = TRUE) { + domest <- function(x, xname, nrep = 1) { + n <- dim(x)[1] + p <- dim(x)[2] + mm <- CovMest(x) + crit <- log(mm@crit) + ## c1 <- mm@psi@c1 + ## M <- mm$psi@M + + xres <- sprintf("%3d %3d %12.6f\n", dim(x)[1], dim(x)[2], crit) + lpad <- lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + dist <- getDistance(mm) + quantiel <- qchisq(0.975, p) + ibad <- which(dist >= quantiel) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ",nbad,"\n") + if(nbad > 0) + print(ibad) + cat("-------------\n") + show(mm) + cat("--------------------------------------------------------\n") + } + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + lname <- 20 + + data(heart) + data(starsCYG) + data(phosphor) + data(stackloss) + data(coleman) + data(salinity) + data(wood) + data(hbk) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + data(milk) + data(bushfire) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p c1 M LOG(det) Time\n") + cat("======================================================================\n") + domest(heart[, 1:2], data(heart), nrep) + domest(starsCYG, data(starsCYG), nrep) + domest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + domest(stack.x, data(stackloss), nrep) + domest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + domest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + domest(data.matrix(subset(wood, select = -y)), data(wood), nrep) + domest(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep) + + + domest(brain, "Animals", nrep) + domest(milk, data(milk), nrep) + domest(bushfire, data(bushfire), nrep) + cat("======================================================================\n") + } > > # generate contaminated data using the function gendata with different > # number of outliers and check if the M-estimate breaks - i.e. the > # largest eigenvalue is larger than e.g. 5. > # For n=50 and p=10 and d=5 the M-estimate can break for number of > # outliers grater than 20. > dogen <- function(){ + eig <- vector("numeric",26) + for(i in 0:25) { + gg <- gendata(eps=i) + mm <- CovMest(gg$x, t0=gg$tgood, S0=gg$sgood, arp=0.001) + eig[i+1] <- ev <- getEvals(mm)[1] + # cat(i, ev, "\n") + + stopifnot(ev < 5 || i > 20) + } + # plot(0:25, eig, type="l", xlab="Number of outliers", ylab="Largest Eigenvalue") + } > > # > # generate data 50x10 as multivariate normal N(0,I) and add > # eps % outliers by adding d=5.0 to each component. > # - if eps <0 and eps <=0.5, the number of outliers is eps*n > # - if eps >= 1, it is the number of outliers > # - use the center and cov of the good data as good start > # - use the center and the cov of all data as a bad start > # If using a good start, the M-estimate must iterate to > # the good solution: the largest eigenvalue is less then e.g. 5 > # > gendata <- function(n=50, p=10, eps=0, d=5.0){ + + if(eps < 0 || eps > 0.5 && eps < 1.0 || eps > 0.5*n) + stop("eps is out of range") + + library(MASS) + + x <- mvrnorm(n, rep(0,p), diag(p)) + bad <- vector("numeric") + nbad = if(eps < 1) eps*n else eps + if(nbad > 0){ + bad <- sample(n, nbad) + x[bad,] <- x[bad,] + d + } + cov1 <- cov.wt(x) + cov2 <- if(nbad <= 0) cov1 else cov.wt(x[-bad,]) + + list(x=x, bad=sort(bad), tgood=cov2$center, sgood=cov2$cov, tbad=cov1$center, sbad=cov1$cov) + } > > pad.right <- function(z, pads) + { + ## Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > > ## -- now do it: > dodata() Call: dodata() Data Set n p c1 M LOG(det) Time ====================================================================== heart 12 2 7.160341 Outliers: 3 [1] 2 6 12 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: height weight 34.9 27.0 Robust Estimate of Covariance: height weight height 102 155 weight 155 250 -------------------------------------------------------- starsCYG 47 2 -5.994588 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: log.Te log.light 4.42 4.95 Robust Estimate of Covariance: log.Te log.light log.Te 0.0169 0.0587 log.light 0.0587 0.3523 -------------------------------------------------------- phosphor 18 2 8.867522 Outliers: 3 [1] 1 6 10 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: inorg organic 15.4 39.1 Robust Estimate of Covariance: inorg organic inorg 169 213 organic 213 308 -------------------------------------------------------- stackloss 21 3 7.241400 Outliers: 9 [1] 1 2 3 15 16 17 18 19 21 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 59.5 20.8 87.3 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 9.34 8.69 8.52 Water.Temp 8.69 13.72 9.13 Acid.Conc. 8.52 9.13 34.54 -------------------------------------------------------- coleman 20 5 2.574752 Outliers: 7 [1] 2 6 9 10 12 13 15 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.82 48.44 5.30 25.19 6.51 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2850 0.1045 1.7585 0.3074 0.0355 fatherWc 0.1045 824.8305 260.7062 3.7507 17.7959 sstatus 1.7585 260.7062 105.6135 4.1140 5.7714 teacherSc 0.3074 3.7507 4.1140 0.6753 0.1563 motherLev 0.0355 17.7959 5.7714 0.1563 0.4147 -------------------------------------------------------- salinity 28 3 3.875096 Outliers: 9 [1] 3 5 10 11 15 16 17 23 24 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: X1 X2 X3 10.02 3.21 22.36 Robust Estimate of Covariance: X1 X2 X3 X1 15.353 1.990 -5.075 X2 1.990 5.210 -0.769 X3 -5.075 -0.769 2.314 -------------------------------------------------------- wood 20 5 -35.156305 Outliers: 7 [1] 4 6 7 8 11 16 19 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: x1 x2 x3 x4 x5 0.587 0.122 0.531 0.538 0.892 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 6.45e-03 1.21e-03 2.03e-03 -3.77e-04 -1.05e-03 x2 1.21e-03 3.12e-04 8.16e-04 -3.34e-05 1.52e-05 x3 2.03e-03 8.16e-04 4.27e-03 -5.60e-04 2.27e-04 x4 -3.77e-04 -3.34e-05 -5.60e-04 1.83e-03 1.18e-03 x5 -1.05e-03 1.52e-05 2.27e-04 1.18e-03 1.78e-03 -------------------------------------------------------- hbk 75 3 1.432485 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: X1 X2 X3 1.54 1.78 1.69 Robust Estimate of Covariance: X1 X2 X3 X1 1.6485 0.0739 0.1709 X2 0.0739 1.6780 0.2049 X3 0.1709 0.2049 1.5584 -------------------------------------------------------- Animals 28 2 18.194822 Outliers: 10 [1] 2 6 7 9 12 14 15 16 25 28 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: body brain 18.7 64.9 Robust Estimate of Covariance: body brain body 4993 8466 brain 8466 30335 -------------------------------------------------------- milk 86 8 -25.041802 Outliers: 20 [1] 1 2 3 11 12 13 14 15 16 17 18 20 27 41 44 47 70 74 75 77 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.88 33.04 26.11 25.09 25.02 123.12 14.39 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 4.89e-07 9.64e-05 1.83e-04 1.76e-04 1.57e-04 1.48e-04 6.53e-04 X2 9.64e-05 2.05e+00 3.38e-01 2.37e-01 1.70e-01 2.71e-01 1.91e+00 X3 1.83e-04 3.38e-01 1.16e+00 8.56e-01 8.48e-01 8.31e-01 8.85e-01 X4 1.76e-04 2.37e-01 8.56e-01 6.83e-01 6.55e-01 6.40e-01 6.91e-01 X5 1.57e-04 1.70e-01 8.48e-01 6.55e-01 6.93e-01 6.52e-01 6.90e-01 X6 1.48e-04 2.71e-01 8.31e-01 6.40e-01 6.52e-01 6.61e-01 6.95e-01 X7 6.53e-04 1.91e+00 8.85e-01 6.91e-01 6.90e-01 6.95e-01 4.40e+00 X8 5.56e-06 2.60e-01 1.98e-01 1.29e-01 1.12e-01 1.19e-01 4.12e-01 X8 X1 5.56e-06 X2 2.60e-01 X3 1.98e-01 X4 1.29e-01 X5 1.12e-01 X6 1.19e-01 X7 4.12e-01 X8 1.65e-01 -------------------------------------------------------- bushfire 38 5 23.457490 Outliers: 15 [1] 7 8 9 10 11 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovMest(x = x) -> Method: M-Estimates Robust Estimate of Location: V1 V2 V3 V4 V5 107 147 263 215 277 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 775 560 -4179 -925 -759 V2 560 478 -2494 -510 -431 V3 -4179 -2494 27433 6441 5196 V4 -925 -510 6441 1607 1276 V5 -759 -431 5196 1276 1020 -------------------------------------------------------- ====================================================================== > dogen() > #cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons'' > > proc.time() user system elapsed 0.68 0.10 0.79 rrcov/tests/togk4.Rout.save0000644000176200001440000002444213607364045015425 0ustar liggesusers R Under development (unstable) (2020-01-08 r77640) -- "Unsuffered Consequences" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > ## VT::14.01.2020 > ## On some platforms minor differences are shown - use > ## IGNORE_RDIFF_BEGIN > ## IGNORE_RDIFF_END > > dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMCD","MASS")){ + domcd <- function(x, xname, nrep=1){ + n <- dim(x)[1] + p <- dim(x)[2] + + mcd<-CovOgk(x) + + xres <- sprintf("%3d %3d\n", dim(x)[1], dim(x)[2]) + + lpad<-lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + dist <- getDistance(mcd) + quantiel <- qchisq(0.975, p) + ibad <- which(dist >= quantiel) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ",nbad,"\n") + if(nbad > 0) + print(ibad) + cat("-------------\n") + show(mcd) + cat("--------------------------------------------------------\n") + } + + lname <- 20 + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + method <- match.arg(method) + + data(heart) + data(starsCYG) + data(phosphor) + data(stackloss) + data(coleman) + data(salinity) + data(wood) + + data(hbk) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + data(milk) + data(bushfire) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p Half LOG(obj) Time\n") + cat("========================================================\n") + domcd(heart[, 1:2], data(heart), nrep) + ## IGNORE_RDIFF_BEGIN + domcd(starsCYG,data(starsCYG), nrep) + ## IGNORE_RDIFF_END + domcd(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + domcd(stack.x,data(stackloss), nrep) + domcd(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + domcd(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + ## IGNORE_RDIFF_BEGIN + domcd(data.matrix(subset(wood, select = -y)), data(wood), nrep) + ## IGNORE_RDIFF_END + domcd(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep) + + domcd(brain, "Animals", nrep) + domcd(milk, data(milk), nrep) + domcd(bushfire, data(bushfire), nrep) + cat("========================================================\n") + } > > pad.right <- function(z, pads) + { + ### Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > dodata() Call: dodata() Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 Outliers: 5 [1] 2 6 8 10 12 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: height weight 39.76 35.71 Robust Estimate of Covariance: height weight height 15.88 32.07 weight 32.07 78.28 -------------------------------------------------------- starsCYG 47 2 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: log.Te log.light 4.413 4.934 Robust Estimate of Covariance: log.Te log.light log.Te 0.01122 0.03755 log.light 0.03755 0.23499 -------------------------------------------------------- phosphor 18 2 Outliers: 2 [1] 1 6 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: inorg organic 13.31 40.00 Robust Estimate of Covariance: inorg organic inorg 92.82 93.24 organic 93.24 152.62 -------------------------------------------------------- stackloss 21 3 Outliers: 2 [1] 1 2 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 57.72 20.50 85.78 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 38.423 11.306 18.605 Water.Temp 11.306 6.806 5.889 Acid.Conc. 18.605 5.889 29.840 -------------------------------------------------------- coleman 20 5 Outliers: 3 [1] 1 6 10 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.723 43.202 2.912 25.010 6.290 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.12867 2.80048 0.92026 0.15118 0.06413 fatherWc 2.80048 678.72549 227.36415 9.30826 16.15102 sstatus 0.92026 227.36415 101.39094 3.38013 5.63283 teacherSc 0.15118 9.30826 3.38013 0.57112 0.27701 motherLev 0.06413 16.15102 5.63283 0.27701 0.44801 -------------------------------------------------------- salinity 28 3 Outliers: 3 [1] 3 5 16 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: X1 X2 X3 10.74 2.68 22.99 Robust Estimate of Covariance: X1 X2 X3 X1 8.1047 -0.6365 -0.4720 X2 -0.6365 3.0976 -1.3520 X3 -0.4720 -1.3520 2.3648 -------------------------------------------------------- wood 20 5 Outliers: 0 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: x1 x2 x3 x4 x5 0.5508 0.1330 0.5087 0.5112 0.9069 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 0.0078774 -0.0002767 0.0034220 0.0025563 -0.0027250 x2 -0.0002767 0.0004644 -0.0003344 -0.0007968 0.0005818 x3 0.0034220 -0.0003344 0.0039759 0.0014998 -0.0016071 x4 0.0025563 -0.0007968 0.0014998 0.0037489 -0.0007524 x5 -0.0027250 0.0005818 -0.0016071 -0.0007524 0.0026191 -------------------------------------------------------- hbk 75 3 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: X1 X2 X3 1.538 1.780 1.687 Robust Estimate of Covariance: X1 X2 X3 X1 1.11350 0.04992 0.11541 X2 0.04992 1.13338 0.13843 X3 0.11541 0.13843 1.05261 -------------------------------------------------------- Animals 28 2 Outliers: 12 [1] 2 6 7 9 12 14 15 16 17 24 25 28 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: body brain 39.65 105.83 Robust Estimate of Covariance: body brain body 3981 7558 brain 7558 16594 -------------------------------------------------------- milk 86 8 Outliers: 22 [1] 1 2 3 11 12 13 14 15 16 17 18 20 27 41 44 47 50 70 74 75 77 85 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.80 33.10 26.15 25.13 25.06 123.06 14.39 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 4.074e-07 5.255e-05 1.564e-04 1.506e-04 1.340e-04 1.234e-04 5.308e-04 X2 5.255e-05 1.464e+00 3.425e-01 2.465e-01 1.847e-01 2.484e-01 1.459e+00 X3 1.564e-04 3.425e-01 1.070e+00 7.834e-01 7.665e-01 7.808e-01 7.632e-01 X4 1.506e-04 2.465e-01 7.834e-01 6.178e-01 5.868e-01 5.959e-01 5.923e-01 X5 1.340e-04 1.847e-01 7.665e-01 5.868e-01 6.124e-01 5.967e-01 5.868e-01 X6 1.234e-04 2.484e-01 7.808e-01 5.959e-01 5.967e-01 6.253e-01 5.819e-01 X7 5.308e-04 1.459e+00 7.632e-01 5.923e-01 5.868e-01 5.819e-01 3.535e+00 X8 1.990e-07 1.851e-01 1.861e-01 1.210e-01 1.041e-01 1.116e-01 3.046e-01 X8 X1 1.990e-07 X2 1.851e-01 X3 1.861e-01 X4 1.210e-01 X5 1.041e-01 X6 1.116e-01 X7 3.046e-01 X8 1.292e-01 -------------------------------------------------------- bushfire 38 5 Outliers: 17 [1] 7 8 9 10 11 12 28 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovOgk(x = x) -> Method: Orthogonalized Gnanadesikan-Kettenring Estimator Robust Estimate of Location: V1 V2 V3 V4 V5 104.5 146.0 275.6 217.8 279.3 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 266.8 203.2 -1380.7 -311.1 -252.2 V2 203.2 178.4 -910.9 -185.9 -155.9 V3 -1380.7 -910.9 8279.7 2035.5 1615.4 V4 -311.1 -185.9 2035.5 536.5 418.6 V5 -252.2 -155.9 1615.4 418.6 329.2 -------------------------------------------------------- ======================================================== > > proc.time() user system elapsed 0.82 0.24 1.06 rrcov/tests/tmcd4.R0000644000176200001440000002420113372133142013703 0ustar liggesusers## Test the exact fit property of CovMcd doexactfit <- function(){ exact <-function(seed=1234){ set.seed(seed) n1 <- 45 p <- 2 x1 <- matrix(rnorm(p*n1),nrow=n1, ncol=p) x1[,p] <- x1[,p] + 3 n2 <- 55 m1 <- 0 m2 <- 3 x2 <- cbind(rnorm(n2),rep(m2,n2)) x<-rbind(x1,x2) colnames(x) <- c("X1","X2") x } print(CovMcd(exact())) } dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMCD","MASS", "deterministic", "exact", "MRCD")){ ##@bdescr ## Test the function covMcd() on the literature datasets: ## ## Call CovMcd() for all regression datasets available in rrcov and print: ## - execution time (if time == TRUE) ## - objective fucntion ## - best subsample found (if short == false) ## - outliers identified (with cutoff 0.975) (if short == false) ## - estimated center and covarinance matrix if full == TRUE) ## ##@edescr ## ##@in nrep : [integer] number of repetitions to use for estimating the ## (average) execution time ##@in time : [boolean] whether to evaluate the execution time ##@in short : [boolean] whether to do short output (i.e. only the ## objective function value). If short == FALSE, ## the best subsample and the identified outliers are ## printed. See also the parameter full below ##@in full : [boolean] whether to print the estimated cente and covariance matrix ##@in method : [character] select a method: one of (FASTMCD, MASS) doest <- function(x, xname, nrep=1){ n <- dim(x)[1] p <- dim(x)[2] if(method == "MASS"){ mcd<-cov.mcd(x) quan <- as.integer(floor((n + p + 1)/2)) #default: floor((n+p+1)/2) } else{ mcd <- if(method=="deterministic") CovMcd(x, nsamp="deterministic", trace=FALSE) else if(method=="exact") CovMcd(x, nsamp="exact", trace=FALSE) else if(method=="MRCD") CovMrcd(x, trace=FALSE) else CovMcd(x, trace=FALSE) quan <- as.integer(mcd@quan) } crit <- mcd@crit if(time){ xtime <- system.time(dorep(x, nrep, method))[1]/nrep xres <- sprintf("%3d %3d %3d %12.6f %10.3f\n", dim(x)[1], dim(x)[2], quan, crit, xtime) } else{ xres <- sprintf("%3d %3d %3d %12.6f\n", dim(x)[1], dim(x)[2], quan, crit) } lpad<-lname-nchar(xname) cat(pad.right(xname,lpad), xres) if(!short){ cat("Best subsample: \n") if(length(mcd@best) > 150) cat("Too long... \n") else print(mcd@best) ibad <- which(mcd@wt==0) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ",nbad,"\n") if(nbad > 0 & nbad < 150) print(ibad) else cat("Too many to print ... \n") if(full){ cat("-------------\n") show(mcd) } cat("--------------------------------------------------------\n") } } options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed lname <- 20 ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) method <- match.arg(method) if(method == "MASS") library(MASS) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(fish) data(pottery) data(rice) data(un86) data(wages) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p Half LOG(obj) Time\n") cat("========================================================\n") if(method=="exact") { ## only small data sets doest(heart[, 1:2], data(heart), nrep) doest(starsCYG, data(starsCYG), nrep) doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) doest(data.matrix(subset(wood, select = -y)), data(wood), nrep) doest(brain, "Animals", nrep) doest(lactic, data(lactic), nrep) doest(pension, data(pension), nrep) doest(data.matrix(subset(vaso, select = -Y)), data(vaso), nrep) doest(stack.x, data(stackloss), nrep) doest(pilot, data(pilot), nrep) } else { doest(heart[, 1:2], data(heart), nrep) doest(starsCYG, data(starsCYG), nrep) doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) doest(stack.x, data(stackloss), nrep) doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) doest(data.matrix(subset(wood, select = -y)), data(wood), nrep) doest(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) doest(brain, "Animals", nrep) ## doest(milk, data(milk), nrep) # difference between 386 and x64 doest(bushfire, data(bushfire), nrep) doest(lactic, data(lactic), nrep) doest(pension, data(pension), nrep) ## doest(pilot, data(pilot), nrep) # difference between 386 and x64 if(method != "MRCD") # these two are quite slow for MRCD, especially the second one { doest(radarImage, data(radarImage), nrep) doest(NOxEmissions, data(NOxEmissions), nrep) } doest(data.matrix(subset(vaso, select = -Y)), data(vaso), nrep) doest(data.matrix(subset(wagnerGrowth, select = -Period)), data(wagnerGrowth), nrep) doest(data.matrix(subset(fish, select = -Species)), data(fish), nrep) doest(data.matrix(subset(pottery, select = -origin)), data(pottery), nrep) doest(rice, data(rice), nrep) doest(un86, data(un86), nrep) doest(wages, data(wages), nrep) ## from package 'datasets' doest(airquality[,1:4], data(airquality), nrep) doest(attitude, data(attitude), nrep) doest(attenu, data(attenu), nrep) doest(USJudgeRatings, data(USJudgeRatings), nrep) doest(USArrests, data(USArrests), nrep) doest(longley, data(longley), nrep) doest(Loblolly, data(Loblolly), nrep) doest(quakes[,1:4], data(quakes), nrep) } cat("========================================================\n") } dogen <- function(nrep=1, eps=0.49, method=c("FASTMCD", "MASS")){ doest <- function(x, nrep=1){ gc() xtime <- system.time(dorep(x, nrep, method))[1]/nrep cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) xtime } set.seed(1234) ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) method <- match.arg(method) ap <- c(2, 5, 10, 20, 30) an <- c(100, 500, 1000, 10000, 50000) tottime <- 0 cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- an[i] p <- ap[j] if(5*p <= n){ xx <- gendata(n, p, eps) X <- xx$X tottime <- tottime + doest(X, nrep) } } } cat("=====================\n") cat("Total time: ", tottime*nrep, "\n") } docheck <- function(n, p, eps){ xx <- gendata(n,p,eps) mcd <- CovMcd(xx$X) check(mcd, xx$xind) } check <- function(mcd, xind){ ## check if mcd is robust w.r.t xind, i.e. check how many of xind ## did not get zero weight mymatch <- xind %in% which(mcd@wt == 0) length(xind) - length(which(mymatch)) } dorep <- function(x, nrep=1, method=c("FASTMCD","MASS", "deterministic", "exact", "MRCD")){ method <- match.arg(method) for(i in 1:nrep) if(method == "MASS") cov.mcd(x) else { if(method=="deterministic") CovMcd(x, nsamp="deterministic", trace=FALSE) else if(method=="exact") CovMcd(x, nsamp="exact", trace=FALSE) else if(method=="MRCD") CovMrcd(x, trace=FALSE) else CovMcd(x, trace=FALSE) } } #### gendata() #### # Generates a location contaminated multivariate # normal sample of n observations in p dimensions # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) # where # m = (b,b,...,b) # Defaults: eps=0 and b=10 # gendata <- function(n,p,eps=0,b=10){ if(missing(n) || missing(p)) stop("Please specify (n,p)") if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) nbad <- as.integer(eps * n) if(nbad > 0){ Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) xind <- sample(n,nbad) X[xind,] <- Xbad } list(X=X, xind=xind) } pad.right <- function(z, pads) { ### Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } whatis<-function(x){ if(is.data.frame(x)) cat("Type: data.frame\n") else if(is.matrix(x)) cat("Type: matrix\n") else if(is.vector(x)) cat("Type: vector\n") else cat("Type: don't know\n") } ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) dodata() dodata(method="deterministic") dodata(method="exact") dodata(method="MRCD") ##doexactfit() rrcov/tests/tqda.Rout.save0000644000176200001440000006771112763517421015334 0ustar liggesusers R Under development (unstable) (2013-08-17 r63608) -- "Unsuffered Consequences" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > dodata <- function(method) { + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + cat("===================================================\n") + + data(hemophilia); show(QdaCov(as.factor(gr)~., data=hemophilia, method=method)) + data(anorexia, package="MASS"); show(QdaCov(Treat~., data=anorexia, method=method)) + data(Pima.tr, package="MASS"); show(QdaCov(type~., data=Pima.tr, method=method)) + data(iris); # show(QdaCov(Species~., data=iris, method=method)) + data(crabs, package="MASS"); # show(QdaCov(sp~., data=crabs, method=method)) + + show(QdaClassic(as.factor(gr)~., data=hemophilia)) + show(QdaClassic(Treat~., data=anorexia)) + show(QdaClassic(type~., data=Pima.tr)) + show(QdaClassic(Species~., data=iris)) + ## show(QdaClassic(sp~., data=crabs)) + cat("===================================================\n") + } > > > ## -- now do it: > dodata(method="mcd") Call: dodata(method = "mcd") =================================================== Call: QdaCov(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.12920 -0.0603000 Group: carrier AHFactivity AHFantigen AHFactivity 0.023784 0.015376 AHFantigen 0.015376 0.024035 Group: normal AHFactivity AHFantigen AHFactivity 0.0093528 0.0069246 AHFantigen 0.0069246 0.0138008 Call: QdaCov(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.633 82.950 Cont 81.558 81.108 FT 84.331 94.762 Group: CBT Prewt Postwt Prewt 21.919 19.240 Postwt 19.240 26.427 Group: Cont Prewt Postwt Prewt 32.5705 -4.3705 Postwt -4.3705 22.5079 Group: FT Prewt Postwt Prewt 53.947 17.649 Postwt 17.649 23.280 Call: QdaCov(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 1.8602 107.69 67.344 25.29 30.642 0.40777 24.667 Yes 5.3167 145.85 74.283 31.80 34.095 0.49533 37.883 Group: No npreg glu bp skin bmi ped age npreg 2.941754 -0.24702 2.46922 -0.58819 0.228424 -0.090506 3.48775 glu -0.247021 624.74739 59.94791 11.85454 40.585329 -0.842007 4.63665 bp 2.469220 59.94791 145.76207 34.57040 19.162480 -0.278565 17.52081 skin -0.588185 11.85454 34.57040 156.62803 69.256954 -0.396617 11.46341 bmi 0.228424 40.58533 19.16248 69.25695 57.344837 0.010574 8.94607 ped -0.090506 -0.84201 -0.27857 -0.39662 0.010574 0.077809 -0.24735 age 3.487748 4.63665 17.52081 11.46341 8.946075 -0.247348 16.01287 Group: Yes npreg glu bp skin bmi ped age npreg 19.919555 -15.31143 10.06920 5.013071 1.991884 0.088597 30.0019 glu -15.311430 1022.67603 61.62896 31.175834 11.985146 0.103272 43.4043 bp 10.069198 61.62896 144.84493 38.033578 11.259873 0.221026 36.7223 skin 5.013071 31.17583 38.03358 113.490113 33.762220 0.072143 4.0053 bmi 1.991884 11.98515 11.25987 33.762220 25.106101 0.094019 -7.4029 ped 0.088597 0.10327 0.22103 0.072143 0.094019 0.074292 0.1248 age 30.001919 43.40427 36.72231 4.005332 -7.402926 0.124800 160.1318 Call: QdaClassic(as.factor(gr) ~ ., data = hemophilia) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.13487 -0.0778567 Group: carrier AHFactivity AHFantigen AHFactivity 0.023784 0.015376 AHFantigen 0.015376 0.024035 Group: normal AHFactivity AHFantigen AHFactivity 0.020897 0.015515 AHFantigen 0.015515 0.017920 Call: QdaClassic(Treat ~ ., data = anorexia) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.690 85.697 Cont 81.558 81.108 FT 83.229 90.494 Group: CBT Prewt Postwt Prewt 23.479 19.910 Postwt 19.910 69.755 Group: Cont Prewt Postwt Prewt 32.5705 -4.3705 Postwt -4.3705 22.5079 Group: FT Prewt Postwt Prewt 25.167 22.883 Postwt 22.883 71.827 Call: QdaClassic(type ~ ., data = Pima.tr) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.9167 113.11 69.545 27.205 31.074 0.41548 29.235 Yes 4.8382 145.06 74.588 33.118 34.709 0.54866 37.691 Group: No npreg glu bp skin bmi ped age npreg 7.878499 10.77226 8.190840 2.910305 -0.035751 -0.207341 16.82888 glu 10.772265 709.56118 81.430257 13.237682 19.037867 -0.518609 59.01307 bp 8.190840 81.43026 122.845246 33.879944 16.612630 -0.077183 46.78695 skin 2.910305 13.23768 33.879944 119.446391 50.125920 0.074282 18.47068 bmi -0.035751 19.03787 16.612630 50.125920 40.722996 0.145242 6.99999 ped -0.207341 -0.51861 -0.077183 0.074282 0.145242 0.071388 -0.53814 age 16.828880 59.01307 46.786954 18.470680 6.999988 -0.538138 91.08183 Group: Yes npreg glu bp skin bmi ped age npreg 15.77941 -8.199298 6.42493 -0.51800 -1.03288 -0.133011 21.93437 glu -8.19930 907.250219 23.71115 87.51536 9.98156 -0.082159 58.12291 bp 6.42493 23.711150 134.18613 19.70588 5.15891 -0.795470 26.30378 skin -0.51800 87.515364 19.70588 151.32924 28.28551 0.347951 26.67867 bmi -1.03288 9.981563 5.15891 28.28551 23.14529 0.457694 -7.91216 ped -0.13301 -0.082159 -0.79547 0.34795 0.45769 0.128883 -0.41737 age 21.93437 58.122915 26.30378 26.67867 -7.91216 -0.417375 131.79873 Call: QdaClassic(Species ~ ., data = iris) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 Group: setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.124249 0.099216 0.0163551 0.0103306 Sepal.Width 0.099216 0.143690 0.0116980 0.0092980 Petal.Length 0.016355 0.011698 0.0301592 0.0060694 Petal.Width 0.010331 0.009298 0.0060694 0.0111061 Group: versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.266433 0.085184 0.182898 0.055780 Sepal.Width 0.085184 0.098469 0.082653 0.041204 Petal.Length 0.182898 0.082653 0.220816 0.073102 Petal.Width 0.055780 0.041204 0.073102 0.039106 Group: virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.404343 0.093763 0.303290 0.049094 Sepal.Width 0.093763 0.104004 0.071380 0.047629 Petal.Length 0.303290 0.071380 0.304588 0.048824 Petal.Width 0.049094 0.047629 0.048824 0.075433 =================================================== > dodata(method="m") Call: dodata(method = "m") =================================================== Call: QdaCov(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.29810 -0.0028222 normal -0.13081 -0.0675283 Group: carrier AHFactivity AHFantigen AHFactivity 0.026018 0.017653 AHFantigen 0.017653 0.030128 Group: normal AHFactivity AHFantigen AHFactivity 0.0081933 0.0065737 AHFantigen 0.0065737 0.0118565 Call: QdaCov(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.436 82.631 Cont 81.559 80.272 FT 85.120 94.657 Group: CBT Prewt Postwt Prewt 23.630 25.128 Postwt 25.128 38.142 Group: Cont Prewt Postwt Prewt 35.8824 -8.2405 Postwt -8.2405 23.7416 Group: FT Prewt Postwt Prewt 33.805 18.206 Postwt 18.206 24.639 Call: QdaCov(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.5225 111.26 68.081 26.640 30.801 0.40452 26.306 Yes 5.0702 144.32 75.088 31.982 34.267 0.47004 37.140 Group: No npreg glu bp skin bmi ped age npreg 5.74219 14.47051 6.63766 4.98559 0.826570 -0.128106 10.71303 glu 14.47051 591.08717 68.81219 44.73311 40.658393 -0.545716 38.01918 bp 6.63766 68.81219 121.02716 30.46466 16.789801 -0.320065 25.29371 skin 4.98559 44.73311 30.46466 136.52176 56.604475 -0.250711 19.73259 bmi 0.82657 40.65839 16.78980 56.60447 47.859747 0.046358 6.94523 ped -0.12811 -0.54572 -0.32006 -0.25071 0.046358 0.061485 -0.34653 age 10.71303 38.01918 25.29371 19.73259 6.945227 -0.346527 35.66101 Group: Yes npreg glu bp skin bmi ped age npreg 15.98861 -1.2430 10.48556 9.05947 2.425316 0.162453 30.149872 glu -1.24304 867.1076 46.43838 25.92297 5.517382 1.044360 31.152650 bp 10.48556 46.4384 130.12536 17.21407 6.343942 -0.235121 41.091494 skin 9.05947 25.9230 17.21407 85.96314 26.089017 0.170061 14.562516 bmi 2.42532 5.5174 6.34394 26.08902 22.051976 0.097786 -5.297971 ped 0.16245 1.0444 -0.23512 0.17006 0.097786 0.057112 0.055286 age 30.14987 31.1527 41.09149 14.56252 -5.297971 0.055286 137.440921 Call: QdaClassic(as.factor(gr) ~ ., data = hemophilia) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.13487 -0.0778567 Group: carrier AHFactivity AHFantigen AHFactivity 0.023784 0.015376 AHFantigen 0.015376 0.024035 Group: normal AHFactivity AHFantigen AHFactivity 0.020897 0.015515 AHFantigen 0.015515 0.017920 Call: QdaClassic(Treat ~ ., data = anorexia) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.690 85.697 Cont 81.558 81.108 FT 83.229 90.494 Group: CBT Prewt Postwt Prewt 23.479 19.910 Postwt 19.910 69.755 Group: Cont Prewt Postwt Prewt 32.5705 -4.3705 Postwt -4.3705 22.5079 Group: FT Prewt Postwt Prewt 25.167 22.883 Postwt 22.883 71.827 Call: QdaClassic(type ~ ., data = Pima.tr) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.9167 113.11 69.545 27.205 31.074 0.41548 29.235 Yes 4.8382 145.06 74.588 33.118 34.709 0.54866 37.691 Group: No npreg glu bp skin bmi ped age npreg 7.878499 10.77226 8.190840 2.910305 -0.035751 -0.207341 16.82888 glu 10.772265 709.56118 81.430257 13.237682 19.037867 -0.518609 59.01307 bp 8.190840 81.43026 122.845246 33.879944 16.612630 -0.077183 46.78695 skin 2.910305 13.23768 33.879944 119.446391 50.125920 0.074282 18.47068 bmi -0.035751 19.03787 16.612630 50.125920 40.722996 0.145242 6.99999 ped -0.207341 -0.51861 -0.077183 0.074282 0.145242 0.071388 -0.53814 age 16.828880 59.01307 46.786954 18.470680 6.999988 -0.538138 91.08183 Group: Yes npreg glu bp skin bmi ped age npreg 15.77941 -8.199298 6.42493 -0.51800 -1.03288 -0.133011 21.93437 glu -8.19930 907.250219 23.71115 87.51536 9.98156 -0.082159 58.12291 bp 6.42493 23.711150 134.18613 19.70588 5.15891 -0.795470 26.30378 skin -0.51800 87.515364 19.70588 151.32924 28.28551 0.347951 26.67867 bmi -1.03288 9.981563 5.15891 28.28551 23.14529 0.457694 -7.91216 ped -0.13301 -0.082159 -0.79547 0.34795 0.45769 0.128883 -0.41737 age 21.93437 58.122915 26.30378 26.67867 -7.91216 -0.417375 131.79873 Call: QdaClassic(Species ~ ., data = iris) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 Group: setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.124249 0.099216 0.0163551 0.0103306 Sepal.Width 0.099216 0.143690 0.0116980 0.0092980 Petal.Length 0.016355 0.011698 0.0301592 0.0060694 Petal.Width 0.010331 0.009298 0.0060694 0.0111061 Group: versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.266433 0.085184 0.182898 0.055780 Sepal.Width 0.085184 0.098469 0.082653 0.041204 Petal.Length 0.182898 0.082653 0.220816 0.073102 Petal.Width 0.055780 0.041204 0.073102 0.039106 Group: virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.404343 0.093763 0.303290 0.049094 Sepal.Width 0.093763 0.104004 0.071380 0.047629 Petal.Length 0.303290 0.071380 0.304588 0.048824 Petal.Width 0.049094 0.047629 0.048824 0.075433 =================================================== > dodata(method="ogk") Call: dodata(method = "ogk") =================================================== Call: QdaCov(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.29324 0.00033953 normal -0.12744 -0.06628182 Group: carrier AHFactivity AHFantigen AHFactivity 0.019260 0.013026 AHFantigen 0.013026 0.021889 Group: normal AHFactivity AHFantigen AHFactivity 0.0049651 0.0039707 AHFantigen 0.0039707 0.0066084 Call: QdaCov(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.587 82.709 Cont 81.558 81.108 FT 85.110 94.470 Group: CBT Prewt Postwt Prewt 10.452 15.115 Postwt 15.115 37.085 Group: Cont Prewt Postwt Prewt 31.3178 -4.2024 Postwt -4.2024 21.6422 Group: FT Prewt Postwt Prewt 5.5309 1.4813 Postwt 1.4813 7.5501 Call: QdaCov(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.4286 110.35 67.495 25.905 30.275 0.39587 26.248 Yes 5.1964 142.71 75.357 32.732 34.809 0.48823 37.607 Group: No npreg glu bp skin bmi ped age npreg 3.97823 8.70612 4.58776 4.16463 0.250612 -0.117238 8.21769 glu 8.70612 448.91392 51.71120 38.66213 21.816345 -0.296524 24.29370 bp 4.58776 51.71120 99.41188 24.27574 10.491311 -0.290753 20.02975 skin 4.16463 38.66213 24.27574 98.61950 41.682404 -0.335213 16.60454 bmi 0.25061 21.81634 10.49131 41.68240 35.237101 -0.019774 5.12042 ped -0.11724 -0.29652 -0.29075 -0.33521 -0.019774 0.051431 -0.36275 age 8.21769 24.29370 20.02975 16.60454 5.120417 -0.362748 31.32916 Group: Yes npreg glu bp skin bmi ped age npreg 15.26499 6.30612 3.01913 3.76690 0.94825 0.12076 22.64860 glu 6.30612 688.16837 22.22704 12.81633 3.55791 0.68833 32.28061 bp 3.01913 22.22704 103.97959 9.95281 2.09860 0.45672 31.17602 skin 3.76690 12.81633 9.95281 67.51754 19.51489 0.59831 -2.35523 bmi 0.94825 3.55791 2.09860 19.51489 17.20331 0.24347 -6.88221 ped 0.12076 0.68833 0.45672 0.59831 0.24347 0.05933 0.43798 age 22.64860 32.28061 31.17602 -2.35523 -6.88221 0.43798 111.16709 Call: QdaClassic(as.factor(gr) ~ ., data = hemophilia) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.13487 -0.0778567 Group: carrier AHFactivity AHFantigen AHFactivity 0.023784 0.015376 AHFantigen 0.015376 0.024035 Group: normal AHFactivity AHFantigen AHFactivity 0.020897 0.015515 AHFantigen 0.015515 0.017920 Call: QdaClassic(Treat ~ ., data = anorexia) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.690 85.697 Cont 81.558 81.108 FT 83.229 90.494 Group: CBT Prewt Postwt Prewt 23.479 19.910 Postwt 19.910 69.755 Group: Cont Prewt Postwt Prewt 32.5705 -4.3705 Postwt -4.3705 22.5079 Group: FT Prewt Postwt Prewt 25.167 22.883 Postwt 22.883 71.827 Call: QdaClassic(type ~ ., data = Pima.tr) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.9167 113.11 69.545 27.205 31.074 0.41548 29.235 Yes 4.8382 145.06 74.588 33.118 34.709 0.54866 37.691 Group: No npreg glu bp skin bmi ped age npreg 7.878499 10.77226 8.190840 2.910305 -0.035751 -0.207341 16.82888 glu 10.772265 709.56118 81.430257 13.237682 19.037867 -0.518609 59.01307 bp 8.190840 81.43026 122.845246 33.879944 16.612630 -0.077183 46.78695 skin 2.910305 13.23768 33.879944 119.446391 50.125920 0.074282 18.47068 bmi -0.035751 19.03787 16.612630 50.125920 40.722996 0.145242 6.99999 ped -0.207341 -0.51861 -0.077183 0.074282 0.145242 0.071388 -0.53814 age 16.828880 59.01307 46.786954 18.470680 6.999988 -0.538138 91.08183 Group: Yes npreg glu bp skin bmi ped age npreg 15.77941 -8.199298 6.42493 -0.51800 -1.03288 -0.133011 21.93437 glu -8.19930 907.250219 23.71115 87.51536 9.98156 -0.082159 58.12291 bp 6.42493 23.711150 134.18613 19.70588 5.15891 -0.795470 26.30378 skin -0.51800 87.515364 19.70588 151.32924 28.28551 0.347951 26.67867 bmi -1.03288 9.981563 5.15891 28.28551 23.14529 0.457694 -7.91216 ped -0.13301 -0.082159 -0.79547 0.34795 0.45769 0.128883 -0.41737 age 21.93437 58.122915 26.30378 26.67867 -7.91216 -0.417375 131.79873 Call: QdaClassic(Species ~ ., data = iris) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 Group: setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.124249 0.099216 0.0163551 0.0103306 Sepal.Width 0.099216 0.143690 0.0116980 0.0092980 Petal.Length 0.016355 0.011698 0.0301592 0.0060694 Petal.Width 0.010331 0.009298 0.0060694 0.0111061 Group: versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.266433 0.085184 0.182898 0.055780 Sepal.Width 0.085184 0.098469 0.082653 0.041204 Petal.Length 0.182898 0.082653 0.220816 0.073102 Petal.Width 0.055780 0.041204 0.073102 0.039106 Group: virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.404343 0.093763 0.303290 0.049094 Sepal.Width 0.093763 0.104004 0.071380 0.047629 Petal.Length 0.303290 0.071380 0.304588 0.048824 Petal.Width 0.049094 0.047629 0.048824 0.075433 =================================================== > dodata(method="sde") Call: dodata(method = "sde") =================================================== Call: QdaCov(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.29834 -0.0032286 normal -0.12944 -0.0676930 Group: carrier AHFactivity AHFantigen AHFactivity 0.025398 0.017810 AHFantigen 0.017810 0.030639 Group: normal AHFactivity AHFantigen AHFactivity 0.0083435 0.0067686 AHFantigen 0.0067686 0.0119565 Call: QdaCov(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.949 83.323 Cont 81.484 80.840 FT 84.596 93.835 Group: CBT Prewt Postwt Prewt 22.283 17.084 Postwt 17.084 25.308 Group: Cont Prewt Postwt Prewt 37.1864 -8.8896 Postwt -8.8896 31.1930 Group: FT Prewt Postwt Prewt 20.7108 3.1531 Postwt 3.1531 25.7046 Call: QdaCov(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.2567 109.91 67.538 25.484 30.355 0.38618 25.628 Yes 5.2216 141.64 75.048 32.349 34.387 0.47742 37.634 Group: No npreg glu bp skin bmi ped age npreg 4.396832 10.20629 5.43346 4.38313 7.9891e-01 -0.09389257 7.45638 glu 10.206286 601.12211 56.62047 49.67071 3.3829e+01 -0.31896741 31.64508 bp 5.433462 56.62047 120.38052 34.38984 1.4817e+01 -0.21784446 26.44853 skin 4.383134 49.67071 34.38984 136.94931 6.1576e+01 -0.47532490 17.74141 bmi 0.798908 33.82928 14.81668 61.57578 5.1441e+01 0.00061983 8.56856 ped -0.093893 -0.31897 -0.21784 -0.47532 6.1983e-04 0.06012655 -0.26872 age 7.456376 31.64508 26.44853 17.74141 8.5686e+00 -0.26872005 29.93856 Group: Yes npreg glu bp skin bmi ped age npreg 15.91978 7.7491 7.24229 10.46802 5.40627 0.320434 25.88314 glu 7.74907 856.4955 58.59554 29.65331 11.44745 1.388745 38.24430 bp 7.24229 58.5955 89.66288 21.36597 6.46859 0.764486 36.30462 skin 10.46802 29.6533 21.36597 86.79253 26.22071 0.620654 5.28665 bmi 5.40627 11.4475 6.46859 26.22071 20.12351 0.211701 0.71583 ped 0.32043 1.3887 0.76449 0.62065 0.21170 0.062727 0.93743 age 25.88314 38.2443 36.30462 5.28665 0.71583 0.937430 136.24335 Call: QdaClassic(as.factor(gr) ~ ., data = hemophilia) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.13487 -0.0778567 Group: carrier AHFactivity AHFantigen AHFactivity 0.023784 0.015376 AHFantigen 0.015376 0.024035 Group: normal AHFactivity AHFantigen AHFactivity 0.020897 0.015515 AHFantigen 0.015515 0.017920 Call: QdaClassic(Treat ~ ., data = anorexia) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.690 85.697 Cont 81.558 81.108 FT 83.229 90.494 Group: CBT Prewt Postwt Prewt 23.479 19.910 Postwt 19.910 69.755 Group: Cont Prewt Postwt Prewt 32.5705 -4.3705 Postwt -4.3705 22.5079 Group: FT Prewt Postwt Prewt 25.167 22.883 Postwt 22.883 71.827 Call: QdaClassic(type ~ ., data = Pima.tr) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.9167 113.11 69.545 27.205 31.074 0.41548 29.235 Yes 4.8382 145.06 74.588 33.118 34.709 0.54866 37.691 Group: No npreg glu bp skin bmi ped age npreg 7.878499 10.77226 8.190840 2.910305 -0.035751 -0.207341 16.82888 glu 10.772265 709.56118 81.430257 13.237682 19.037867 -0.518609 59.01307 bp 8.190840 81.43026 122.845246 33.879944 16.612630 -0.077183 46.78695 skin 2.910305 13.23768 33.879944 119.446391 50.125920 0.074282 18.47068 bmi -0.035751 19.03787 16.612630 50.125920 40.722996 0.145242 6.99999 ped -0.207341 -0.51861 -0.077183 0.074282 0.145242 0.071388 -0.53814 age 16.828880 59.01307 46.786954 18.470680 6.999988 -0.538138 91.08183 Group: Yes npreg glu bp skin bmi ped age npreg 15.77941 -8.199298 6.42493 -0.51800 -1.03288 -0.133011 21.93437 glu -8.19930 907.250219 23.71115 87.51536 9.98156 -0.082159 58.12291 bp 6.42493 23.711150 134.18613 19.70588 5.15891 -0.795470 26.30378 skin -0.51800 87.515364 19.70588 151.32924 28.28551 0.347951 26.67867 bmi -1.03288 9.981563 5.15891 28.28551 23.14529 0.457694 -7.91216 ped -0.13301 -0.082159 -0.79547 0.34795 0.45769 0.128883 -0.41737 age 21.93437 58.122915 26.30378 26.67867 -7.91216 -0.417375 131.79873 Call: QdaClassic(Species ~ ., data = iris) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 Group: setosa Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.124249 0.099216 0.0163551 0.0103306 Sepal.Width 0.099216 0.143690 0.0116980 0.0092980 Petal.Length 0.016355 0.011698 0.0301592 0.0060694 Petal.Width 0.010331 0.009298 0.0060694 0.0111061 Group: versicolor Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.266433 0.085184 0.182898 0.055780 Sepal.Width 0.085184 0.098469 0.082653 0.041204 Petal.Length 0.182898 0.082653 0.220816 0.073102 Petal.Width 0.055780 0.041204 0.073102 0.039106 Group: virginica Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.404343 0.093763 0.303290 0.049094 Sepal.Width 0.093763 0.104004 0.071380 0.047629 Petal.Length 0.303290 0.071380 0.304588 0.048824 Petal.Width 0.049094 0.047629 0.048824 0.075433 =================================================== > > proc.time() user system elapsed 0.78 0.06 0.84 rrcov/tests/tmest4.R0000644000176200001440000001031712763517421014124 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) dodata <- function(nrep = 1, time = FALSE, full = TRUE) { domest <- function(x, xname, nrep = 1) { n <- dim(x)[1] p <- dim(x)[2] mm <- CovMest(x) crit <- log(mm@crit) ## c1 <- mm@psi@c1 ## M <- mm$psi@M xres <- sprintf("%3d %3d %12.6f\n", dim(x)[1], dim(x)[2], crit) lpad <- lname-nchar(xname) cat(pad.right(xname,lpad), xres) dist <- getDistance(mm) quantiel <- qchisq(0.975, p) ibad <- which(dist >= quantiel) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ",nbad,"\n") if(nbad > 0) print(ibad) cat("-------------\n") show(mm) cat("--------------------------------------------------------\n") } options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed lname <- 20 data(heart) data(starsCYG) data(phosphor) data(stackloss) data(coleman) data(salinity) data(wood) data(hbk) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(milk) data(bushfire) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p c1 M LOG(det) Time\n") cat("======================================================================\n") domest(heart[, 1:2], data(heart), nrep) domest(starsCYG, data(starsCYG), nrep) domest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) domest(stack.x, data(stackloss), nrep) domest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) domest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) domest(data.matrix(subset(wood, select = -y)), data(wood), nrep) domest(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep) domest(brain, "Animals", nrep) domest(milk, data(milk), nrep) domest(bushfire, data(bushfire), nrep) cat("======================================================================\n") } # generate contaminated data using the function gendata with different # number of outliers and check if the M-estimate breaks - i.e. the # largest eigenvalue is larger than e.g. 5. # For n=50 and p=10 and d=5 the M-estimate can break for number of # outliers grater than 20. dogen <- function(){ eig <- vector("numeric",26) for(i in 0:25) { gg <- gendata(eps=i) mm <- CovMest(gg$x, t0=gg$tgood, S0=gg$sgood, arp=0.001) eig[i+1] <- ev <- getEvals(mm)[1] # cat(i, ev, "\n") stopifnot(ev < 5 || i > 20) } # plot(0:25, eig, type="l", xlab="Number of outliers", ylab="Largest Eigenvalue") } # # generate data 50x10 as multivariate normal N(0,I) and add # eps % outliers by adding d=5.0 to each component. # - if eps <0 and eps <=0.5, the number of outliers is eps*n # - if eps >= 1, it is the number of outliers # - use the center and cov of the good data as good start # - use the center and the cov of all data as a bad start # If using a good start, the M-estimate must iterate to # the good solution: the largest eigenvalue is less then e.g. 5 # gendata <- function(n=50, p=10, eps=0, d=5.0){ if(eps < 0 || eps > 0.5 && eps < 1.0 || eps > 0.5*n) stop("eps is out of range") library(MASS) x <- mvrnorm(n, rep(0,p), diag(p)) bad <- vector("numeric") nbad = if(eps < 1) eps*n else eps if(nbad > 0){ bad <- sample(n, nbad) x[bad,] <- x[bad,] + d } cov1 <- cov.wt(x) cov2 <- if(nbad <= 0) cov1 else cov.wt(x[-bad,]) list(x=x, bad=sort(bad), tgood=cov2$center, sgood=cov2$cov, tbad=cov1$center, sbad=cov1$cov) } pad.right <- function(z, pads) { ## Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } ## -- now do it: dodata() dogen() #cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons'' rrcov/tests/tmve4.Rout.save0000644000176200001440000003754512763517421015444 0ustar liggesusers R Under development (unstable) (2013-08-17 r63608) -- "Unsuffered Consequences" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMVE","MASS")){ + ##@bdescr + ## Test the function covMve() on the literature datasets: + ## + ## Call covMve() for all regression datasets available in rrco/robustbasev and print: + ## - execution time (if time == TRUE) + ## - objective fucntion + ## - best subsample found (if short == false) + ## - outliers identified (with cutoff 0.975) (if short == false) + ## - estimated center and covarinance matrix if full == TRUE) + ## + ##@edescr + ## + ##@in nrep : [integer] number of repetitions to use for estimating the + ## (average) execution time + ##@in time : [boolean] whether to evaluate the execution time + ##@in short : [boolean] whether to do short output (i.e. only the + ## objective function value). If short == FALSE, + ## the best subsample and the identified outliers are + ## printed. See also the parameter full below + ##@in full : [boolean] whether to print the estimated cente and covariance matrix + ##@in method : [character] select a method: one of (FASTMCD, MASS) + + domve <- function(x, xname, nrep=1){ + n <- dim(x)[1] + p <- dim(x)[2] + alpha <- 0.5 + h <- h.alpha.n(alpha, n, p) + if(method == "MASS"){ + mve <- cov.mve(x, quantile.used=h) + quan <- h #default: floor((n+p+1)/2) + crit <- mve$crit + best <- mve$best + mah <- mahalanobis(x, mve$center, mve$cov) + quantiel <- qchisq(0.975, p) + wt <- as.numeric(mah < quantiel) + } + else{ + mve <- CovMve(x, trace=FALSE) + quan <- as.integer(mve@quan) + crit <- log(mve@crit) + best <- mve@best + wt <- mve@wt + } + + + if(time){ + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + xres <- sprintf("%3d %3d %3d %12.6f %10.3f\n", dim(x)[1], dim(x)[2], quan, crit, xtime) + } + else{ + xres <- sprintf("%3d %3d %3d %12.6f\n", dim(x)[1], dim(x)[2], quan, crit) + } + + lpad<-lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + if(!short){ + cat("Best subsample: \n") + print(best) + + ibad <- which(wt == 0) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ", nbad, "\n") + if(nbad > 0) + print(ibad) + if(full){ + cat("-------------\n") + show(mve) + } + cat("--------------------------------------------------------\n") + } + } + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + lname <- 20 + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + method <- match.arg(method) + if(method == "MASS") + library(MASS) + + + data(heart) + data(starsCYG) + data(phosphor) + data(stackloss) + data(coleman) + data(salinity) + data(wood) + + data(hbk) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + data(milk) + data(bushfire) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p Half LOG(obj) Time\n") + cat("========================================================\n") + domve(heart[, 1:2], data(heart), nrep) + domve(starsCYG, data(starsCYG), nrep) + domve(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + domve(stack.x, data(stackloss), nrep) + domve(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + domve(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + domve(data.matrix(subset(wood, select = -y)), data(wood), nrep) + domve(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) + + domve(brain, "Animals", nrep) + domve(milk, data(milk), nrep) + domve(bushfire, data(bushfire), nrep) + cat("========================================================\n") + } > > dogen <- function(nrep=1, eps=0.49, method=c("FASTMVE", "MASS")){ + + domve <- function(x, nrep=1){ + gc() + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) + xtime + } + + set.seed(1234) + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + library(MASS) + + method <- match.arg(method) + + ap <- c(2, 5, 10, 20, 30) + an <- c(100, 500, 1000, 10000, 50000) + + tottime <- 0 + cat(" n p Time\n") + cat("=====================\n") + for(i in 1:length(an)) { + for(j in 1:length(ap)) { + n <- an[i] + p <- ap[j] + if(5*p <= n){ + xx <- gendata(n, p, eps) + X <- xx$X + tottime <- tottime + domve(X, nrep) + } + } + } + + cat("=====================\n") + cat("Total time: ", tottime*nrep, "\n") + } > > docheck <- function(n, p, eps){ + xx <- gendata(n,p,eps) + mve <- CovMve(xx$X) + check(mve, xx$xind) + } > > check <- function(mcd, xind){ + ## check if mcd is robust w.r.t xind, i.e. check how many of xind + ## did not get zero weight + mymatch <- xind %in% which(mcd@wt == 0) + length(xind) - length(which(mymatch)) + } > > dorep <- function(x, nrep=1, method=c("FASTMVE","MASS")){ + + method <- match.arg(method) + for(i in 1:nrep) + if(method == "MASS") + cov.mve(x) + else + CovMve(x) + } > > #### gendata() #### > # Generates a location contaminated multivariate > # normal sample of n observations in p dimensions > # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) > # where > # m = (b,b,...,b) > # Defaults: eps=0 and b=10 > # > gendata <- function(n,p,eps=0,b=10){ + + if(missing(n) || missing(p)) + stop("Please specify (n,p)") + if(eps < 0 || eps >= 0.5) + stop(message="eps must be in [0,0.5)") + X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) + nbad <- as.integer(eps * n) + if(nbad > 0){ + Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) + xind <- sample(n,nbad) + X[xind,] <- Xbad + } + list(X=X, xind=xind) + } > > pad.right <- function(z, pads) + { + ### Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > whatis<-function(x){ + if(is.data.frame(x)) + cat("Type: data.frame\n") + else if(is.matrix(x)) + cat("Type: matrix\n") + else if(is.vector(x)) + cat("Type: vector\n") + else + cat("Type: don't know\n") + } > > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > dodata() Call: dodata() Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 7 3.827606 Best subsample: [1] 1 4 7 8 9 10 11 Outliers: 3 [1] 2 6 12 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: height weight 34.9 27.0 Robust Estimate of Covariance: height weight height 142 217 weight 217 350 -------------------------------------------------------- starsCYG 47 2 25 -2.742997 Best subsample: [1] 2 4 6 8 12 13 16 23 24 25 26 28 31 32 33 37 38 39 41 42 43 44 45 46 47 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: log.Te log.light 4.41 4.93 Robust Estimate of Covariance: log.Te log.light log.Te 0.0173 0.0578 log.light 0.0578 0.3615 -------------------------------------------------------- phosphor 18 2 10 4.443101 Best subsample: [1] 3 5 8 9 11 12 13 14 15 17 Outliers: 3 [1] 1 6 10 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: inorg organic 15.2 39.4 Robust Estimate of Covariance: inorg organic inorg 188 230 organic 230 339 -------------------------------------------------------- stackloss 21 3 12 3.327582 Best subsample: [1] 4 5 6 7 8 9 10 11 12 13 14 20 Outliers: 3 [1] 1 2 3 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 56.7 20.2 85.5 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 34.31 11.07 23.54 Water.Temp 11.07 9.23 7.85 Acid.Conc. 23.54 7.85 47.35 -------------------------------------------------------- coleman 20 5 13 2.065143 Best subsample: [1] 1 3 4 5 7 8 11 14 16 17 18 19 20 Outliers: 5 [1] 2 6 9 10 13 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.79 44.26 3.59 25.08 6.38 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2920 1.1188 2.0421 0.3487 0.0748 fatherWc 1.1188 996.7540 338.6587 7.1673 23.1783 sstatus 2.0421 338.6587 148.2501 4.4894 7.8135 teacherSc 0.3487 7.1673 4.4894 0.9082 0.3204 motherLev 0.0748 23.1783 7.8135 0.3204 0.6024 -------------------------------------------------------- salinity 28 3 16 2.002555 Best subsample: [1] 1 7 8 9 12 13 14 18 19 20 21 22 25 26 27 28 Outliers: 5 [1] 5 11 16 23 24 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: X1 X2 X3 10.2 3.1 22.4 Robust Estimate of Covariance: X1 X2 X3 X1 14.387 1.153 -4.072 X2 1.153 5.005 -0.954 X3 -4.072 -0.954 2.222 -------------------------------------------------------- wood 20 5 13 -5.471407 Best subsample: [1] 1 2 3 5 9 10 12 13 14 15 17 18 20 Outliers: 5 [1] 4 6 8 11 19 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: x1 x2 x3 x4 x5 0.576 0.123 0.531 0.538 0.889 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 7.45e-03 1.11e-03 1.83e-03 -2.90e-05 -5.65e-04 x2 1.11e-03 3.11e-04 7.68e-04 3.37e-05 3.85e-05 x3 1.83e-03 7.68e-04 4.30e-03 -9.96e-04 -6.27e-05 x4 -2.90e-05 3.37e-05 -9.96e-04 3.02e-03 1.91e-03 x5 -5.65e-04 3.85e-05 -6.27e-05 1.91e-03 2.25e-03 -------------------------------------------------------- hbk 75 3 39 1.096831 Best subsample: [1] 15 17 18 19 20 21 24 27 28 30 32 33 35 36 40 41 42 43 44 46 48 49 50 53 54 [26] 55 56 58 59 64 65 66 67 70 71 72 73 74 75 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: X1 X2 X3 1.48 1.86 1.73 Robust Estimate of Covariance: X1 X2 X3 X1 1.695 0.230 0.265 X2 0.230 1.679 0.119 X3 0.265 0.119 1.683 -------------------------------------------------------- Animals 28 2 15 8.945423 Best subsample: [1] 1 3 4 5 10 11 17 18 21 22 23 24 26 27 28 Outliers: 9 [1] 2 6 7 9 12 14 15 16 25 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: body brain 48.3 127.3 Robust Estimate of Covariance: body brain body 10767 16872 brain 16872 46918 -------------------------------------------------------- milk 86 8 47 -1.160085 Best subsample: [1] 4 5 7 8 9 10 11 19 21 22 23 24 26 30 31 33 34 35 36 37 38 39 42 43 45 [26] 46 54 56 57 59 60 61 62 63 64 65 66 67 69 72 76 78 79 81 82 83 85 Outliers: 18 [1] 1 2 3 12 13 14 15 16 17 18 20 27 41 44 47 70 74 75 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.91 33.02 26.08 25.06 24.99 122.93 14.38 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 6.00e-07 1.51e-04 3.34e-04 3.09e-04 2.82e-04 2.77e-04 1.09e-03 X2 1.51e-04 2.03e+00 3.83e-01 3.04e-01 2.20e-01 3.51e-01 2.18e+00 X3 3.34e-04 3.83e-01 1.58e+00 1.21e+00 1.18e+00 1.20e+00 1.60e+00 X4 3.09e-04 3.04e-01 1.21e+00 9.82e-01 9.39e-01 9.53e-01 1.36e+00 X5 2.82e-04 2.20e-01 1.18e+00 9.39e-01 9.67e-01 9.52e-01 1.34e+00 X6 2.77e-04 3.51e-01 1.20e+00 9.53e-01 9.52e-01 9.92e-01 1.38e+00 X7 1.09e-03 2.18e+00 1.60e+00 1.36e+00 1.34e+00 1.38e+00 6.73e+00 X8 3.33e-05 2.92e-01 2.65e-01 1.83e-01 1.65e-01 1.76e-01 5.64e-01 X8 X1 3.33e-05 X2 2.92e-01 X3 2.65e-01 X4 1.83e-01 X5 1.65e-01 X6 1.76e-01 X7 5.64e-01 X8 1.80e-01 -------------------------------------------------------- bushfire 38 5 22 5.644315 Best subsample: [1] 1 2 3 4 5 6 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Outliers: 15 [1] 7 8 9 10 11 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovMve(x = x, trace = FALSE) -> Method: Minimum volume ellipsoid estimator Robust Estimate of Location: V1 V2 V3 V4 V5 107 147 263 215 277 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 519 375 -2799 -619 -509 V2 375 320 -1671 -342 -289 V3 -2799 -1671 18373 4314 3480 V4 -619 -342 4314 1076 854 V5 -509 -289 3480 854 683 -------------------------------------------------------- ======================================================== > > proc.time() user system elapsed 0.48 0.07 0.56 rrcov/tests/thubert.R0000644000176200001440000002042613373055130014353 0ustar liggesusersdodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method=c("hubert", "hubert.mcd", "locantore", "cov", "classic")){ ## Test the function PcaHubert() on the literature datasets: ## ## Call PcaHubert() for all regression datasets available in ## robustbase/rrcov and print: ## - execution time (if time == TRUE) ## - loadings ## - eigenvalues ## - scores ## dopca <- function(x, xname, nrep=1){ n <- dim(x)[1] p <- dim(x)[2] if(method == "hubert.mcd") pca <- PcaHubert(x, k=p) else if(method == "hubert") pca <- PcaHubert(x, mcd=FALSE) else if(method == "locantore") pca <- PcaLocantore(x) else if(method == "cov") pca <- PcaCov(x) else if(method == "classic") pca <- PcaClassic(x) else stop("Undefined PCA method: ", method) e1 <- getEigenvalues(pca)[1] e2 <- getEigenvalues(pca)[2] k <- pca@k if(time){ xtime <- system.time(dorep(x, nrep, method))[1]/nrep xres <- sprintf("%3d %3d %3d %12.6f %12.6f %10.3f\n", dim(x)[1], dim(x)[2], k, e1, e2, xtime) } else{ xres <- sprintf("%3d %3d %3d %12.6f %12.6f\n", dim(x)[1], dim(x)[2], k, e1, e2) } lpad<-lname-nchar(xname) cat(pad.right(xname, lpad), xres) if(!short){ cat("Scores: \n") print(getScores(pca)) if(full){ cat("-------------\n") show(pca) } cat("----------------------------------------------------------\n") } } stopifnot(length(nrep) == 1, nrep >= 1) method <- match.arg(method) options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed lname <- 20 ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p k e1 e2\n") cat("==========================================================\n") dopca(heart[, 1:2], data(heart), nrep) dopca(starsCYG, data(starsCYG), nrep) dopca(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) dopca(stack.x, data(stackloss), nrep) ## dopca(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) # differences between the architectures dopca(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) ## dopca(data.matrix(subset(wood, select = -y)), data(wood), nrep) # differences between the architectures dopca(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) ## dopca(brain, "Animals", nrep) dopca(milk, data(milk), nrep) dopca(bushfire, data(bushfire), nrep) cat("==========================================================\n") } dogen <- function(nrep=1, eps=0.49, method=c("hubert", "hubert.mcd", "locantore", "cov")){ dopca <- function(x, nrep=1){ gc() xtime <- system.time(dorep(x, nrep, method))[1]/nrep cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) xtime } set.seed(1234) ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) method <- match.arg(method) ap <- c(2, 5, 10, 20, 30) an <- c(100, 500, 1000, 10000, 50000) tottime <- 0 cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- an[i] p <- ap[j] if(5*p <= n){ xx <- gendata(n, p, eps) X <- xx$X ## print(dimnames(X)) tottime <- tottime + dopca(X, nrep) } } } cat("=====================\n") cat("Total time: ", tottime*nrep, "\n") } dorep <- function(x, nrep=1, method=c("hubert", "hubert.mcd", "locantore", "cov")){ method <- match.arg(method) for(i in 1:nrep) if(method == "hubert.mcd") PcaHubert(x) else if(method == "hubert") PcaHubert(x, mcd=FALSE) else if(method == "locantore") PcaLocantore(x) else if(method == "cov") PcaCov(x) else stop("Undefined PCA method: ", method) } #### gendata() #### # Generates a location contaminated multivariate # normal sample of n observations in p dimensions # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) # where # m = (b,b,...,b) # Defaults: eps=0 and b=10 # gendata <- function(n,p,eps=0,b=10){ if(missing(n) || missing(p)) stop("Please specify (n,p)") if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) nbad <- as.integer(eps * n) xind <- vector("numeric") if(nbad > 0){ Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) xind <- sample(n,nbad) X[xind,] <- Xbad } list(X=X, xind=xind) } pad.right <- function(z, pads) { ### Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } whatis<-function(x){ if(is.data.frame(x)) cat("Type: data.frame\n") else if(is.matrix(x)) cat("Type: matrix\n") else if(is.vector(x)) cat("Type: vector\n") else cat("Type: don't know\n") } ################################################################# ## VT::27.08.2010 ## bug report from Stephen Milborrow ## test.case.1 <- function() { X <- matrix(c( -0.79984, -1.00103, 0.899794, 0.00000, 0.34279, 0.52832, -1.303783, -1.17670, -0.79984, -1.00103, 0.899794, 0.00000, 0.34279, 0.52832, -1.303783, -1.17670, 0.34279, 0.52832, -1.303783, -1.17670, 1.48542, 0.66735, 0.716162, 1.17670, -0.79984, -1.00103, 0.899794, 0.00000, 1.69317, 1.91864, -0.018363, 1.76505, -1.00759, -0.16684, -0.385626, 0.58835, -0.79984, -1.00103, 0.899794, 0.00000), ncol=4, byrow=TRUE) cc1 <- PcaHubert(X, k=3) cc2 <- PcaLocantore(X, k=3) cc3 <- PcaCov(X, k=3, cov.control=CovControlSest()) cc4 <- PcaProj(X, k=2) # with k=3 will produce warnings in .distances - too small eignevalues cc5 <- PcaGrid(X, k=2) # dito list(cc1, cc2, cc3, cc4, cc5) } ################################################################# ## VT::05.08.2016 ## bug report from Matthieu Lesnoff ## test.case.2 <- function() { do.test.case.2 <- function(z) { if(missing(z)) { set.seed(12345678) n <- 5 z <- data.frame(v1 = rnorm(n), v2 = rnorm(n), v3 = rnorm(n)) z } fm <- PcaLocantore(z, k = 2, scale = TRUE) fm@scale apply(z, MARGIN = 2, FUN = mad) scale(z, center = fm@center, scale = fm@scale) T <- fm@scores P <- fm@loadings E <- scale(z, center = fm@center, scale = fm@scale) - T %*% t(P) d2 <- apply(E^2, MARGIN = 1, FUN = sum) ## print(sqrt(d2)); print(fm@od) print(ret <- all.equal(sqrt(d2), fm@od)) ret } do.test.case.2() do.test.case.2(phosphor) do.test.case.2(stackloss) do.test.case.2(salinity) do.test.case.2(hbk) do.test.case.2(milk) do.test.case.2(bushfire) data(rice); do.test.case.2(rice) data(un86); do.test.case.2(un86) } ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) dodata(method="classic") dodata(method="hubert.mcd") dodata(method="hubert") ##dodata(method="locantore") ##dodata(method="cov") ## VT::14.11.2018 - commented out - on some platforms PcaHubert will hoose only 1 PC ## and will show difference ## test.case.1() test.case.2() rrcov/tests/tsde.R0000644000176200001440000001306212763517421013643 0ustar liggesusers## Test for singularity doexact <- function(){ exact <-function(){ n1 <- 45 p <- 2 x1 <- matrix(rnorm(p*n1),nrow=n1, ncol=p) x1[,p] <- x1[,p] + 3 ## library(MASS) ## x1 <- mvrnorm(n=n1, mu=c(0,3), Sigma=diag(1,nrow=p)) n2 <- 55 m1 <- 0 m2 <- 3 x2 <- cbind(rnorm(n2),rep(m2,n2)) x<-rbind(x1,x2) colnames(x) <- c("X1","X2") x } print(CovSde(exact())) } dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE){ domcd <- function(x, xname, nrep=1){ n <- dim(x)[1] p <- dim(x)[2] mcd<-CovSde(x) if(time){ xtime <- system.time(dorep(x, nrep))[1]/nrep xres <- sprintf("%3d %3d %3d\n", dim(x)[1], dim(x)[2], xtime) } else{ xres <- sprintf("%3d %3d\n", dim(x)[1], dim(x)[2]) } lpad<-lname-nchar(xname) cat(pad.right(xname,lpad), xres) if(!short){ ibad <- which(mcd@wt==0) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ",nbad,"\n") if(nbad > 0) print(ibad) if(full){ cat("-------------\n") show(mcd) } cat("--------------------------------------------------------\n") } } options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed lname <- 20 ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) data(heart) data(starsCYG) data(phosphor) data(stackloss) data(coleman) data(salinity) data(wood) data(hbk) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(milk) data(bushfire) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p Half LOG(obj) Time\n") cat("========================================================\n") domcd(heart[, 1:2], data(heart), nrep) domcd(starsCYG, data(starsCYG), nrep) domcd(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) domcd(stack.x, data(stackloss), nrep) domcd(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) domcd(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) domcd(data.matrix(subset(wood, select = -y)), data(wood), nrep) domcd(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) domcd(brain, "Animals", nrep) domcd(milk, data(milk), nrep) domcd(bushfire, data(bushfire), nrep) ## VT::19.07.2010: test the univariate SDE for(i in 1:ncol(bushfire)) domcd(bushfire[i], data(bushfire), nrep) cat("========================================================\n") } dogen <- function(nrep=1, eps=0.49){ library(MASS) domcd <- function(x, nrep=1){ gc() xtime <- system.time(dorep(x, nrep))[1]/nrep cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) xtime } set.seed(1234) ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) ap <- c(2, 5, 10, 20, 30) an <- c(100, 500, 1000, 10000, 50000) tottime <- 0 cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- an[i] p <- ap[j] if(5*p <= n){ xx <- gendata(n, p, eps) X <- xx$X tottime <- tottime + domcd(X, nrep) } } } cat("=====================\n") cat("Total time: ", tottime*nrep, "\n") } docheck <- function(n, p, eps){ xx <- gendata(n,p,eps) mcd <- CovSde(xx$X) check(mcd, xx$xind) } check <- function(mcd, xind){ ## check if mcd is robust w.r.t xind, i.e. check how many of xind ## did not get zero weight mymatch <- xind %in% which(mcd@wt == 0) length(xind) - length(which(mymatch)) } dorep <- function(x, nrep=1){ for(i in 1:nrep) CovSde(x) } #### gendata() #### # Generates a location contaminated multivariate # normal sample of n observations in p dimensions # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) # where # m = (b,b,...,b) # Defaults: eps=0 and b=10 # gendata <- function(n,p,eps=0,b=10){ if(missing(n) || missing(p)) stop("Please specify (n,p)") if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) nbad <- as.integer(eps * n) if(nbad > 0){ Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) xind <- sample(n,nbad) X[xind,] <- Xbad } list(X=X, xind=xind) } pad.right <- function(z, pads) { ### Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } whatis<-function(x){ if(is.data.frame(x)) cat("Type: data.frame\n") else if(is.matrix(x)) cat("Type: matrix\n") else if(is.vector(x)) cat("Type: vector\n") else cat("Type: don't know\n") } ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) dodata() ##doexact() rrcov/tests/tsde.Rout.save0000644000176200001440000003505412763517421015335 0ustar liggesusers R Under development (unstable) (2013-08-17 r63608) -- "Unsuffered Consequences" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Test for singularity > doexact <- function(){ + exact <-function(){ + n1 <- 45 + p <- 2 + x1 <- matrix(rnorm(p*n1),nrow=n1, ncol=p) + x1[,p] <- x1[,p] + 3 + ## library(MASS) + ## x1 <- mvrnorm(n=n1, mu=c(0,3), Sigma=diag(1,nrow=p)) + + n2 <- 55 + m1 <- 0 + m2 <- 3 + x2 <- cbind(rnorm(n2),rep(m2,n2)) + x<-rbind(x1,x2) + colnames(x) <- c("X1","X2") + x + } + print(CovSde(exact())) + } > > dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE){ + + domcd <- function(x, xname, nrep=1){ + n <- dim(x)[1] + p <- dim(x)[2] + + mcd<-CovSde(x) + + if(time){ + xtime <- system.time(dorep(x, nrep))[1]/nrep + xres <- sprintf("%3d %3d %3d\n", dim(x)[1], dim(x)[2], xtime) + } + else{ + xres <- sprintf("%3d %3d\n", dim(x)[1], dim(x)[2]) + } + lpad<-lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + if(!short){ + + ibad <- which(mcd@wt==0) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ",nbad,"\n") + if(nbad > 0) + print(ibad) + if(full){ + cat("-------------\n") + show(mcd) + } + cat("--------------------------------------------------------\n") + } + } + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + lname <- 20 + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + data(heart) + data(starsCYG) + data(phosphor) + data(stackloss) + data(coleman) + data(salinity) + data(wood) + + data(hbk) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + data(milk) + data(bushfire) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p Half LOG(obj) Time\n") + cat("========================================================\n") + domcd(heart[, 1:2], data(heart), nrep) + domcd(starsCYG, data(starsCYG), nrep) + domcd(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + domcd(stack.x, data(stackloss), nrep) + domcd(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + domcd(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + domcd(data.matrix(subset(wood, select = -y)), data(wood), nrep) + domcd(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) + + domcd(brain, "Animals", nrep) + domcd(milk, data(milk), nrep) + domcd(bushfire, data(bushfire), nrep) + ## VT::19.07.2010: test the univariate SDE + for(i in 1:ncol(bushfire)) + domcd(bushfire[i], data(bushfire), nrep) + cat("========================================================\n") + } > > dogen <- function(nrep=1, eps=0.49){ + + library(MASS) + domcd <- function(x, nrep=1){ + gc() + xtime <- system.time(dorep(x, nrep))[1]/nrep + cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) + xtime + } + + set.seed(1234) + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + ap <- c(2, 5, 10, 20, 30) + an <- c(100, 500, 1000, 10000, 50000) + + tottime <- 0 + cat(" n p Time\n") + cat("=====================\n") + for(i in 1:length(an)) { + for(j in 1:length(ap)) { + n <- an[i] + p <- ap[j] + if(5*p <= n){ + xx <- gendata(n, p, eps) + X <- xx$X + tottime <- tottime + domcd(X, nrep) + } + } + } + + cat("=====================\n") + cat("Total time: ", tottime*nrep, "\n") + } > > docheck <- function(n, p, eps){ + xx <- gendata(n,p,eps) + mcd <- CovSde(xx$X) + check(mcd, xx$xind) + } > > check <- function(mcd, xind){ + ## check if mcd is robust w.r.t xind, i.e. check how many of xind + ## did not get zero weight + mymatch <- xind %in% which(mcd@wt == 0) + length(xind) - length(which(mymatch)) + } > > dorep <- function(x, nrep=1){ + + for(i in 1:nrep) + CovSde(x) + } > > #### gendata() #### > # Generates a location contaminated multivariate > # normal sample of n observations in p dimensions > # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) > # where > # m = (b,b,...,b) > # Defaults: eps=0 and b=10 > # > gendata <- function(n,p,eps=0,b=10){ + + if(missing(n) || missing(p)) + stop("Please specify (n,p)") + if(eps < 0 || eps >= 0.5) + stop(message="eps must be in [0,0.5)") + X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) + nbad <- as.integer(eps * n) + if(nbad > 0){ + Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) + xind <- sample(n,nbad) + X[xind,] <- Xbad + } + list(X=X, xind=xind) + } > > pad.right <- function(z, pads) + { + ### Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > whatis<-function(x){ + if(is.data.frame(x)) + cat("Type: data.frame\n") + else if(is.matrix(x)) + cat("Type: matrix\n") + else if(is.vector(x)) + cat("Type: vector\n") + else + cat("Type: don't know\n") + } > > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > dodata() Call: dodata() Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 Outliers: 5 [1] 2 6 8 10 12 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: height weight 39.8 35.7 Robust Estimate of Covariance: height weight height 38.2 77.1 weight 77.1 188.1 -------------------------------------------------------- starsCYG 47 2 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: log.Te log.light 4.42 4.96 Robust Estimate of Covariance: log.Te log.light log.Te 0.0163 0.0522 log.light 0.0522 0.3243 -------------------------------------------------------- phosphor 18 2 Outliers: 2 [1] 1 6 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: inorg organic 13.3 39.7 Robust Estimate of Covariance: inorg organic inorg 133 134 organic 134 204 -------------------------------------------------------- stackloss 21 3 Outliers: 6 [1] 1 2 3 15 17 21 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 57.8 20.7 86.4 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 39.7 15.6 25.0 Water.Temp 15.6 13.0 11.9 Acid.Conc. 25.0 11.9 40.3 -------------------------------------------------------- coleman 20 5 Outliers: 8 [1] 1 2 6 10 11 12 15 18 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.78 58.64 9.09 25.37 6.69 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2556 -1.0144 0.6599 0.2673 0.0339 fatherWc -1.0144 1615.9192 382.7846 -4.8287 36.0227 sstatus 0.6599 382.7846 108.1781 -0.7904 9.1027 teacherSc 0.2673 -4.8287 -0.7904 0.9346 -0.0239 motherLev 0.0339 36.0227 9.1027 -0.0239 0.9155 -------------------------------------------------------- salinity 28 3 Outliers: 9 [1] 3 4 5 9 11 16 19 23 24 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: X1 X2 X3 10.84 3.35 22.48 Robust Estimate of Covariance: X1 X2 X3 X1 10.75 -1.62 -2.05 X2 -1.62 4.21 -1.43 X3 -2.05 -1.43 2.63 -------------------------------------------------------- wood 20 5 Outliers: 11 [1] 4 6 7 8 9 10 12 13 16 19 20 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: x1 x2 x3 x4 x5 0.573 0.119 0.517 0.549 0.904 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 0.025185 0.004279 -0.001262 -0.000382 -0.001907 x2 0.004279 0.001011 0.000197 -0.000117 0.000247 x3 -0.001262 0.000197 0.003042 0.002034 0.001773 x4 -0.000382 -0.000117 0.002034 0.007943 0.001137 x5 -0.001907 0.000247 0.001773 0.001137 0.005392 -------------------------------------------------------- hbk 75 3 Outliers: 15 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 53 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: X1 X2 X3 1.59 1.79 1.67 Robust Estimate of Covariance: X1 X2 X3 X1 1.6354 0.0793 0.2284 X2 0.0793 1.6461 0.3186 X3 0.2284 0.3186 1.5673 -------------------------------------------------------- Animals 28 2 Outliers: 13 [1] 2 6 7 8 9 12 13 14 15 16 24 25 28 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: body brain 18.7 64.9 Robust Estimate of Covariance: body brain body 4702 7973 brain 7973 28571 -------------------------------------------------------- milk 86 8 Outliers: 21 [1] 1 2 3 6 11 12 13 14 15 16 17 18 20 27 41 44 47 70 74 75 77 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.90 33.04 26.11 25.10 25.02 123.06 14.37 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 4.73e-07 6.57e-05 1.79e-04 1.71e-04 1.62e-04 1.42e-04 6.85e-04 X2 6.57e-05 1.57e+00 1.36e-01 9.28e-02 4.18e-02 1.30e-01 1.58e+00 X3 1.79e-04 1.36e-01 1.12e+00 8.20e-01 8.27e-01 8.00e-01 6.66e-01 X4 1.71e-04 9.28e-02 8.20e-01 6.57e-01 6.41e-01 6.18e-01 5.47e-01 X5 1.62e-04 4.18e-02 8.27e-01 6.41e-01 6.93e-01 6.44e-01 5.71e-01 X6 1.42e-04 1.30e-01 8.00e-01 6.18e-01 6.44e-01 6.44e-01 5.55e-01 X7 6.85e-04 1.58e+00 6.66e-01 5.47e-01 5.71e-01 5.55e-01 4.17e+00 X8 1.40e-05 2.33e-01 1.74e-01 1.06e-01 9.44e-02 9.86e-02 3.54e-01 X8 X1 1.40e-05 X2 2.33e-01 X3 1.74e-01 X4 1.06e-01 X5 9.44e-02 X6 9.86e-02 X7 3.54e-01 X8 1.57e-01 -------------------------------------------------------- bushfire 38 5 Outliers: 23 [1] 1 5 6 7 8 9 10 11 12 13 15 16 28 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V1 V2 V3 V4 V5 105 148 287 223 283 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 1964 1712 -10230 -2504 -2066 V2 1712 1526 -8732 -2145 -1763 V3 -10230 -8732 56327 13803 11472 V4 -2504 -2145 13803 3509 2894 V5 -2066 -1763 11472 2894 2404 -------------------------------------------------------- bushfire 38 1 Outliers: 2 [1] 13 30 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V1 98.5 Robust Estimate of Covariance: V1 V1 431 -------------------------------------------------------- bushfire 38 1 Outliers: 6 [1] 33 34 35 36 37 38 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V2 141 Robust Estimate of Covariance: V2 V2 528 -------------------------------------------------------- bushfire 38 1 Outliers: 0 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V3 238 Robust Estimate of Covariance: V3 V3 37148 -------------------------------------------------------- bushfire 38 1 Outliers: 9 [1] 8 9 32 33 34 35 36 37 38 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V4 210 Robust Estimate of Covariance: V4 V4 2543 -------------------------------------------------------- bushfire 38 1 Outliers: 9 [1] 8 9 32 33 34 35 36 37 38 ------------- Call: CovSde(x = x) -> Method: Stahel-Donoho estimator Robust Estimate of Location: V5 273 Robust Estimate of Covariance: V5 V5 1575 -------------------------------------------------------- ======================================================== > ##doexact() > > proc.time() user system elapsed 0.45 0.10 0.54 rrcov/tests/tmve4.R0000644000176200001440000001607212763517421013747 0ustar liggesusersdodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMVE","MASS")){ ##@bdescr ## Test the function covMve() on the literature datasets: ## ## Call covMve() for all regression datasets available in rrco/robustbasev and print: ## - execution time (if time == TRUE) ## - objective fucntion ## - best subsample found (if short == false) ## - outliers identified (with cutoff 0.975) (if short == false) ## - estimated center and covarinance matrix if full == TRUE) ## ##@edescr ## ##@in nrep : [integer] number of repetitions to use for estimating the ## (average) execution time ##@in time : [boolean] whether to evaluate the execution time ##@in short : [boolean] whether to do short output (i.e. only the ## objective function value). If short == FALSE, ## the best subsample and the identified outliers are ## printed. See also the parameter full below ##@in full : [boolean] whether to print the estimated cente and covariance matrix ##@in method : [character] select a method: one of (FASTMCD, MASS) domve <- function(x, xname, nrep=1){ n <- dim(x)[1] p <- dim(x)[2] alpha <- 0.5 h <- h.alpha.n(alpha, n, p) if(method == "MASS"){ mve <- cov.mve(x, quantile.used=h) quan <- h #default: floor((n+p+1)/2) crit <- mve$crit best <- mve$best mah <- mahalanobis(x, mve$center, mve$cov) quantiel <- qchisq(0.975, p) wt <- as.numeric(mah < quantiel) } else{ mve <- CovMve(x, trace=FALSE) quan <- as.integer(mve@quan) crit <- log(mve@crit) best <- mve@best wt <- mve@wt } if(time){ xtime <- system.time(dorep(x, nrep, method))[1]/nrep xres <- sprintf("%3d %3d %3d %12.6f %10.3f\n", dim(x)[1], dim(x)[2], quan, crit, xtime) } else{ xres <- sprintf("%3d %3d %3d %12.6f\n", dim(x)[1], dim(x)[2], quan, crit) } lpad<-lname-nchar(xname) cat(pad.right(xname,lpad), xres) if(!short){ cat("Best subsample: \n") print(best) ibad <- which(wt == 0) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ", nbad, "\n") if(nbad > 0) print(ibad) if(full){ cat("-------------\n") show(mve) } cat("--------------------------------------------------------\n") } } options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed lname <- 20 ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) method <- match.arg(method) if(method == "MASS") library(MASS) data(heart) data(starsCYG) data(phosphor) data(stackloss) data(coleman) data(salinity) data(wood) data(hbk) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(milk) data(bushfire) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p Half LOG(obj) Time\n") cat("========================================================\n") domve(heart[, 1:2], data(heart), nrep) domve(starsCYG, data(starsCYG), nrep) domve(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) domve(stack.x, data(stackloss), nrep) domve(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) domve(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) domve(data.matrix(subset(wood, select = -y)), data(wood), nrep) domve(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) domve(brain, "Animals", nrep) domve(milk, data(milk), nrep) domve(bushfire, data(bushfire), nrep) cat("========================================================\n") } dogen <- function(nrep=1, eps=0.49, method=c("FASTMVE", "MASS")){ domve <- function(x, nrep=1){ gc() xtime <- system.time(dorep(x, nrep, method))[1]/nrep cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) xtime } set.seed(1234) ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) method <- match.arg(method) ap <- c(2, 5, 10, 20, 30) an <- c(100, 500, 1000, 10000, 50000) tottime <- 0 cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- an[i] p <- ap[j] if(5*p <= n){ xx <- gendata(n, p, eps) X <- xx$X tottime <- tottime + domve(X, nrep) } } } cat("=====================\n") cat("Total time: ", tottime*nrep, "\n") } docheck <- function(n, p, eps){ xx <- gendata(n,p,eps) mve <- CovMve(xx$X) check(mve, xx$xind) } check <- function(mcd, xind){ ## check if mcd is robust w.r.t xind, i.e. check how many of xind ## did not get zero weight mymatch <- xind %in% which(mcd@wt == 0) length(xind) - length(which(mymatch)) } dorep <- function(x, nrep=1, method=c("FASTMVE","MASS")){ method <- match.arg(method) for(i in 1:nrep) if(method == "MASS") cov.mve(x) else CovMve(x) } #### gendata() #### # Generates a location contaminated multivariate # normal sample of n observations in p dimensions # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) # where # m = (b,b,...,b) # Defaults: eps=0 and b=10 # gendata <- function(n,p,eps=0,b=10){ if(missing(n) || missing(p)) stop("Please specify (n,p)") if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) nbad <- as.integer(eps * n) if(nbad > 0){ Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) xind <- sample(n,nbad) X[xind,] <- Xbad } list(X=X, xind=xind) } pad.right <- function(z, pads) { ### Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } whatis<-function(x){ if(is.data.frame(x)) cat("Type: data.frame\n") else if(is.matrix(x)) cat("Type: matrix\n") else if(is.vector(x)) cat("Type: vector\n") else cat("Type: don't know\n") } ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) dodata() rrcov/tests/tlda.R0000644000176200001440000000613613607363251013632 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) library(MASS) ## VT::14.01.2020 ## On some platforms minor differences are shown - use ## IGNORE_RDIFF_BEGIN ## IGNORE_RDIFF_END dodata <- function(method) { options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("===================================================\n") cat("\nData: ", "hemophilia\n") data(hemophilia) show(rlda <- Linda(as.factor(gr)~., data=hemophilia, method=method)) show(predict(rlda)) cat("\nData: ", "anorexia\n") data(anorexia) show(rlda <- Linda(Treat~., data=anorexia, method=method)) show(predict(rlda)) cat("\nData: ", "Pima\n") data(Pima.tr) show(rlda <- Linda(type~., data=Pima.tr, method=method)) show(predict(rlda)) cat("\nData: ", "Forest soils\n") data(soil) soil1983 <- soil[soil$D == 0, -2] # only 1983, remove column D (always 0) ## IGNORE_RDIFF_BEGIN show(rlda <- Linda(F~., data=soil1983, method=method)) ## IGNORE_RDIFF_END show(predict(rlda)) cat("\nData: ", "Raven and Miller diabetes data\n") data(diabetes) show(rlda <- Linda(group~insulin+glucose+sspg, data=diabetes, method=method)) show(predict(rlda)) cat("\nData: ", "iris\n") data(iris) if(method != "mcdA") { show(rlda <- Linda(Species~., data=iris, method=method, l1med=TRUE)) show(predict(rlda)) } cat("\nData: ", "crabs\n") data(crabs) show(rlda <- Linda(sp~., data=crabs, method=method)) show(predict(rlda)) cat("\nData: ", "fish\n") data(fish) fish <- fish[-14,] # remove observation #14 containing missing value # The height and width are calculated as percentages # of the third length variable fish[,5] <- fish[,5]*fish[,4]/100 fish[,6] <- fish[,6]*fish[,4]/100 ## There is one class with only 6 observations (p=6). Normally ## Linda will fail, therefore use l1med=TRUE. ## This works only for methods mcdB and mcdC table(fish$Species) if(method != "mcdA") { ## IGNORE_RDIFF_BEGIN show(rlda <- Linda(Species~., data=fish, method=method, l1med=TRUE)) ## IGNORE_RDIFF_END show(predict(rlda)) } cat("\nData: ", "pottery\n") data(pottery) show(rlda <- Linda(origin~., data=pottery, method=method)) show(predict(rlda)) cat("\nData: ", "olitos\n") data(olitos) if(method != "mcdA") { ## IGNORE_RDIFF_BEGIN show(rlda <- Linda(grp~., data=olitos, method=method, l1med=TRUE)) ## IGNORE_RDIFF_END show(predict(rlda)) } cat("===================================================\n") } ## -- now do it: dodata(method="mcdA") dodata(method="mcdB") dodata(method="mcdC") dodata(method="mrcd") dodata(method="ogk") #dodata(method="fsa") rrcov/tests/tmcd4.Rout.save0000644000176200001440000030533413565026723015413 0ustar liggesusers R Under development (unstable) (2019-10-19 r77318) -- "Unsuffered Consequences" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Test the exact fit property of CovMcd > doexactfit <- function(){ + exact <-function(seed=1234){ + + set.seed(seed) + + n1 <- 45 + p <- 2 + x1 <- matrix(rnorm(p*n1),nrow=n1, ncol=p) + x1[,p] <- x1[,p] + 3 + n2 <- 55 + m1 <- 0 + m2 <- 3 + x2 <- cbind(rnorm(n2),rep(m2,n2)) + x<-rbind(x1,x2) + colnames(x) <- c("X1","X2") + x + } + print(CovMcd(exact())) + } > > dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMCD","MASS", "deterministic", "exact", "MRCD")){ + ##@bdescr + ## Test the function covMcd() on the literature datasets: + ## + ## Call CovMcd() for all regression datasets available in rrcov and print: + ## - execution time (if time == TRUE) + ## - objective fucntion + ## - best subsample found (if short == false) + ## - outliers identified (with cutoff 0.975) (if short == false) + ## - estimated center and covarinance matrix if full == TRUE) + ## + ##@edescr + ## + ##@in nrep : [integer] number of repetitions to use for estimating the + ## (average) execution time + ##@in time : [boolean] whether to evaluate the execution time + ##@in short : [boolean] whether to do short output (i.e. only the + ## objective function value). If short == FALSE, + ## the best subsample and the identified outliers are + ## printed. See also the parameter full below + ##@in full : [boolean] whether to print the estimated cente and covariance matrix + ##@in method : [character] select a method: one of (FASTMCD, MASS) + + doest <- function(x, xname, nrep=1){ + n <- dim(x)[1] + p <- dim(x)[2] + if(method == "MASS"){ + mcd<-cov.mcd(x) + quan <- as.integer(floor((n + p + 1)/2)) #default: floor((n+p+1)/2) + } + else{ + mcd <- if(method=="deterministic") CovMcd(x, nsamp="deterministic", trace=FALSE) + else if(method=="exact") CovMcd(x, nsamp="exact", trace=FALSE) + else if(method=="MRCD") CovMrcd(x, trace=FALSE) + else CovMcd(x, trace=FALSE) + quan <- as.integer(mcd@quan) + } + + crit <- mcd@crit + + if(time){ + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + xres <- sprintf("%3d %3d %3d %12.6f %10.3f\n", dim(x)[1], dim(x)[2], quan, crit, xtime) + } + else{ + xres <- sprintf("%3d %3d %3d %12.6f\n", dim(x)[1], dim(x)[2], quan, crit) + } + lpad<-lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + if(!short){ + cat("Best subsample: \n") + if(length(mcd@best) > 150) + cat("Too long... \n") + else + print(mcd@best) + + ibad <- which(mcd@wt==0) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ",nbad,"\n") + if(nbad > 0 & nbad < 150) + print(ibad) + else + cat("Too many to print ... \n") + if(full){ + cat("-------------\n") + show(mcd) + } + cat("--------------------------------------------------------\n") + } + } + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + lname <- 20 + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + method <- match.arg(method) + if(method == "MASS") + library(MASS) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + + data(fish) + data(pottery) + data(rice) + data(un86) + data(wages) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p Half LOG(obj) Time\n") + cat("========================================================\n") + + if(method=="exact") + { + ## only small data sets + doest(heart[, 1:2], data(heart), nrep) + doest(starsCYG, data(starsCYG), nrep) + doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + doest(data.matrix(subset(wood, select = -y)), data(wood), nrep) + doest(brain, "Animals", nrep) + doest(lactic, data(lactic), nrep) + doest(pension, data(pension), nrep) + doest(data.matrix(subset(vaso, select = -Y)), data(vaso), nrep) + doest(stack.x, data(stackloss), nrep) + doest(pilot, data(pilot), nrep) + } else + { + doest(heart[, 1:2], data(heart), nrep) + doest(starsCYG, data(starsCYG), nrep) + doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + doest(stack.x, data(stackloss), nrep) + doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) + doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + doest(data.matrix(subset(wood, select = -y)), data(wood), nrep) + doest(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) + + doest(brain, "Animals", nrep) + ## doest(milk, data(milk), nrep) # difference between 386 and x64 + doest(bushfire, data(bushfire), nrep) + + doest(lactic, data(lactic), nrep) + doest(pension, data(pension), nrep) + ## doest(pilot, data(pilot), nrep) # difference between 386 and x64 + + if(method != "MRCD") # these two are quite slow for MRCD, especially the second one + { + doest(radarImage, data(radarImage), nrep) + doest(NOxEmissions, data(NOxEmissions), nrep) + } + + doest(data.matrix(subset(vaso, select = -Y)), data(vaso), nrep) + doest(data.matrix(subset(wagnerGrowth, select = -Period)), data(wagnerGrowth), nrep) + + doest(data.matrix(subset(fish, select = -Species)), data(fish), nrep) + doest(data.matrix(subset(pottery, select = -origin)), data(pottery), nrep) + doest(rice, data(rice), nrep) + doest(un86, data(un86), nrep) + + doest(wages, data(wages), nrep) + + ## from package 'datasets' + doest(airquality[,1:4], data(airquality), nrep) + doest(attitude, data(attitude), nrep) + doest(attenu, data(attenu), nrep) + doest(USJudgeRatings, data(USJudgeRatings), nrep) + doest(USArrests, data(USArrests), nrep) + doest(longley, data(longley), nrep) + doest(Loblolly, data(Loblolly), nrep) + doest(quakes[,1:4], data(quakes), nrep) + } + cat("========================================================\n") + } > > dogen <- function(nrep=1, eps=0.49, method=c("FASTMCD", "MASS")){ + + doest <- function(x, nrep=1){ + gc() + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) + xtime + } + + set.seed(1234) + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + library(MASS) + method <- match.arg(method) + + ap <- c(2, 5, 10, 20, 30) + an <- c(100, 500, 1000, 10000, 50000) + + tottime <- 0 + cat(" n p Time\n") + cat("=====================\n") + for(i in 1:length(an)) { + for(j in 1:length(ap)) { + n <- an[i] + p <- ap[j] + if(5*p <= n){ + xx <- gendata(n, p, eps) + X <- xx$X + tottime <- tottime + doest(X, nrep) + } + } + } + + cat("=====================\n") + cat("Total time: ", tottime*nrep, "\n") + } > > docheck <- function(n, p, eps){ + xx <- gendata(n,p,eps) + mcd <- CovMcd(xx$X) + check(mcd, xx$xind) + } > > check <- function(mcd, xind){ + ## check if mcd is robust w.r.t xind, i.e. check how many of xind + ## did not get zero weight + mymatch <- xind %in% which(mcd@wt == 0) + length(xind) - length(which(mymatch)) + } > > dorep <- function(x, nrep=1, method=c("FASTMCD","MASS", "deterministic", "exact", "MRCD")){ + + method <- match.arg(method) + for(i in 1:nrep) + if(method == "MASS") + cov.mcd(x) + else + { + if(method=="deterministic") CovMcd(x, nsamp="deterministic", trace=FALSE) + else if(method=="exact") CovMcd(x, nsamp="exact", trace=FALSE) + else if(method=="MRCD") CovMrcd(x, trace=FALSE) + else CovMcd(x, trace=FALSE) + } + } > > #### gendata() #### > # Generates a location contaminated multivariate > # normal sample of n observations in p dimensions > # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) > # where > # m = (b,b,...,b) > # Defaults: eps=0 and b=10 > # > gendata <- function(n,p,eps=0,b=10){ + + if(missing(n) || missing(p)) + stop("Please specify (n,p)") + if(eps < 0 || eps >= 0.5) + stop(message="eps must be in [0,0.5)") + X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) + nbad <- as.integer(eps * n) + if(nbad > 0){ + Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) + xind <- sample(n,nbad) + X[xind,] <- Xbad + } + list(X=X, xind=xind) + } > > pad.right <- function(z, pads) + { + ### Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > whatis<-function(x){ + if(is.data.frame(x)) + cat("Type: data.frame\n") + else if(is.matrix(x)) + cat("Type: matrix\n") + else if(is.vector(x)) + cat("Type: vector\n") + else + cat("Type: don't know\n") + } > > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > dodata() Call: dodata() Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 7 5.678742 Best subsample: [1] 1 3 4 5 7 9 11 Outliers: 0 Too many to print ... ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=7); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: height weight 38.3 33.1 Robust Estimate of Covariance: height weight height 157 303 weight 303 660 -------------------------------------------------------- starsCYG 47 2 25 -8.031215 Best subsample: [1] 1 2 4 6 8 10 12 13 16 24 25 26 28 32 33 37 38 39 40 41 42 43 44 45 46 Outliers: 6 [1] 7 11 14 20 30 34 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=25); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: log.Te log.light 4.41 4.95 Robust Estimate of Covariance: log.Te log.light log.Te 0.0171 0.0511 log.light 0.0511 0.3555 -------------------------------------------------------- phosphor 18 2 10 6.878847 Best subsample: [1] 3 5 8 9 11 12 13 14 15 17 Outliers: 2 [1] 1 6 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=10); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: inorg organic 13.4 38.8 Robust Estimate of Covariance: inorg organic inorg 181 184 organic 184 256 -------------------------------------------------------- stackloss 21 3 12 5.472581 Best subsample: [1] 4 5 6 7 8 9 10 11 12 13 14 20 Outliers: 9 [1] 1 2 3 15 16 17 18 19 21 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=12); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 59.5 20.8 87.3 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 12.6 11.7 11.5 Water.Temp 11.7 18.5 12.3 Acid.Conc. 11.5 12.3 46.6 -------------------------------------------------------- coleman 20 5 13 1.286808 Best subsample: [1] 2 3 4 5 7 8 12 13 14 16 17 19 20 Outliers: 7 [1] 1 6 9 10 11 15 18 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=13); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.76 48.38 6.12 25.00 6.40 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.381 2.685 -0.400 0.228 0.113 fatherWc 2.685 1959.466 496.858 18.948 51.871 sstatus -0.400 496.858 180.236 5.762 15.230 teacherSc 0.228 18.948 5.762 1.180 0.835 motherLev 0.113 51.871 15.230 0.835 1.567 -------------------------------------------------------- salinity 28 3 16 1.326364 Best subsample: [1] 1 2 6 7 8 12 13 14 18 20 21 22 25 26 27 28 Outliers: 4 [1] 5 16 23 24 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=16); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: X1 X2 X3 10.08 2.78 22.78 Robust Estimate of Covariance: X1 X2 X3 X1 13.87 1.34 -4.24 X2 1.34 5.10 -1.92 X3 -4.24 -1.92 3.17 -------------------------------------------------------- wood 20 5 13 -36.270094 Best subsample: [1] 1 2 3 5 9 10 12 13 14 15 17 18 20 Outliers: 7 [1] 4 6 7 8 11 16 19 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=13); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: x1 x2 x3 x4 x5 0.587 0.122 0.531 0.538 0.892 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 1.51e-02 2.83e-03 4.74e-03 -8.81e-04 -2.45e-03 x2 2.83e-03 7.29e-04 1.91e-03 -7.82e-05 3.55e-05 x3 4.74e-03 1.91e-03 9.97e-03 -1.31e-03 5.30e-04 x4 -8.81e-04 -7.82e-05 -1.31e-03 4.28e-03 2.75e-03 x5 -2.45e-03 3.55e-05 5.30e-04 2.75e-03 4.16e-03 -------------------------------------------------------- hbk 75 3 39 -1.047858 Best subsample: [1] 15 16 17 18 19 20 21 22 23 24 26 27 31 32 33 35 36 37 38 40 43 49 50 51 54 [26] 55 56 58 59 61 63 64 66 67 70 71 72 73 74 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=39); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: X1 X2 X3 1.54 1.78 1.69 Robust Estimate of Covariance: X1 X2 X3 X1 1.6528 0.0741 0.1713 X2 0.0741 1.6823 0.2055 X3 0.1713 0.2055 1.5624 -------------------------------------------------------- Animals 28 2 15 14.555543 Best subsample: [1] 1 3 4 5 10 11 17 18 19 20 21 22 23 26 27 Outliers: 13 [1] 2 6 7 8 9 12 13 14 15 16 24 25 28 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=15); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: body brain 18.7 64.9 Robust Estimate of Covariance: body brain body 2511 4258 brain 4258 15257 -------------------------------------------------------- bushfire 38 5 22 18.135810 Best subsample: [1] 1 2 3 4 5 6 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Outliers: 16 [1] 7 8 9 10 11 12 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=22); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: V1 V2 V3 V4 V5 105 147 274 218 279 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 567 439 -2771 -624 -509 V2 439 387 -1843 -376 -318 V3 -2771 -1843 16367 4021 3196 V4 -624 -376 4021 1059 827 V5 -509 -318 3196 827 652 -------------------------------------------------------- lactic 20 2 11 0.359580 Best subsample: [1] 1 2 3 4 5 7 8 9 10 11 12 Outliers: 3 [1] 17 19 20 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=11); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: X Y 3.86 5.01 Robust Estimate of Covariance: X Y X 19.8 27.3 Y 27.3 39.8 -------------------------------------------------------- pension 18 2 10 16.675508 Best subsample: [1] 1 2 3 4 5 6 8 9 11 12 Outliers: 4 [1] 15 16 17 18 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=10); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Income Reserves 52.3 560.9 Robust Estimate of Covariance: Income Reserves Income 2534 21294 Reserves 21294 372356 -------------------------------------------------------- radarImage 1573 5 789 36.694425 Best subsample: Too long... Outliers: 73 [1] 262 450 451 480 481 509 535 542 597 643 669 697 803 804 832 [16] 833 834 862 863 864 892 989 1123 1145 1223 1224 1232 1233 1249 1250 [31] 1267 1303 1347 1357 1375 1411 1419 1420 1443 1453 1504 1510 1511 1512 1518 [46] 1519 1520 1521 1525 1526 1543 1544 1546 1547 1548 1549 1550 1551 1552 1553 [61] 1554 1555 1557 1558 1561 1562 1564 1565 1566 1569 1570 1571 1573 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=789); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: X.coord Y.coord Band.1 Band.2 Band.3 52.80 35.12 6.77 18.44 8.90 Robust Estimate of Covariance: X.coord Y.coord Band.1 Band.2 Band.3 X.coord 148.0 27.5 -433.2 -236.0 -27.0 Y.coord 27.5 479.5 41.0 -228.8 -46.8 Band.1 -433.2 41.0 32520.8 9790.3 567.0 Band.2 -236.0 -228.8 9790.3 31148.9 1140.0 Band.3 -27.0 -46.8 567.0 1140.0 5336.9 -------------------------------------------------------- NOxEmissions 8088 4 4046 2.474539 Best subsample: Too long... Outliers: 1515 Too many to print ... ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=4046); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: julday LNOx LNOxEm sqrtWS 168.19 4.73 7.91 1.37 Robust Estimate of Covariance: julday LNOx LNOxEm sqrtWS julday 1.37e+04 1.79e+01 1.07e+00 -1.51e+01 LNOx 1.79e+01 7.03e-01 2.11e-01 -2.27e-01 LNOxEm 1.07e+00 2.11e-01 3.75e-01 6.52e-02 sqrtWS -1.51e+01 -2.27e-01 6.52e-02 3.09e-01 -------------------------------------------------------- vaso 39 2 21 -3.972244 Best subsample: [1] 3 4 8 14 18 19 20 21 22 23 24 25 26 27 28 33 34 35 37 38 39 Outliers: 3 [1] 1 2 17 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=21); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Volume Rate 1.16 1.72 Robust Estimate of Covariance: Volume Rate Volume 0.406 -0.216 Rate -0.216 0.945 -------------------------------------------------------- wagnerGrowth 63 6 35 6.572208 Best subsample: [1] 2 3 4 5 6 7 9 10 11 12 13 14 16 17 18 20 23 25 27 31 32 35 36 38 44 [26] 48 51 52 53 54 55 56 57 60 62 Outliers: 10 [1] 1 8 21 22 29 33 42 43 50 63 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=35); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Region PA GPA HS GHS y 11.00 33.66 -2.00 2.48 0.31 7.48 Robust Estimate of Covariance: Region PA GPA HS GHS y Region 45.5790 22.9855 -0.6840 -1.2234 -0.3964 -17.9553 PA 22.9855 35.5456 -6.2825 -1.8167 0.0439 -36.7897 GPA -0.6840 -6.2825 6.8455 0.3448 -0.1902 5.1276 HS -1.2234 -1.8167 0.3448 1.1102 -0.0582 3.7199 GHS -0.3964 0.0439 -0.1902 -0.0582 0.2271 0.9558 y -17.9553 -36.7897 5.1276 3.7199 0.9558 105.9803 -------------------------------------------------------- fish 159 6 82 8.879005 Best subsample: [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 20 21 22 23 24 25 26 27 28 30 32 35 36 37 42 43 44 45 46 [39] 47 48 49 50 51 52 53 54 55 56 57 58 59 60 107 109 110 111 113 [58] 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 [77] 134 135 136 137 138 139 Outliers: 51 [1] 39 41 62 63 64 65 66 68 69 73 74 75 76 77 78 79 80 81 82 [20] 83 84 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 [39] 103 104 143 145 148 150 152 153 155 156 157 158 159 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=82); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 329.9 24.5 26.6 29.7 31.1 14.7 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 104103.18 2226.96 2431.64 3002.74 2168.96 -93.61 Length1 2226.96 52.26 56.68 68.58 43.43 -1.97 Length2 2431.64 56.68 61.60 74.62 47.94 -2.12 Length3 3002.74 68.58 74.62 92.16 64.27 -3.40 Height 2168.96 43.43 47.94 64.27 70.43 -4.24 Width -93.61 -1.97 -2.12 -3.40 -4.24 1.52 -------------------------------------------------------- pottery 27 6 17 -10.586933 Best subsample: [1] 1 2 4 5 6 9 10 11 13 14 15 19 20 21 22 26 27 Outliers: 9 [1] 3 8 12 16 17 18 23 24 25 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=17); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: SI AL FE MG CA TI 54.983 15.206 9.700 3.817 5.211 0.859 Robust Estimate of Covariance: SI AL FE MG CA TI SI 29.12922 3.23731 -0.02886 3.00952 -2.55067 0.12484 AL 3.23731 5.71205 -0.89190 -3.53767 0.29497 -0.02885 FE -0.02886 -0.89190 0.39349 0.75550 -0.49711 0.02020 MG 3.00952 -3.53767 0.75550 3.95652 -0.22341 0.04029 CA -2.55067 0.29497 -0.49711 -0.22341 1.74417 -0.04904 TI 0.12484 -0.02885 0.02020 0.04029 -0.04904 0.00248 -------------------------------------------------------- rice 105 6 56 -14.463986 Best subsample: [1] 2 4 6 8 10 12 15 18 21 22 24 29 30 31 32 33 34 36 37 [20] 38 41 44 45 47 51 52 53 54 55 59 61 65 67 68 69 70 72 76 [39] 78 79 80 81 82 83 84 85 86 92 93 94 95 97 98 99 102 105 Outliers: 11 [1] 9 28 40 42 49 58 62 71 75 77 89 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=56); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Favor Appearance Taste Stickiness -0.2731 0.0600 -0.1468 0.0646 Toughness Overall_evaluation 0.0894 -0.2192 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.478 0.398 0.484 0.479 -0.240 Appearance 0.398 0.619 0.609 0.608 -0.333 Taste 0.484 0.609 0.789 0.775 -0.445 Stickiness 0.479 0.608 0.775 1.003 -0.599 Toughness -0.240 -0.333 -0.445 -0.599 0.556 Overall_evaluation 0.580 0.708 0.891 0.951 -0.563 Overall_evaluation Favor 0.580 Appearance 0.708 Taste 0.891 Stickiness 0.951 Toughness -0.563 Overall_evaluation 1.086 -------------------------------------------------------- un86 73 7 40 17.009322 Best subsample: [1] 1 2 9 10 12 14 16 17 18 20 23 24 26 27 31 32 37 39 41 42 45 47 48 49 50 [26] 51 52 55 56 60 61 62 63 64 65 67 70 71 72 73 Outliers: 29 [1] 3 4 5 6 7 8 11 13 15 19 21 22 28 29 30 35 36 38 40 43 44 46 53 54 58 [26] 59 66 68 69 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=40); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: POP MOR CAR DR GNP DEN TB 20.740 71.023 6.435 0.817 1.146 56.754 0.441 Robust Estimate of Covariance: POP MOR CAR DR GNP DEN POP 8.62e+02 3.33e+02 -1.88e+01 -2.48e+00 -4.98e+00 3.35e+02 MOR 3.33e+02 3.48e+03 -4.25e+02 -4.75e+01 -5.26e+01 -7.81e+02 CAR -1.88e+01 -4.25e+02 8.60e+01 8.49e+00 9.82e+00 1.24e+02 DR -2.48e+00 -4.75e+01 8.49e+00 1.23e+00 8.85e-01 1.80e+01 GNP -4.98e+00 -5.26e+01 9.82e+00 8.85e-01 2.10e+00 1.93e+01 DEN 3.35e+02 -7.81e+02 1.24e+02 1.80e+01 1.93e+01 3.02e+03 TB 5.92e-01 -1.75e+00 4.00e-01 2.83e-02 8.58e-03 -1.38e+00 TB POP 5.92e-01 MOR -1.75e+00 CAR 4.00e-01 DR 2.83e-02 GNP 8.58e-03 DEN -1.38e+00 TB 2.72e-02 -------------------------------------------------------- wages 39 10 19 22.994272 Best subsample: [1] 1 2 6 7 8 9 10 11 12 13 14 15 17 18 19 25 26 27 28 Outliers: 9 [1] 4 5 6 24 28 30 32 33 34 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=19); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: HRS RATE ERSP ERNO NEIN ASSET AGE DEP 2153.37 2.87 1129.16 297.53 360.58 6876.58 39.48 2.36 RACE SCHOOL 38.88 10.17 Robust Estimate of Covariance: HRS RATE ERSP ERNO NEIN ASSET HRS 7.84e+03 2.22e+01 -2.14e+03 -2.64e+03 1.17e+04 2.59e+05 RATE 2.22e+01 3.23e-01 2.74e+01 -4.53e+00 7.49e+01 1.76e+03 ERSP -2.14e+03 2.74e+01 2.52e+04 9.94e+01 -2.20e+03 -1.80e+04 ERNO -2.64e+03 -4.53e+00 9.94e+01 2.64e+03 -2.58e+03 -6.18e+04 NEIN 1.17e+04 7.49e+01 -2.20e+03 -2.58e+03 2.58e+04 5.82e+05 ASSET 2.59e+05 1.76e+03 -1.80e+04 -6.18e+04 5.82e+05 1.32e+07 AGE -8.05e+01 -3.34e-01 6.18e+00 3.13e+01 -1.38e+02 -3.15e+03 DEP -7.90e+00 -9.03e-02 -2.73e+01 2.93e+00 -1.67e+01 -4.05e+02 RACE -2.78e+03 -1.21e+01 9.21e+02 7.16e+02 -5.06e+03 -1.12e+05 SCHOOL 9.12e+01 7.52e-01 6.90e+01 -2.75e+01 2.09e+02 4.86e+03 AGE DEP RACE SCHOOL HRS -8.05e+01 -7.90e+00 -2.78e+03 9.12e+01 RATE -3.34e-01 -9.03e-02 -1.21e+01 7.52e-01 ERSP 6.18e+00 -2.73e+01 9.21e+02 6.90e+01 ERNO 3.13e+01 2.93e+00 7.16e+02 -2.75e+01 NEIN -1.38e+02 -1.67e+01 -5.06e+03 2.09e+02 ASSET -3.15e+03 -4.05e+02 -1.12e+05 4.86e+03 AGE 1.29e+00 9.00e-02 3.06e+01 -1.22e+00 DEP 9.00e-02 5.91e-02 3.48e+00 -2.49e-01 RACE 3.06e+01 3.48e+00 1.12e+03 -3.96e+01 SCHOOL -1.22e+00 -2.49e-01 -3.96e+01 2.07e+00 -------------------------------------------------------- airquality 153 4 58 18.213499 Best subsample: [1] 3 22 24 25 28 29 32 33 35 36 37 38 39 40 41 42 43 44 46 [20] 47 48 49 50 52 56 57 58 59 60 64 66 67 68 69 71 72 73 74 [39] 76 78 80 82 83 84 86 87 89 90 91 92 93 94 95 97 98 105 109 [58] 110 Outliers: 11 [1] 8 9 15 18 21 24 30 48 62 117 148 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=58); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Ozone Solar.R Wind Temp 43.2 192.9 9.6 80.5 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 1219.91 980.92 -77.44 252.18 Solar.R 980.92 9012.14 -2.18 121.72 Wind -77.44 -2.18 13.62 -15.21 Temp 252.18 121.72 -15.21 79.80 -------------------------------------------------------- attitude 30 7 19 24.442803 Best subsample: [1] 2 3 4 5 7 8 10 12 15 17 19 20 22 23 25 27 28 29 30 Outliers: 7 [1] 1 9 13 14 16 18 24 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=19); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: rating complaints privileges learning raises critical 67.1 68.0 52.4 57.6 67.2 77.4 advance 43.4 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 232.42 175.44 55.55 151.33 125.87 -4.93 73.90 complaints 175.44 215.20 72.26 152.30 132.53 9.98 104.35 privileges 55.55 72.26 187.90 126.78 94.70 13.09 120.75 learning 151.33 152.30 126.78 216.54 154.98 9.26 103.63 raises 125.87 132.53 94.70 154.98 154.80 6.73 96.38 critical -4.93 9.98 13.09 9.26 6.73 71.71 20.59 advance 73.90 104.35 120.75 103.63 96.38 20.59 127.80 -------------------------------------------------------- attenu 182 5 86 6.440834 Best subsample: [1] 68 69 70 71 72 73 74 75 76 77 79 82 83 84 85 86 87 88 89 [20] 90 91 92 101 102 103 104 106 107 109 110 111 112 113 114 115 116 117 118 [39] 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 [58] 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 [77] 157 158 159 160 161 162 163 164 165 166 Outliers: 44 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 19 20 21 [20] 22 23 24 25 27 28 29 30 31 32 33 34 46 47 59 60 61 64 65 [39] 82 98 100 101 102 105 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=86); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: event mag station dist accel 18.624 5.752 67.861 22.770 0.141 Robust Estimate of Covariance: event mag station dist accel event 25.8954 -1.9225 88.2479 15.7612 -0.1322 mag -1.9225 0.6517 -5.0369 2.1280 0.0193 station 88.2479 -5.0369 1623.2349 110.5543 0.8778 dist 15.7612 2.1280 110.5543 348.6383 -1.4600 accel -0.1322 0.0193 0.8778 -1.4600 0.0152 -------------------------------------------------------- USJudgeRatings 43 12 28 -47.889993 Best subsample: [1] 1 2 3 4 6 9 10 11 15 16 17 18 19 22 24 25 26 27 28 29 32 33 34 36 37 [26] 38 41 43 Outliers: 14 [1] 5 7 8 12 13 14 20 21 23 30 31 35 40 42 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=28); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.40 8.19 7.80 7.96 7.74 7.82 7.74 7.73 7.57 7.63 8.25 7.94 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 1.0672 -0.3329 -0.5283 -0.1942 -0.0614 -0.0927 -0.1464 -0.1487 INTG -0.3329 0.4969 0.6723 0.5089 0.4255 0.4069 0.5063 0.5127 DMNR -0.5283 0.6723 1.0323 0.6561 0.5734 0.5479 0.6513 0.6317 DILG -0.1942 0.5089 0.6561 0.6086 0.5342 0.5130 0.6337 0.6447 CFMG -0.0614 0.4255 0.5734 0.5342 0.5354 0.5046 0.5840 0.5966 DECI -0.0927 0.4069 0.5479 0.5130 0.5046 0.4959 0.5626 0.5788 PREP -0.1464 0.5063 0.6513 0.6337 0.5840 0.5626 0.6911 0.7077 FAMI -0.1487 0.5127 0.6317 0.6447 0.5966 0.5788 0.7077 0.7448 ORAL -0.2213 0.5391 0.7129 0.6400 0.5995 0.5770 0.6909 0.7157 WRIT -0.1995 0.5346 0.6879 0.6458 0.6014 0.5780 0.6966 0.7262 PHYS -0.2308 0.3376 0.4542 0.3865 0.3732 0.3846 0.4201 0.4481 RTEN -0.3252 0.5913 0.8042 0.6508 0.5846 0.5697 0.6752 0.6941 ORAL WRIT PHYS RTEN CONT -0.2213 -0.1995 -0.2308 -0.3252 INTG 0.5391 0.5346 0.3376 0.5913 DMNR 0.7129 0.6879 0.4542 0.8042 DILG 0.6400 0.6458 0.3865 0.6508 CFMG 0.5995 0.6014 0.3732 0.5846 DECI 0.5770 0.5780 0.3846 0.5697 PREP 0.6909 0.6966 0.4201 0.6752 FAMI 0.7157 0.7262 0.4481 0.6941 ORAL 0.7202 0.7190 0.4618 0.7180 WRIT 0.7190 0.7263 0.4576 0.7108 PHYS 0.4618 0.4576 0.3761 0.4732 RTEN 0.7180 0.7108 0.4732 0.7702 -------------------------------------------------------- USArrests 50 4 27 15.391648 Best subsample: [1] 4 7 9 12 13 14 15 16 19 21 23 26 27 29 30 32 34 35 36 38 41 42 43 45 46 [26] 49 50 Outliers: 8 [1] 2 5 6 10 24 28 33 37 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=27); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: Murder Assault UrbanPop Rape 6.71 145.42 65.06 17.88 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 23.4 391.3 29.6 36.7 Assault 391.3 9611.7 825.3 659.4 UrbanPop 29.6 825.3 327.6 69.3 Rape 36.7 659.4 69.3 74.0 -------------------------------------------------------- longley 16 7 12 12.747678 Best subsample: [1] 5 6 7 8 9 10 11 12 13 14 15 16 Outliers: 4 [1] 1 2 3 4 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=12); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 106.5 430.6 328.2 295.0 120.2 Year Employed 1956.5 66.9 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 137.5 1318.8 1562.4 -590.5 103.2 GNP 1318.8 13062.4 14155.2 -5424.8 1018.8 Unemployed 1562.4 14155.2 25109.6 -7362.7 1178.3 Armed.Forces -590.5 -5424.8 -7362.7 3557.9 -415.1 Population 103.2 1018.8 1178.3 -415.1 80.5 Year 65.4 639.5 755.3 -274.8 50.3 Employed 43.4 436.3 410.4 -189.6 33.2 Year Employed GNP.deflator 65.4 43.4 GNP 639.5 436.3 Unemployed 755.3 410.4 Armed.Forces -274.8 -189.6 Population 50.3 33.2 Year 31.8 21.2 Employed 21.2 15.7 -------------------------------------------------------- Loblolly 84 3 44 4.898174 Best subsample: [1] 1 2 4 7 8 10 13 14 19 20 21 25 26 28 31 32 33 34 37 38 39 40 43 44 45 [26] 46 49 50 51 55 56 58 61 62 64 67 68 69 73 74 75 79 80 81 Outliers: 26 [1] 5 6 12 18 23 24 29 30 35 36 41 42 47 48 53 54 59 60 65 66 71 72 77 78 83 [26] 84 ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=44); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: height age Seed 20.44 8.19 7.72 Robust Estimate of Covariance: height age Seed height 439.77 141.10 21.15 age 141.10 45.61 5.32 Seed 21.15 5.32 30.27 -------------------------------------------------------- quakes 1000 4 502 8.274369 Best subsample: Too long... Outliers: 230 Too many to print ... ------------- Call: CovMcd(x = x, trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=502); nsamp = 500; (n,k)mini = (300,5) Robust Estimate of Location: lat long depth mag -21.31 182.48 361.35 4.54 Robust Estimate of Covariance: lat long depth mag lat 2.11e+01 5.07e+00 1.92e+02 -3.61e-01 long 5.07e+00 6.53e+00 -5.20e+02 6.26e-02 depth 1.92e+02 -5.20e+02 6.95e+04 -1.85e+01 mag -3.61e-01 6.26e-02 -1.85e+01 1.97e-01 -------------------------------------------------------- ======================================================== > dodata(method="deterministic") Call: dodata(method = "deterministic") Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 7 5.678742 Best subsample: [1] 1 3 4 5 7 9 11 Outliers: 0 Too many to print ... ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=7) Robust Estimate of Location: height weight 38.3 33.1 Robust Estimate of Covariance: height weight height 157 303 weight 303 660 -------------------------------------------------------- starsCYG 47 2 25 -8.028718 Best subsample: [1] 1 6 10 12 13 16 23 24 25 26 28 31 32 33 37 38 39 40 41 42 43 44 45 46 47 Outliers: 6 [1] 7 11 14 20 30 34 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=25) Robust Estimate of Location: log.Te log.light 4.41 4.95 Robust Estimate of Covariance: log.Te log.light log.Te 0.0171 0.0511 log.light 0.0511 0.3555 -------------------------------------------------------- phosphor 18 2 10 7.732906 Best subsample: [1] 2 4 5 7 8 9 11 12 14 16 Outliers: 1 [1] 6 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=10) Robust Estimate of Location: inorg organic 12.5 40.8 Robust Estimate of Covariance: inorg organic inorg 136 110 organic 110 215 -------------------------------------------------------- stackloss 21 3 12 6.577286 Best subsample: [1] 4 5 6 7 8 9 11 13 16 18 19 20 Outliers: 2 [1] 1 2 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=12) Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 58.4 20.5 86.1 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 64.90 15.37 30.77 Water.Temp 15.37 9.55 8.05 Acid.Conc. 30.77 8.05 43.78 -------------------------------------------------------- coleman 20 5 13 2.149184 Best subsample: [1] 3 4 5 7 8 12 13 14 16 17 18 19 20 Outliers: 2 [1] 6 10 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=13) Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.76 41.08 2.76 25.01 6.27 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.464 3.514 2.551 0.531 0.130 fatherWc 3.514 1614.996 526.259 14.543 39.038 sstatus 2.551 526.259 244.382 7.684 13.529 teacherSc 0.531 14.543 7.684 1.401 0.606 motherLev 0.130 39.038 13.529 0.606 1.093 -------------------------------------------------------- salinity 28 3 16 1.940763 Best subsample: [1] 1 8 10 12 13 14 15 17 18 20 21 22 25 26 27 28 Outliers: 2 [1] 5 16 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=16) Robust Estimate of Location: X1 X2 X3 10.50 2.58 23.12 Robust Estimate of Covariance: X1 X2 X3 X1 12.02759 -0.00504 -1.61240 X2 -0.00504 4.24789 -2.14688 X3 -1.61240 -2.14688 3.54596 -------------------------------------------------------- wood 20 5 13 -35.240819 Best subsample: [1] 1 2 3 5 9 11 12 13 14 15 17 18 20 Outliers: 4 [1] 4 6 8 19 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=13) Robust Estimate of Location: x1 x2 x3 x4 x5 0.582 0.125 0.530 0.534 0.888 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 1.33e-02 2.28e-03 2.63e-03 -8.09e-04 -1.21e-03 x2 2.28e-03 7.01e-04 1.10e-03 -2.56e-04 -5.93e-05 x3 2.63e-03 1.10e-03 7.06e-03 -1.40e-03 -1.59e-05 x4 -8.09e-04 -2.56e-04 -1.40e-03 5.38e-03 3.28e-03 x5 -1.21e-03 -5.93e-05 -1.59e-05 3.28e-03 3.72e-03 -------------------------------------------------------- hbk 75 3 39 -1.045501 Best subsample: [1] 15 17 18 19 20 21 22 23 24 26 27 28 29 32 33 35 36 38 40 41 43 48 49 50 51 [26] 54 55 56 58 59 63 64 66 67 70 71 72 73 74 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=39) Robust Estimate of Location: X1 X2 X3 1.54 1.78 1.69 Robust Estimate of Covariance: X1 X2 X3 X1 1.6528 0.0741 0.1713 X2 0.0741 1.6823 0.2055 X3 0.1713 0.2055 1.5624 -------------------------------------------------------- Animals 28 2 15 14.555543 Best subsample: [1] 1 3 4 5 10 11 17 18 19 20 21 22 23 26 27 Outliers: 13 [1] 2 6 7 8 9 12 13 14 15 16 24 25 28 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=15) Robust Estimate of Location: body brain 18.7 64.9 Robust Estimate of Covariance: body brain body 2511 4258 brain 4258 15257 -------------------------------------------------------- bushfire 38 5 22 18.135810 Best subsample: [1] 1 2 3 4 5 6 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Outliers: 16 [1] 7 8 9 10 11 12 29 30 31 32 33 34 35 36 37 38 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=22) Robust Estimate of Location: V1 V2 V3 V4 V5 105 147 274 218 279 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 567 439 -2771 -624 -509 V2 439 387 -1843 -376 -318 V3 -2771 -1843 16367 4021 3196 V4 -624 -376 4021 1059 827 V5 -509 -318 3196 827 652 -------------------------------------------------------- lactic 20 2 11 0.359580 Best subsample: [1] 1 2 3 4 5 7 8 9 10 11 12 Outliers: 3 [1] 17 19 20 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=11) Robust Estimate of Location: X Y 3.86 5.01 Robust Estimate of Covariance: X Y X 19.8 27.3 Y 27.3 39.8 -------------------------------------------------------- pension 18 2 10 16.675508 Best subsample: [1] 1 2 3 4 5 6 8 9 11 12 Outliers: 4 [1] 15 16 17 18 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=10) Robust Estimate of Location: Income Reserves 52.3 560.9 Robust Estimate of Covariance: Income Reserves Income 2534 21294 Reserves 21294 372356 -------------------------------------------------------- radarImage 1573 5 789 36.694865 Best subsample: Too long... Outliers: 71 [1] 262 450 451 480 481 509 535 542 597 643 669 697 803 804 832 [16] 833 834 862 863 864 892 989 1123 1145 1223 1224 1232 1233 1249 1250 [31] 1267 1303 1347 1357 1375 1411 1419 1420 1443 1453 1504 1511 1512 1518 1519 [46] 1521 1525 1526 1543 1544 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 [61] 1557 1558 1561 1562 1564 1565 1566 1569 1570 1571 1573 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=789) Robust Estimate of Location: X.coord Y.coord Band.1 Band.2 Band.3 52.78 35.37 7.12 18.81 9.09 Robust Estimate of Covariance: X.coord Y.coord Band.1 Band.2 Band.3 X.coord 146.7 25.6 -433.2 -238.2 -29.0 Y.coord 25.6 489.0 55.4 -211.1 -39.8 Band.1 -433.2 55.4 32206.4 9690.0 558.8 Band.2 -238.2 -211.1 9690.0 30881.1 1126.6 Band.3 -29.0 -39.8 558.8 1126.6 5322.0 -------------------------------------------------------- NOxEmissions 8088 4 4046 2.474536 Best subsample: Too long... Outliers: 1515 Too many to print ... ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=4046) Robust Estimate of Location: julday LNOx LNOxEm sqrtWS 168.20 4.73 7.91 1.37 Robust Estimate of Covariance: julday LNOx LNOxEm sqrtWS julday 1.37e+04 1.79e+01 1.04e+00 -1.51e+01 LNOx 1.79e+01 7.05e-01 2.13e-01 -2.27e-01 LNOxEm 1.04e+00 2.13e-01 3.76e-01 6.49e-02 sqrtWS -1.51e+01 -2.27e-01 6.49e-02 3.09e-01 -------------------------------------------------------- vaso 39 2 21 -3.972244 Best subsample: [1] 3 4 8 14 18 19 20 21 22 23 24 25 26 27 28 33 34 35 37 38 39 Outliers: 3 [1] 1 2 17 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=21) Robust Estimate of Location: Volume Rate 1.16 1.72 Robust Estimate of Covariance: Volume Rate Volume 0.406 -0.216 Rate -0.216 0.945 -------------------------------------------------------- wagnerGrowth 63 6 35 6.511864 Best subsample: [1] 2 3 4 5 6 7 9 10 11 12 13 16 17 18 20 23 25 27 31 32 35 36 38 41 44 [26] 48 51 52 53 54 55 56 57 60 62 Outliers: 10 [1] 1 8 21 22 29 33 42 43 50 63 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=35) Robust Estimate of Location: Region PA GPA HS GHS y 10.91 33.65 -2.05 2.43 0.31 6.98 Robust Estimate of Covariance: Region PA GPA HS GHS y Region 46.5443 23.4853 -1.8550 -0.8681 -0.6263 -19.7780 PA 23.4853 37.6600 -7.3182 -1.6484 -0.0598 -39.2343 GPA -1.8550 -7.3182 6.9108 0.5237 -0.2851 5.0671 HS -0.8681 -1.6484 0.5237 0.9635 -0.0142 2.8499 GHS -0.6263 -0.0598 -0.2851 -0.0142 0.2289 1.1180 y -19.7780 -39.2343 5.0671 2.8499 1.1180 104.7167 -------------------------------------------------------- fish 159 6 82 8.880459 Best subsample: [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 20 21 22 23 24 25 26 27 35 36 37 42 43 44 45 46 47 48 49 [39] 50 51 52 53 54 55 56 57 58 59 60 106 107 108 109 110 111 112 113 [58] 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 [77] 134 135 136 137 138 139 Outliers: 51 [1] 39 41 62 63 65 68 69 73 74 75 76 77 78 79 80 81 82 83 84 [20] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 [39] 143 145 148 150 151 152 153 154 155 156 157 158 159 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=82) Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 316.3 24.1 26.3 29.3 31.0 14.7 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 98110.10 2142.90 2339.56 2908.93 2155.78 -92.78 Length1 2142.90 51.81 56.20 68.39 44.38 -1.91 Length2 2339.56 56.20 61.08 74.40 48.88 -2.04 Length3 2908.93 68.39 74.40 92.29 65.28 -3.27 Height 2155.78 44.38 48.88 65.28 70.56 -4.04 Width -92.78 -1.91 -2.04 -3.27 -4.04 1.54 -------------------------------------------------------- pottery 27 6 17 -10.586933 Best subsample: [1] 1 2 4 5 6 9 10 11 13 14 15 19 20 21 22 26 27 Outliers: 9 [1] 3 8 12 16 17 18 23 24 25 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=17) Robust Estimate of Location: SI AL FE MG CA TI 54.983 15.206 9.700 3.817 5.211 0.859 Robust Estimate of Covariance: SI AL FE MG CA TI SI 29.12922 3.23731 -0.02886 3.00952 -2.55067 0.12484 AL 3.23731 5.71205 -0.89190 -3.53767 0.29497 -0.02885 FE -0.02886 -0.89190 0.39349 0.75550 -0.49711 0.02020 MG 3.00952 -3.53767 0.75550 3.95652 -0.22341 0.04029 CA -2.55067 0.29497 -0.49711 -0.22341 1.74417 -0.04904 TI 0.12484 -0.02885 0.02020 0.04029 -0.04904 0.00248 -------------------------------------------------------- rice 105 6 56 -14.423048 Best subsample: [1] 4 6 8 10 13 15 16 17 18 25 27 29 30 31 32 33 34 36 37 [20] 38 44 45 47 51 52 53 55 59 60 65 66 67 70 72 74 76 78 79 [39] 80 81 82 83 84 85 86 90 92 93 94 95 97 98 99 100 101 105 Outliers: 13 [1] 9 19 28 40 42 43 49 58 62 64 71 75 77 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=56) Robust Estimate of Location: Favor Appearance Taste Stickiness -0.2950 0.0799 -0.1555 0.0363 Toughness Overall_evaluation 0.0530 -0.2284 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.539 0.451 0.546 0.518 -0.230 Appearance 0.451 0.707 0.686 0.660 -0.339 Taste 0.546 0.686 0.880 0.832 -0.412 Stickiness 0.518 0.660 0.832 0.950 -0.485 Toughness -0.230 -0.339 -0.412 -0.485 0.463 Overall_evaluation 0.645 0.775 0.971 0.980 -0.492 Overall_evaluation Favor 0.645 Appearance 0.775 Taste 0.971 Stickiness 0.980 Toughness -0.492 Overall_evaluation 1.143 -------------------------------------------------------- un86 73 7 40 17.117142 Best subsample: [1] 2 9 10 12 14 16 17 18 19 20 23 24 25 26 27 31 32 33 37 39 42 48 49 50 51 [26] 52 55 56 57 60 61 62 63 64 65 67 70 71 72 73 Outliers: 28 [1] 3 4 5 6 7 8 11 13 15 21 22 28 29 30 35 36 38 40 43 44 46 53 54 58 59 [26] 66 68 69 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=40) Robust Estimate of Location: POP MOR CAR DR GNP DEN TB 17.036 68.512 6.444 0.877 1.134 64.140 0.433 Robust Estimate of Covariance: POP MOR CAR DR GNP DEN POP 5.34e+02 2.89e+02 -9.30e+00 -2.82e-02 -3.06e+00 8.57e+01 MOR 2.89e+02 3.54e+03 -4.14e+02 -4.99e+01 -5.01e+01 -1.36e+03 CAR -9.30e+00 -4.14e+02 8.52e+01 8.55e+00 9.75e+00 1.16e+02 DR -2.82e-02 -4.99e+01 8.55e+00 1.34e+00 8.38e-01 2.51e+01 GNP -3.06e+00 -5.01e+01 9.75e+00 8.38e-01 2.11e+00 1.37e+01 DEN 8.57e+01 -1.36e+03 1.16e+02 2.51e+01 1.37e+01 5.22e+03 TB -9.01e-02 -1.47e+00 3.70e-01 2.93e-02 1.01e-02 -1.44e+00 TB POP -9.01e-02 MOR -1.47e+00 CAR 3.70e-01 DR 2.93e-02 GNP 1.01e-02 DEN -1.44e+00 TB 2.42e-02 -------------------------------------------------------- wages 39 10 19 23.119456 Best subsample: [1] 1 2 5 6 7 9 10 11 12 13 14 15 19 21 23 25 26 27 28 Outliers: 9 [1] 4 5 9 24 25 26 28 32 34 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=19) Robust Estimate of Location: HRS RATE ERSP ERNO NEIN ASSET AGE DEP 2161.89 2.95 1114.21 297.68 374.00 7269.37 39.13 2.43 RACE SCHOOL 36.13 10.39 Robust Estimate of Covariance: HRS RATE ERSP ERNO NEIN ASSET HRS 4.53e+03 1.06e+01 -7.63e+03 -8.23e+02 6.60e+03 1.44e+05 RATE 1.06e+01 2.28e-01 1.05e+01 3.46e+00 5.00e+01 1.14e+03 ERSP -7.63e+03 1.05e+01 2.44e+04 1.45e+03 -6.06e+03 -1.22e+05 ERNO -8.23e+02 3.46e+00 1.45e+03 2.31e+03 -4.56e+02 -9.39e+03 NEIN 6.60e+03 5.00e+01 -6.06e+03 -4.56e+02 1.76e+04 3.85e+05 ASSET 1.44e+05 1.14e+03 -1.22e+05 -9.39e+03 3.85e+05 8.48e+06 AGE -4.27e+01 -8.39e-02 1.07e+02 1.92e+00 -4.20e+01 -9.67e+02 DEP 5.77e+00 -5.14e-02 -3.55e+01 1.68e+00 -1.04e+01 -2.06e+02 RACE -1.66e+03 -7.76e+00 2.30e+03 1.90e+02 -3.30e+03 -7.16e+04 SCHOOL 3.85e+01 4.59e-01 -7.14e+00 3.64e+00 1.19e+02 2.69e+03 AGE DEP RACE SCHOOL HRS -4.27e+01 5.77e+00 -1.66e+03 3.85e+01 RATE -8.39e-02 -5.14e-02 -7.76e+00 4.59e-01 ERSP 1.07e+02 -3.55e+01 2.30e+03 -7.14e+00 ERNO 1.92e+00 1.68e+00 1.90e+02 3.64e+00 NEIN -4.20e+01 -1.04e+01 -3.30e+03 1.19e+02 ASSET -9.67e+02 -2.06e+02 -7.16e+04 2.69e+03 AGE 8.41e-01 -2.11e-01 1.45e+01 -3.42e-01 DEP -2.11e-01 1.18e-01 3.05e-01 -7.70e-02 RACE 1.45e+01 3.05e-01 7.34e+02 -2.13e+01 SCHOOL -3.42e-01 -7.70e-02 -2.13e+01 1.02e+00 -------------------------------------------------------- airquality 153 4 58 18.316848 Best subsample: [1] 2 3 8 10 24 25 28 32 33 35 36 37 38 39 40 41 42 43 46 [20] 47 48 49 50 52 54 56 57 58 59 60 66 67 69 71 72 73 76 78 [39] 81 82 84 86 87 89 90 91 92 95 97 98 100 101 105 106 108 109 110 [58] 111 Outliers: 8 [1] 9 15 18 30 48 62 117 148 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=58) Robust Estimate of Location: Ozone Solar.R Wind Temp 40.80 189.37 9.66 78.81 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 1045.53 958.61 -62.92 246.40 Solar.R 958.61 9508.06 1.52 173.36 Wind -62.92 1.52 11.07 -12.97 Temp 246.40 173.36 -12.97 93.87 -------------------------------------------------------- attitude 30 7 19 24.464288 Best subsample: [1] 2 3 4 5 7 8 10 11 12 15 17 19 21 22 23 25 27 28 29 Outliers: 5 [1] 9 14 16 18 24 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=19) Robust Estimate of Location: rating complaints privileges learning raises critical 64.4 65.2 51.0 55.5 65.9 77.4 advance 43.2 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 265.87 215.88 154.02 213.33 171.36 -18.02 88.03 complaints 215.88 272.36 173.30 226.92 199.70 21.65 128.53 privileges 154.02 173.30 241.08 202.94 141.68 6.01 121.58 learning 213.33 226.92 202.94 283.29 208.18 13.19 117.42 raises 171.36 199.70 141.68 208.18 202.17 30.71 111.69 critical -18.02 21.65 6.01 13.19 30.71 106.67 36.10 advance 88.03 128.53 121.58 117.42 111.69 36.10 126.99 -------------------------------------------------------- attenu 182 5 86 6.593068 Best subsample: [1] 41 42 43 44 48 49 51 68 70 72 73 74 75 76 77 82 83 84 85 [20] 86 87 88 89 90 91 92 101 102 103 104 106 107 109 110 111 112 113 114 [39] 115 116 117 119 120 121 122 124 125 126 127 128 129 130 131 132 133 134 135 [58] 136 137 138 139 140 141 144 145 146 147 148 149 150 151 152 153 154 155 156 [77] 157 158 159 160 161 162 163 164 165 166 Outliers: 40 [1] 2 4 5 6 7 8 9 10 11 13 15 16 19 20 21 22 23 24 25 [20] 27 28 29 30 31 32 47 59 60 61 64 65 82 97 98 100 101 102 103 [39] 104 105 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=86) Robust Estimate of Location: event mag station dist accel 17.122 5.798 63.461 25.015 0.131 Robust Estimate of Covariance: event mag station dist accel event 4.26e+01 -2.26e+00 1.36e+02 -1.20e+01 -5.13e-02 mag -2.26e+00 6.10e-01 -5.55e+00 4.48e+00 7.58e-03 station 1.36e+02 -5.55e+00 1.58e+03 3.72e+01 7.69e-01 dist -1.20e+01 4.48e+00 3.72e+01 3.81e+02 -1.32e+00 accel -5.13e-02 7.58e-03 7.69e-01 -1.32e+00 1.11e-02 -------------------------------------------------------- USJudgeRatings 43 12 28 -47.886937 Best subsample: [1] 2 3 4 6 9 10 11 15 16 18 19 22 24 25 26 27 28 29 30 32 33 34 36 37 38 [26] 40 41 43 Outliers: 14 [1] 1 5 7 8 12 13 14 17 20 21 23 31 35 42 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=28) Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.46 8.26 7.88 8.06 7.85 7.92 7.84 7.83 7.67 7.74 8.31 8.03 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 0.9226 -0.3654 -0.5254 -0.2434 -0.0695 -0.0865 -0.2133 -0.2164 INTG -0.3654 0.5236 0.6906 0.5222 0.3980 0.3887 0.5322 0.5361 DMNR -0.5254 0.6906 1.0201 0.6586 0.5127 0.4929 0.6634 0.6383 DILG -0.2434 0.5222 0.6586 0.6039 0.4892 0.4785 0.6333 0.6396 CFMG -0.0695 0.3980 0.5127 0.4892 0.4505 0.4220 0.5237 0.5270 DECI -0.0865 0.3887 0.4929 0.4785 0.4220 0.4148 0.5181 0.5255 PREP -0.2133 0.5322 0.6634 0.6333 0.5237 0.5181 0.7076 0.7207 FAMI -0.2164 0.5361 0.6383 0.6396 0.5270 0.5255 0.7207 0.7542 ORAL -0.2643 0.5580 0.7074 0.6333 0.5263 0.5164 0.6985 0.7186 WRIT -0.2548 0.5527 0.6848 0.6374 0.5290 0.5196 0.7007 0.7251 PHYS -0.2035 0.3230 0.3964 0.3550 0.2842 0.2959 0.3895 0.4115 RTEN -0.3286 0.6105 0.7924 0.6520 0.5193 0.5114 0.6876 0.7011 ORAL WRIT PHYS RTEN CONT -0.2643 -0.2548 -0.2035 -0.3286 INTG 0.5580 0.5527 0.3230 0.6105 DMNR 0.7074 0.6848 0.3964 0.7924 DILG 0.6333 0.6374 0.3550 0.6520 CFMG 0.5263 0.5290 0.2842 0.5193 DECI 0.5164 0.5196 0.2959 0.5114 PREP 0.6985 0.7007 0.3895 0.6876 FAMI 0.7186 0.7251 0.4115 0.7011 ORAL 0.7143 0.7113 0.4114 0.7127 WRIT 0.7113 0.7161 0.4094 0.7074 PHYS 0.4114 0.4094 0.2885 0.4145 RTEN 0.7127 0.7074 0.4145 0.7590 -------------------------------------------------------- USArrests 50 4 27 15.438912 Best subsample: [1] 4 7 12 13 14 15 16 19 21 23 25 26 27 29 30 32 34 35 36 38 41 43 45 46 48 [26] 49 50 Outliers: 6 [1] 2 5 6 24 28 33 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=27) Robust Estimate of Location: Murder Assault UrbanPop Rape 6.91 150.10 65.88 18.75 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 23.4 372.7 23.0 32.7 Assault 372.7 8582.9 685.5 607.2 UrbanPop 23.0 685.5 276.7 65.9 Rape 32.7 607.2 65.9 73.7 -------------------------------------------------------- longley 16 7 12 12.747678 Best subsample: [1] 5 6 7 8 9 10 11 12 13 14 15 16 Outliers: 4 [1] 1 2 3 4 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=12) Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 106.5 430.6 328.2 295.0 120.2 Year Employed 1956.5 66.9 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 137.5 1318.8 1562.4 -590.5 103.2 GNP 1318.8 13062.4 14155.2 -5424.8 1018.8 Unemployed 1562.4 14155.2 25109.6 -7362.7 1178.3 Armed.Forces -590.5 -5424.8 -7362.7 3557.9 -415.1 Population 103.2 1018.8 1178.3 -415.1 80.5 Year 65.4 639.5 755.3 -274.8 50.3 Employed 43.4 436.3 410.4 -189.6 33.2 Year Employed GNP.deflator 65.4 43.4 GNP 639.5 436.3 Unemployed 755.3 410.4 Armed.Forces -274.8 -189.6 Population 50.3 33.2 Year 31.8 21.2 Employed 21.2 15.7 -------------------------------------------------------- Loblolly 84 3 44 4.898174 Best subsample: [1] 1 2 4 7 8 10 13 14 19 20 21 25 26 28 31 32 33 34 37 38 39 40 43 44 45 [26] 46 49 50 51 55 56 58 61 62 64 67 68 69 73 74 75 79 80 81 Outliers: 26 [1] 5 6 12 18 23 24 29 30 35 36 41 42 47 48 53 54 59 60 65 66 71 72 77 78 83 [26] 84 ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=44) Robust Estimate of Location: height age Seed 20.44 8.19 7.72 Robust Estimate of Covariance: height age Seed height 439.77 141.10 21.15 age 141.10 45.61 5.32 Seed 21.15 5.32 30.27 -------------------------------------------------------- quakes 1000 4 502 8.274209 Best subsample: Too long... Outliers: 231 Too many to print ... ------------- Call: CovMcd(x = x, nsamp = "deterministic", trace = FALSE) -> Method: Deterministic MCD(alpha=0.5 ==> h=502) Robust Estimate of Location: lat long depth mag -21.34 182.47 360.58 4.54 Robust Estimate of Covariance: lat long depth mag lat 2.15e+01 5.14e+00 1.97e+02 -3.83e-01 long 5.14e+00 6.54e+00 -5.19e+02 6.67e-02 depth 1.97e+02 -5.19e+02 6.95e+04 -1.96e+01 mag -3.83e-01 6.67e-02 -1.96e+01 1.92e-01 -------------------------------------------------------- ======================================================== > dodata(method="exact") Call: dodata(method = "exact") Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 7 5.678742 Best subsample: [1] 1 3 4 5 7 9 11 Outliers: 0 Too many to print ... ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=7); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: height weight 38.3 33.1 Robust Estimate of Covariance: height weight height 157 303 weight 303 660 -------------------------------------------------------- starsCYG 47 2 25 -8.031215 Best subsample: [1] 1 2 4 6 8 10 12 13 16 24 25 26 28 32 33 37 38 39 40 41 42 43 44 45 46 Outliers: 6 [1] 7 11 14 20 30 34 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=25); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: log.Te log.light 4.41 4.95 Robust Estimate of Covariance: log.Te log.light log.Te 0.0171 0.0511 log.light 0.0511 0.3555 -------------------------------------------------------- phosphor 18 2 10 6.878847 Best subsample: [1] 3 5 8 9 11 12 13 14 15 17 Outliers: 2 [1] 1 6 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=10); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: inorg organic 13.4 38.8 Robust Estimate of Covariance: inorg organic inorg 181 184 organic 184 256 -------------------------------------------------------- coleman 20 5 13 1.286808 Best subsample: [1] 2 3 4 5 7 8 12 13 14 16 17 19 20 Outliers: 7 [1] 1 6 9 10 11 15 18 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=13); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.76 48.38 6.12 25.00 6.40 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.381 2.685 -0.400 0.228 0.113 fatherWc 2.685 1959.466 496.858 18.948 51.871 sstatus -0.400 496.858 180.236 5.762 15.230 teacherSc 0.228 18.948 5.762 1.180 0.835 motherLev 0.113 51.871 15.230 0.835 1.567 -------------------------------------------------------- salinity 28 3 16 1.326364 Best subsample: [1] 1 2 6 7 8 12 13 14 18 20 21 22 25 26 27 28 Outliers: 4 [1] 5 16 23 24 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=16); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: X1 X2 X3 10.08 2.78 22.78 Robust Estimate of Covariance: X1 X2 X3 X1 13.87 1.34 -4.24 X2 1.34 5.10 -1.92 X3 -4.24 -1.92 3.17 -------------------------------------------------------- wood 20 5 13 -36.270094 Best subsample: [1] 1 2 3 5 9 10 12 13 14 15 17 18 20 Outliers: 7 [1] 4 6 7 8 11 16 19 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=13); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: x1 x2 x3 x4 x5 0.587 0.122 0.531 0.538 0.892 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 1.51e-02 2.83e-03 4.74e-03 -8.81e-04 -2.45e-03 x2 2.83e-03 7.29e-04 1.91e-03 -7.82e-05 3.55e-05 x3 4.74e-03 1.91e-03 9.97e-03 -1.31e-03 5.30e-04 x4 -8.81e-04 -7.82e-05 -1.31e-03 4.28e-03 2.75e-03 x5 -2.45e-03 3.55e-05 5.30e-04 2.75e-03 4.16e-03 -------------------------------------------------------- Animals 28 2 15 14.555543 Best subsample: [1] 1 3 4 5 10 11 17 18 19 20 21 22 23 26 27 Outliers: 13 [1] 2 6 7 8 9 12 13 14 15 16 24 25 28 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=15); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: body brain 18.7 64.9 Robust Estimate of Covariance: body brain body 2511 4258 brain 4258 15257 -------------------------------------------------------- lactic 20 2 11 0.359580 Best subsample: [1] 1 2 3 4 5 7 8 9 10 11 12 Outliers: 3 [1] 17 19 20 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=11); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: X Y 3.86 5.01 Robust Estimate of Covariance: X Y X 19.8 27.3 Y 27.3 39.8 -------------------------------------------------------- pension 18 2 10 16.675508 Best subsample: [1] 1 2 3 4 5 6 8 9 11 12 Outliers: 4 [1] 15 16 17 18 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=10); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: Income Reserves 52.3 560.9 Robust Estimate of Covariance: Income Reserves Income 2534 21294 Reserves 21294 372356 -------------------------------------------------------- vaso 39 2 21 -3.972244 Best subsample: [1] 3 4 8 14 18 19 20 21 22 23 24 25 26 27 28 33 34 35 37 38 39 Outliers: 3 [1] 1 2 17 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=21); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: Volume Rate 1.16 1.72 Robust Estimate of Covariance: Volume Rate Volume 0.406 -0.216 Rate -0.216 0.945 -------------------------------------------------------- stackloss 21 3 12 5.472581 Best subsample: [1] 4 5 6 7 8 9 10 11 12 13 14 20 Outliers: 9 [1] 1 2 3 15 16 17 18 19 21 ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=12); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 59.5 20.8 87.3 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 12.6 11.7 11.5 Water.Temp 11.7 18.5 12.3 Acid.Conc. 11.5 12.3 46.6 -------------------------------------------------------- pilot 20 2 11 6.487287 Best subsample: [1] 2 3 6 7 9 12 15 16 17 18 20 Outliers: 0 Too many to print ... ------------- Call: CovMcd(x = x, nsamp = "exact", trace = FALSE) -> Method: Fast MCD(alpha=0.5 ==> h=11); nsamp = exact; (n,k)mini = (300,5) Robust Estimate of Location: X Y 101.1 67.7 Robust Estimate of Covariance: X Y X 4069 1301 Y 1301 418 -------------------------------------------------------- ======================================================== > dodata(method="MRCD") Call: dodata(method = "MRCD") Data Set n p Half LOG(obj) Time ======================================================== heart 12 2 6 7.446266 Best subsample: [1] 1 3 4 7 9 11 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=6) Robust Estimate of Location: height weight 38.8 33.0 Robust Estimate of Covariance: height weight height 47.4 75.2 weight 75.2 155.4 -------------------------------------------------------- starsCYG 47 2 24 -5.862050 Best subsample: [1] 1 6 10 12 13 16 23 24 25 26 28 31 33 37 38 39 40 41 42 43 44 45 46 47 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=24) Robust Estimate of Location: log.Te log.light 4.44 5.05 Robust Estimate of Covariance: log.Te log.light log.Te 0.00867 0.02686 log.light 0.02686 0.41127 -------------------------------------------------------- phosphor 18 2 9 9.954788 Best subsample: [1] 4 7 8 9 11 12 13 14 16 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=9) Robust Estimate of Location: inorg organic 12.5 39.0 Robust Estimate of Covariance: inorg organic inorg 236 140 organic 140 172 -------------------------------------------------------- stackloss 21 3 11 7.991165 Best subsample: [1] 4 5 6 7 8 9 10 13 18 19 20 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=11) Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 58.2 21.4 85.2 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 49.8 17.2 42.7 Water.Temp 17.2 13.8 25.2 Acid.Conc. 42.7 25.2 58.2 -------------------------------------------------------- coleman 20 5 10 5.212156 Best subsample: [1] 3 4 5 7 8 9 14 16 19 20 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=10) Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.78 59.44 9.28 25.41 6.70 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.1582 -0.2826 0.4112 0.1754 0.0153 fatherWc -0.2826 902.9210 201.5815 -2.1236 18.8736 sstatus 0.4112 201.5815 65.4580 -0.3876 4.7794 teacherSc 0.1754 -2.1236 -0.3876 0.7233 -0.0322 motherLev 0.0153 18.8736 4.7794 -0.0322 0.5417 -------------------------------------------------------- salinity 28 3 14 3.586919 Best subsample: [1] 1 7 8 12 13 14 18 20 21 22 25 26 27 28 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=14) Robust Estimate of Location: X1 X2 X3 10.95 3.71 21.99 Robust Estimate of Covariance: X1 X2 X3 X1 14.153 0.718 -3.359 X2 0.718 3.565 -0.722 X3 -3.359 -0.722 1.607 -------------------------------------------------------- wood 20 5 10 -33.100492 Best subsample: [1] 1 2 3 5 11 14 15 17 18 20 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=10) Robust Estimate of Location: x1 x2 x3 x4 x5 0.572 0.120 0.504 0.545 0.899 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 0.007543 0.001720 0.000412 -0.001230 -0.001222 x2 0.001720 0.000568 0.000355 -0.000533 -0.000132 x3 0.000412 0.000355 0.002478 0.000190 0.000811 x4 -0.001230 -0.000533 0.000190 0.002327 0.000967 x5 -0.001222 -0.000132 0.000811 0.000967 0.001894 -------------------------------------------------------- hbk 75 3 38 1.539545 Best subsample: [1] 15 17 18 19 20 21 22 23 24 26 27 29 32 33 35 36 38 40 41 43 48 49 50 51 54 [26] 55 56 58 59 63 64 66 67 70 71 72 73 74 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=38) Robust Estimate of Location: X1 X2 X3 1.60 2.37 1.64 Robust Estimate of Covariance: X1 X2 X3 X1 2.810 0.124 1.248 X2 0.124 1.017 0.208 X3 1.248 0.208 2.218 -------------------------------------------------------- Animals 28 2 14 16.278395 Best subsample: [1] 1 3 4 5 10 11 18 19 20 21 22 23 26 27 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=14) Robust Estimate of Location: body brain 19.5 56.8 Robust Estimate of Covariance: body brain body 2802 5179 brain 5179 13761 -------------------------------------------------------- bushfire 38 5 19 28.483413 Best subsample: [1] 1 2 3 4 5 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=19) Robust Estimate of Location: V1 V2 V3 V4 V5 103 145 287 221 281 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 366 249 -1993 -503 -396 V2 249 252 -1223 -291 -233 V3 -1993 -1223 14246 3479 2718 V4 -503 -291 3479 1083 748 V5 -396 -233 2718 748 660 -------------------------------------------------------- lactic 20 2 10 2.593141 Best subsample: [1] 1 2 3 4 5 7 8 9 10 11 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=10) Robust Estimate of Location: X Y 2.60 3.63 Robust Estimate of Covariance: X Y X 8.13 13.54 Y 13.54 24.17 -------------------------------------------------------- pension 18 2 9 18.931204 Best subsample: [1] 2 3 4 5 6 8 9 11 12 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=9) Robust Estimate of Location: Income Reserves 45.7 466.9 Robust Estimate of Covariance: Income Reserves Income 2127 23960 Reserves 23960 348275 -------------------------------------------------------- vaso 39 2 20 -1.864710 Best subsample: [1] 3 4 8 14 18 20 21 22 23 24 25 26 27 28 33 34 35 37 38 39 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=20) Robust Estimate of Location: Volume Rate 1.14 1.77 Robust Estimate of Covariance: Volume Rate Volume 0.44943 -0.00465 Rate -0.00465 0.34480 -------------------------------------------------------- wagnerGrowth 63 6 32 9.287760 Best subsample: [1] 2 3 4 5 6 7 9 10 11 12 16 18 20 23 25 27 31 32 35 36 38 41 44 48 52 [26] 53 54 55 56 57 60 62 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=32) Robust Estimate of Location: Region PA GPA HS GHS y 10.719 33.816 -2.144 2.487 0.293 4.918 Robust Estimate of Covariance: Region PA GPA HS GHS y Region 56.7128 17.4919 -2.9710 -0.6491 -0.4545 -10.4287 PA 17.4919 29.9968 -7.6846 -1.3141 0.5418 -35.6434 GPA -2.9710 -7.6846 6.3238 1.1257 -0.4757 12.4707 HS -0.6491 -1.3141 1.1257 1.1330 -0.0915 3.3617 GHS -0.4545 0.5418 -0.4757 -0.0915 0.1468 -1.1228 y -10.4287 -35.6434 12.4707 3.3617 -1.1228 67.4215 -------------------------------------------------------- fish 159 6 79 22.142828 Best subsample: [1] 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 [20] 22 23 24 25 26 27 35 36 37 42 43 44 45 46 47 48 49 50 51 [39] 52 53 54 55 56 57 58 59 60 71 105 106 107 109 110 111 113 114 115 [58] 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 134 135 136 [77] 137 138 139 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=79) Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 291.7 23.8 25.9 28.9 30.4 14.7 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 77155.07 1567.55 1713.74 2213.16 1912.62 -103.97 Length1 1567.55 45.66 41.57 52.14 38.66 -2.39 Length2 1713.74 41.57 54.26 56.77 42.72 -2.55 Length3 2213.16 52.14 56.77 82.57 58.84 -3.65 Height 1912.62 38.66 42.72 58.84 70.51 -3.80 Width -103.97 -2.39 -2.55 -3.65 -3.80 1.19 -------------------------------------------------------- pottery 27 6 14 -6.897459 Best subsample: [1] 1 2 4 5 6 10 11 13 14 15 19 21 22 26 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=14) Robust Estimate of Location: SI AL FE MG CA TI 54.39 14.93 9.78 3.82 5.11 0.86 Robust Estimate of Covariance: SI AL FE MG CA TI SI 17.47469 -0.16656 0.39943 4.48192 -0.71153 0.06515 AL -0.16656 3.93154 -0.35738 -2.29899 0.14770 -0.02050 FE 0.39943 -0.35738 0.20434 0.37562 -0.22460 0.00943 MG 4.48192 -2.29899 0.37562 2.82339 -0.16027 0.02943 CA -0.71153 0.14770 -0.22460 -0.16027 0.88443 -0.01711 TI 0.06515 -0.02050 0.00943 0.02943 -0.01711 0.00114 -------------------------------------------------------- rice 105 6 53 -8.916472 Best subsample: [1] 4 6 8 10 13 15 16 17 18 25 27 29 30 31 32 33 34 36 37 [20] 38 44 45 47 51 52 53 54 55 59 60 65 67 70 72 76 79 80 81 [39] 82 83 84 85 86 90 92 93 94 95 97 98 99 101 105 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=53) Robust Estimate of Location: Favor Appearance Taste Stickiness -0.1741 0.0774 -0.0472 0.1868 Toughness Overall_evaluation -0.0346 -0.0683 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.402 0.306 0.378 0.364 -0.134 Appearance 0.306 0.508 0.474 0.407 -0.146 Taste 0.378 0.474 0.708 0.611 -0.258 Stickiness 0.364 0.407 0.611 0.795 -0.320 Toughness -0.134 -0.146 -0.258 -0.320 0.302 Overall_evaluation 0.453 0.536 0.746 0.745 -0.327 Overall_evaluation Favor 0.453 Appearance 0.536 Taste 0.746 Stickiness 0.745 Toughness -0.327 Overall_evaluation 0.963 -------------------------------------------------------- un86 73 7 37 19.832993 Best subsample: [1] 9 10 12 14 16 17 18 20 23 24 25 26 27 31 32 33 37 39 42 48 49 50 51 52 55 [26] 56 57 60 62 63 64 65 67 70 71 72 73 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=37) Robust Estimate of Location: POP MOR CAR DR GNP DEN TB 14.462 66.892 6.670 0.858 1.251 55.518 0.429 Robust Estimate of Covariance: POP MOR CAR DR GNP DEN POP 3.00e+02 1.58e+02 9.83e+00 2.74e+00 5.51e-01 6.87e+01 MOR 1.58e+02 2.96e+03 -4.24e+02 -4.72e+01 -5.40e+01 -1.01e+03 CAR 9.83e+00 -4.24e+02 9.12e+01 8.71e+00 1.13e+01 1.96e+02 DR 2.74e+00 -4.72e+01 8.71e+00 1.25e+00 1.03e+00 2.74e+01 GNP 5.51e-01 -5.40e+01 1.13e+01 1.03e+00 2.31e+00 2.36e+01 DEN 6.87e+01 -1.01e+03 1.96e+02 2.74e+01 2.36e+01 3.12e+03 TB 2.04e-02 -1.81e+00 3.42e-01 2.57e-02 2.09e-02 -6.88e-01 TB POP 2.04e-02 MOR -1.81e+00 CAR 3.42e-01 DR 2.57e-02 GNP 2.09e-02 DEN -6.88e-01 TB 2.59e-02 -------------------------------------------------------- wages 39 10 14 35.698016 Best subsample: [1] 1 2 5 6 9 10 11 13 15 19 23 25 26 28 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=14) Robust Estimate of Location: HRS RATE ERSP ERNO NEIN ASSET AGE DEP 2167.71 2.96 1113.50 300.43 382.29 7438.00 39.06 2.41 RACE SCHOOL 33.00 10.45 Robust Estimate of Covariance: HRS RATE ERSP ERNO NEIN ASSET HRS 1.97e+03 -4.14e-01 -4.71e+03 -6.58e+02 1.81e+03 3.84e+04 RATE -4.14e-01 1.14e-01 1.79e+01 3.08e+00 1.40e+01 3.57e+02 ERSP -4.71e+03 1.79e+01 1.87e+04 2.33e+03 -2.06e+03 -3.57e+04 ERNO -6.58e+02 3.08e+00 2.33e+03 5.36e+02 -3.42e+02 -5.56e+03 NEIN 1.81e+03 1.40e+01 -2.06e+03 -3.42e+02 5.77e+03 1.10e+05 ASSET 3.84e+04 3.57e+02 -3.57e+04 -5.56e+03 1.10e+05 2.86e+06 AGE -1.83e+01 1.09e-02 6.69e+01 8.78e+00 -5.07e+00 -1.51e+02 DEP 4.82e+00 -3.14e-02 -2.52e+01 -2.96e+00 -5.33e+00 -1.03e+02 RACE -5.67e+02 -1.33e+00 1.21e+03 1.81e+02 -9.13e+02 -1.96e+04 SCHOOL 5.33e+00 1.87e-01 1.86e+01 3.12e+00 3.20e+01 7.89e+02 AGE DEP RACE SCHOOL HRS -1.83e+01 4.82e+00 -5.67e+02 5.33e+00 RATE 1.09e-02 -3.14e-02 -1.33e+00 1.87e-01 ERSP 6.69e+01 -2.52e+01 1.21e+03 1.86e+01 ERNO 8.78e+00 -2.96e+00 1.81e+02 3.12e+00 NEIN -5.07e+00 -5.33e+00 -9.13e+02 3.20e+01 ASSET -1.51e+02 -1.03e+02 -1.96e+04 7.89e+02 AGE 5.71e-01 -1.56e-01 4.58e+00 -5.00e-02 DEP -1.56e-01 8.08e-02 -3.02e-01 -4.47e-02 RACE 4.58e+00 -3.02e-01 2.36e+02 -4.54e+00 SCHOOL -5.00e-02 -4.47e-02 -4.54e+00 4.23e-01 -------------------------------------------------------- airquality 153 4 56 21.136376 Best subsample: [1] 2 3 8 10 24 25 28 32 33 35 36 37 38 39 40 41 42 43 46 [20] 47 48 49 52 54 56 57 58 59 60 66 67 69 71 72 73 76 78 81 [39] 82 84 86 87 89 90 91 92 96 97 98 100 101 105 106 109 110 111 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=56) Robust Estimate of Location: Ozone Solar.R Wind Temp 41.84 197.21 8.93 80.39 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 1480.7 1562.8 -99.9 347.3 Solar.R 1562.8 11401.2 -35.2 276.8 Wind -99.9 -35.2 11.4 -23.5 Temp 347.3 276.8 -23.5 107.7 -------------------------------------------------------- attitude 30 7 15 27.040805 Best subsample: [1] 2 3 4 5 7 8 10 12 15 19 22 23 25 27 28 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=15) Robust Estimate of Location: rating complaints privileges learning raises critical 65.8 66.5 50.1 56.1 66.7 78.1 advance 41.7 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 138.77 80.02 59.22 107.33 95.83 -1.24 54.36 complaints 80.02 97.23 50.59 99.50 79.15 -2.71 42.81 privileges 59.22 50.59 84.92 90.03 60.88 22.39 44.93 learning 107.33 99.50 90.03 187.67 128.71 15.48 63.67 raises 95.83 79.15 60.88 128.71 123.94 -1.46 49.98 critical -1.24 -2.71 22.39 15.48 -1.46 61.23 12.88 advance 54.36 42.81 44.93 63.67 49.98 12.88 48.61 -------------------------------------------------------- attenu 182 5 83 9.710111 Best subsample: [1] 41 42 43 44 48 49 51 68 70 72 73 74 75 76 77 82 83 84 85 [20] 86 87 88 89 90 91 92 101 102 103 104 106 107 109 110 111 112 113 114 [39] 115 116 117 121 122 124 125 126 127 128 129 130 131 132 133 134 135 136 137 [58] 138 139 140 141 144 145 146 147 148 149 150 151 152 153 155 156 157 158 159 [77] 160 161 162 163 164 165 166 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=83) Robust Estimate of Location: event mag station dist accel 18.940 5.741 67.988 23.365 0.124 Robust Estimate of Covariance: event mag station dist accel event 2.86e+01 -2.31e+00 1.02e+02 2.68e+01 -1.99e-01 mag -2.31e+00 6.17e-01 -7.03e+00 4.67e-01 2.59e-02 station 1.02e+02 -7.03e+00 1.66e+03 1.62e+02 7.96e-02 dist 2.68e+01 4.67e-01 1.62e+02 3.61e+02 -1.23e+00 accel -1.99e-01 2.59e-02 7.96e-02 -1.23e+00 9.42e-03 -------------------------------------------------------- USJudgeRatings 43 12 22 -23.463708 Best subsample: [1] 2 3 4 6 9 11 15 16 18 19 24 25 26 27 28 29 32 33 34 36 37 38 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=22) Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.24 8.42 8.10 8.19 7.95 8.00 7.96 7.96 7.81 7.89 8.40 8.20 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP CONT 0.61805 -0.05601 -0.09540 0.00694 0.09853 0.06261 0.03939 INTG -0.05601 0.23560 0.27537 0.20758 0.16603 0.17281 0.21128 DMNR -0.09540 0.27537 0.55349 0.28872 0.24014 0.24293 0.28886 DILG 0.00694 0.20758 0.28872 0.34099 0.23502 0.23917 0.29672 CFMG 0.09853 0.16603 0.24014 0.23502 0.31649 0.23291 0.27651 DECI 0.06261 0.17281 0.24293 0.23917 0.23291 0.30681 0.27737 PREP 0.03939 0.21128 0.28886 0.29672 0.27651 0.27737 0.42020 FAMI 0.04588 0.20388 0.26072 0.29037 0.27179 0.27737 0.34857 ORAL 0.03000 0.21379 0.29606 0.28764 0.27338 0.27424 0.33503 WRIT 0.03261 0.20258 0.26931 0.27962 0.26382 0.26610 0.32677 PHYS -0.04485 0.13598 0.17659 0.16834 0.14554 0.16467 0.18948 RTEN 0.01543 0.22654 0.32117 0.27307 0.23826 0.24669 0.29450 FAMI ORAL WRIT PHYS RTEN CONT 0.04588 0.03000 0.03261 -0.04485 0.01543 INTG 0.20388 0.21379 0.20258 0.13598 0.22654 DMNR 0.26072 0.29606 0.26931 0.17659 0.32117 DILG 0.29037 0.28764 0.27962 0.16834 0.27307 CFMG 0.27179 0.27338 0.26382 0.14554 0.23826 DECI 0.27737 0.27424 0.26610 0.16467 0.24669 PREP 0.34857 0.33503 0.32677 0.18948 0.29450 FAMI 0.47232 0.33762 0.33420 0.19759 0.29015 ORAL 0.33762 0.40361 0.32208 0.19794 0.29544 WRIT 0.33420 0.32208 0.38733 0.19276 0.28184 PHYS 0.19759 0.19794 0.19276 0.20284 0.18097 RTEN 0.29015 0.29544 0.28184 0.18097 0.36877 -------------------------------------------------------- USArrests 50 4 25 17.834643 Best subsample: [1] 4 7 12 13 14 15 16 19 21 23 25 26 27 29 30 32 34 35 36 38 41 45 46 49 50 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=25) Robust Estimate of Location: Murder Assault UrbanPop Rape 5.38 121.68 63.80 16.33 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 17.8 316.3 48.5 31.1 Assault 316.3 6863.0 1040.0 548.9 UrbanPop 48.5 1040.0 424.8 93.6 Rape 31.1 548.9 93.6 63.8 -------------------------------------------------------- longley 16 7 8 31.147844 Best subsample: [1] 5 6 7 9 10 11 13 14 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=8) Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 104.3 410.8 278.8 300.1 118.2 Year Employed 1955.4 66.5 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 85.0 652.3 784.4 -370.7 48.7 GNP 652.3 7502.9 7328.6 -3414.2 453.9 Unemployed 784.4 7328.6 10760.3 -4646.7 548.1 Armed.Forces -370.7 -3414.2 -4646.7 2824.3 -253.9 Population 48.7 453.9 548.1 -253.9 40.2 Year 33.5 312.7 378.8 -176.1 23.4 Employed 23.9 224.8 263.6 -128.3 16.8 Year Employed GNP.deflator 33.5 23.9 GNP 312.7 224.8 Unemployed 378.8 263.6 Armed.Forces -176.1 -128.3 Population 23.4 16.8 Year 18.9 11.7 Employed 11.7 10.3 -------------------------------------------------------- Loblolly 84 3 42 11.163448 Best subsample: [1] 3 4 5 6 10 21 22 23 24 28 29 33 34 35 36 39 40 41 42 45 46 47 48 51 52 [26] 53 54 57 58 59 63 64 65 66 70 71 76 77 81 82 83 84 Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=42) Robust Estimate of Location: height age Seed 44.20 17.26 6.76 Robust Estimate of Covariance: height age Seed height 326.74 139.18 3.50 age 139.18 68.48 -2.72 Seed 3.50 -2.72 25.43 -------------------------------------------------------- quakes 1000 4 500 11.802478 Best subsample: Too long... Outliers: 0 Too many to print ... ------------- Call: CovMrcd(x = x, trace = FALSE) -> Method: Minimum Regularized Covariance Determinant MRCD(alpha=0.5 ==> h=500) Robust Estimate of Location: lat long depth mag -20.59 182.13 432.46 4.42 Robust Estimate of Covariance: lat long depth mag lat 15.841 5.702 -106.720 -0.441 long 5.702 7.426 -577.189 -0.136 depth -106.720 -577.189 66701.479 3.992 mag -0.441 -0.136 3.992 0.144 -------------------------------------------------------- ======================================================== > ##doexactfit() > > proc.time() user system elapsed 4.96 0.79 5.74 rrcov/tests/tsest.Rout.save0000644000176200001440000026726712763517421015555 0ustar liggesusers R Under development (unstable) (2014-06-23 r66008) -- "Unsuffered Consequences" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > library(MASS) > > dodata <- function(nrep = 1, time = FALSE, full = TRUE, method) { + doest <- function(x, xname, nrep = 1, method=c("sfast", "surreal", "bisquare", "rocke", "suser", "MM", "sdet")) { + + method <- match.arg(method) + + lname <- 20 + n <- dim(x)[1] + p <- dim(x)[2] + + mm <- if(method == "MM") CovMMest(x) else CovSest(x, method=method) + + crit <- log(mm@crit) + + xres <- sprintf("%3d %3d %12.6f\n", dim(x)[1], dim(x)[2], crit) + lpad <- lname-nchar(xname) + cat(pad.right(xname,lpad), xres) + + dist <- getDistance(mm) + quantiel <- qchisq(0.975, p) + ibad <- which(dist >= quantiel) + names(ibad) <- NULL + nbad <- length(ibad) + cat("Outliers: ",nbad,"\n") + if(nbad > 0) + print(ibad) + cat("-------------\n") + show(mm) + cat("--------------------------------------------------------\n") + } + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + data(heart) + data(starsCYG) + data(phosphor) + data(stackloss) + data(coleman) + data(salinity) + data(wood) + data(hbk) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + data(milk) + data(bushfire) + ### + data(rice) + data(hemophilia) + data(fish) + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p LOG(det) Time\n") + cat("===================================================\n") + doest(heart[, 1:2], data(heart), nrep, method=method) + doest(starsCYG, data(starsCYG), nrep, method=method) + doest(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep, method=method) + doest(stack.x, data(stackloss), nrep, method=method) + doest(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep, method=method) + doest(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep, method=method) + doest(data.matrix(subset(wood, select = -y)), data(wood), nrep, method=method) + doest(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep, method=method) + + + doest(brain, "Animals", nrep, method=method) + doest(milk, data(milk), nrep, method=method) + doest(bushfire, data(bushfire), nrep, method=method) + + doest(data.matrix(subset(rice, select = -Overall_evaluation)), data(rice), nrep, method=method) + doest(data.matrix(subset(hemophilia, select = -gr)), data(hemophilia), nrep, method=method) + doest(data.matrix(subset(fish, select = -Species)), data(fish), nrep, method=method) + + ## from package 'datasets' + doest(airquality[,1:4], data(airquality), nrep, method=method) + doest(attitude, data(attitude), nrep, method=method) + doest(attenu, data(attenu), nrep, method=method) + doest(USJudgeRatings, data(USJudgeRatings), nrep, method=method) + doest(USArrests, data(USArrests), nrep, method=method) + doest(longley, data(longley), nrep, method=method) + doest(Loblolly, data(Loblolly), nrep, method=method) + doest(quakes[,1:4], data(quakes), nrep, method=method) + + cat("===================================================\n") + } > > # generate contaminated data using the function gendata with different > # number of outliers and check if the M-estimate breaks - i.e. the > # largest eigenvalue is larger than e.g. 5. > # For n=50 and p=10 and d=5 the M-estimate can break for number of > # outliers grater than 20. > dogen <- function(){ + eig <- vector("numeric",26) + for(i in 0:25) { + gg <- gendata(eps=i) + mm <- CovSRocke(gg$x, t0=gg$tgood, S0=gg$sgood) + eig[i+1] <- ev <- getEvals(mm)[1] + cat(i, ev, "\n") + + ## stopifnot(ev < 5 || i > 20) + } + plot(0:25, eig, type="l", xlab="Number of outliers", ylab="Largest Eigenvalue") + } > > # > # generate data 50x10 as multivariate normal N(0,I) and add > # eps % outliers by adding d=5.0 to each component. > # - if eps <0 and eps <=0.5, the number of outliers is eps*n > # - if eps >= 1, it is the number of outliers > # - use the center and cov of the good data as good start > # - use the center and the cov of all data as a bad start > # If using a good start, the M-estimate must iterate to > # the good solution: the largest eigenvalue is less then e.g. 5 > # > gendata <- function(n=50, p=10, eps=0, d=5.0){ + + if(eps < 0 || eps > 0.5 && eps < 1.0 || eps > 0.5*n) + stop("eps is out of range") + + library(MASS) + + x <- mvrnorm(n, rep(0,p), diag(p)) + bad <- vector("numeric") + nbad = if(eps < 1) eps*n else eps + if(nbad > 0){ + bad <- sample(n, nbad) + x[bad,] <- x[bad,] + d + } + cov1 <- cov.wt(x) + cov2 <- if(nbad <= 0) cov1 else cov.wt(x[-bad,]) + + list(x=x, bad=sort(bad), tgood=cov2$center, sgood=cov2$cov, tbad=cov1$center, sbad=cov1$cov) + } > > pad.right <- function(z, pads) + { + ## Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > > ## -- now do it: > dodata(method="sfast") Call: dodata(method = "sfast") Data Set n p LOG(det) Time =================================================== heart 12 2 2.017701 Outliers: 3 [1] 2 6 12 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 36.1 29.5 Robust Estimate of Covariance: height weight height 129 210 weight 210 365 -------------------------------------------------------- starsCYG 47 2 -1.450032 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 4.42 4.97 Robust Estimate of Covariance: log.Te log.light log.Te 0.0176 0.0617 log.light 0.0617 0.3880 -------------------------------------------------------- phosphor 18 2 2.320721 Outliers: 2 [1] 1 6 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 14.1 38.8 Robust Estimate of Covariance: inorg organic inorg 174 190 organic 190 268 -------------------------------------------------------- stackloss 21 3 1.470031 Outliers: 3 [1] 1 2 3 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 57.5 20.5 86.0 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 38.94 11.66 22.89 Water.Temp 11.66 9.96 7.81 Acid.Conc. 22.89 7.81 40.48 -------------------------------------------------------- coleman 20 5 0.491419 Outliers: 2 [1] 6 10 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 2.77 45.58 4.13 25.13 6.39 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2209 1.9568 1.4389 0.2638 0.0674 fatherWc 1.9568 940.7409 307.8297 8.3290 21.9143 sstatus 1.4389 307.8297 134.0540 4.1808 7.4799 teacherSc 0.2638 8.3290 4.1808 0.7604 0.2917 motherLev 0.0674 21.9143 7.4799 0.2917 0.5817 -------------------------------------------------------- salinity 28 3 0.734619 Outliers: 4 [1] 5 16 23 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 10.31 3.07 22.60 Robust Estimate of Covariance: X1 X2 X3 X1 13.200 0.784 -3.611 X2 0.784 4.441 -1.658 X3 -3.611 -1.658 2.877 -------------------------------------------------------- wood 20 5 -3.202636 Outliers: 2 [1] 7 9 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 0.551 0.135 0.496 0.511 0.916 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 0.011361 -0.000791 0.005473 0.004204 -0.004747 x2 -0.000791 0.000701 -0.000534 -0.001452 0.000864 x3 0.005473 -0.000534 0.004905 0.002960 -0.001914 x4 0.004204 -0.001452 0.002960 0.005154 -0.002187 x5 -0.004747 0.000864 -0.001914 -0.002187 0.003214 -------------------------------------------------------- hbk 75 3 0.283145 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 1.53 1.83 1.66 Robust Estimate of Covariance: X1 X2 X3 X1 1.8091 0.0479 0.2446 X2 0.0479 1.8190 0.2513 X3 0.2446 0.2513 1.7288 -------------------------------------------------------- Animals 28 2 4.685129 Outliers: 10 [1] 2 6 7 9 12 14 15 16 24 25 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 30.8 84.2 Robust Estimate of Covariance: body brain body 14806 28767 brain 28767 65195 -------------------------------------------------------- milk 86 8 -1.437863 Outliers: 15 [1] 1 2 3 12 13 14 15 16 17 41 44 47 70 74 75 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 1.03 35.81 32.97 26.04 25.02 24.94 122.81 14.36 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 8.30e-07 2.53e-04 4.43e-04 4.02e-04 3.92e-04 3.96e-04 1.44e-03 X2 2.53e-04 2.24e+00 4.77e-01 3.63e-01 2.91e-01 3.94e-01 2.44e+00 X3 4.43e-04 4.77e-01 1.58e+00 1.20e+00 1.18e+00 1.19e+00 1.65e+00 X4 4.02e-04 3.63e-01 1.20e+00 9.74e-01 9.37e-01 9.39e-01 1.39e+00 X5 3.92e-04 2.91e-01 1.18e+00 9.37e-01 9.78e-01 9.44e-01 1.37e+00 X6 3.96e-04 3.94e-01 1.19e+00 9.39e-01 9.44e-01 9.82e-01 1.41e+00 X7 1.44e-03 2.44e+00 1.65e+00 1.39e+00 1.37e+00 1.41e+00 6.96e+00 X8 7.45e-05 3.33e-01 2.82e-01 2.01e-01 1.80e-01 1.91e-01 6.38e-01 X8 X1 7.45e-05 X2 3.33e-01 X3 2.82e-01 X4 2.01e-01 X5 1.80e-01 X6 1.91e-01 X7 6.38e-01 X8 2.01e-01 -------------------------------------------------------- bushfire 38 5 2.443148 Outliers: 13 [1] 7 8 9 10 11 31 32 33 34 35 36 37 38 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 108 149 266 216 278 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 911 688 -3961 -856 -707 V2 688 587 -2493 -492 -420 V3 -3961 -2493 24146 5765 4627 V4 -856 -492 5765 1477 1164 V5 -707 -420 4627 1164 925 -------------------------------------------------------- rice 105 5 -0.724874 Outliers: 7 [1] 9 40 42 49 57 58 71 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] -0.2472 0.1211 -0.1207 0.0715 0.0640 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.423 0.345 0.427 0.405 -0.202 Appearance 0.345 0.592 0.570 0.549 -0.316 Taste 0.427 0.570 0.739 0.706 -0.393 Stickiness 0.405 0.549 0.706 0.876 -0.497 Toughness -0.202 -0.316 -0.393 -0.497 0.467 -------------------------------------------------------- hemophilia 75 2 -1.868949 Outliers: 2 [1] 11 36 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] -0.2126 -0.0357 Robust Estimate of Covariance: AHFactivity AHFantigen AHFactivity 0.0317 0.0112 AHFantigen 0.0112 0.0218 -------------------------------------------------------- fish 159 6 1.285876 Outliers: 21 [1] 61 62 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 [20] 103 142 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 358.3 24.7 26.9 29.7 30.0 14.7 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 1.33e+05 3.09e+03 3.34e+03 3.78e+03 1.72e+03 2.24e+02 Length1 3.09e+03 7.92e+01 8.54e+01 9.55e+01 4.04e+01 7.43e+00 Length2 3.34e+03 8.54e+01 9.22e+01 1.03e+02 4.49e+01 8.07e+00 Length3 3.78e+03 9.55e+01 1.03e+02 1.18e+02 5.92e+01 7.65e+00 Height 1.72e+03 4.04e+01 4.49e+01 5.92e+01 7.12e+01 8.51e-01 Width 2.24e+02 7.43e+00 8.07e+00 7.65e+00 8.51e-01 3.57e+00 -------------------------------------------------------- airquality 153 4 2.684374 Outliers: 7 [1] 7 14 23 30 34 77 107 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 39.34 192.12 9.67 78.71 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 973.104 894.011 -61.856 243.560 Solar.R 894.011 9677.269 0.388 179.429 Wind -61.856 0.388 11.287 -14.310 Temp 243.560 179.429 -14.310 96.714 -------------------------------------------------------- attitude 30 7 2.091968 Outliers: 4 [1] 14 16 18 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 65.7 66.8 51.9 56.1 66.4 76.7 43.0 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 170.59 136.40 77.41 125.46 99.72 8.01 49.52 complaints 136.40 170.94 94.62 136.73 120.76 23.52 78.52 privileges 77.41 94.62 150.49 112.77 87.92 6.43 72.33 learning 125.46 136.73 112.77 173.77 131.46 25.81 81.38 raises 99.72 120.76 87.92 131.46 136.76 29.50 91.70 critical 8.01 23.52 6.43 25.81 29.50 84.75 30.59 advance 49.52 78.52 72.33 81.38 91.70 30.59 116.28 -------------------------------------------------------- attenu 182 5 1.148032 Outliers: 31 [1] 2 5 6 7 8 9 10 11 15 16 19 20 21 22 23 24 25 27 28 [20] 29 30 31 32 64 65 80 94 95 96 97 100 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 16.432 5.849 60.297 27.144 0.134 Robust Estimate of Covariance: event mag station dist accel event 54.9236 -3.0733 181.0954 -49.4194 -0.0628 mag -3.0733 0.6530 -8.4388 6.7388 0.0161 station 181.0954 -8.4388 1689.7161 -114.6319 0.7285 dist -49.4194 6.7388 -114.6319 597.3606 -1.7988 accel -0.0628 0.0161 0.7285 -1.7988 0.0152 -------------------------------------------------------- USJudgeRatings 43 12 -1.683847 Outliers: 7 [1] 5 7 12 13 14 23 31 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 7.43 8.16 7.75 7.89 7.68 7.76 7.67 7.67 7.51 7.58 8.19 7.86 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 0.8710 -0.3019 -0.4682 -0.1893 -0.0569 -0.0992 -0.1771 -0.1975 INTG -0.3019 0.6401 0.8598 0.6955 0.5732 0.5439 0.7091 0.7084 DMNR -0.4682 0.8598 1.2412 0.9107 0.7668 0.7305 0.9292 0.9158 DILG -0.1893 0.6955 0.9107 0.8554 0.7408 0.7036 0.8865 0.8791 CFMG -0.0569 0.5732 0.7668 0.7408 0.6994 0.6545 0.7788 0.7721 DECI -0.0992 0.5439 0.7305 0.7036 0.6545 0.6342 0.7492 0.7511 PREP -0.1771 0.7091 0.9292 0.8865 0.7788 0.7492 0.9541 0.9556 FAMI -0.1975 0.7084 0.9158 0.8791 0.7721 0.7511 0.9556 0.9785 ORAL -0.2444 0.7453 0.9939 0.8917 0.7842 0.7551 0.9554 0.9680 WRIT -0.2344 0.7319 0.9649 0.8853 0.7781 0.7511 0.9498 0.9668 PHYS -0.1983 0.4676 0.6263 0.5629 0.5073 0.5039 0.5990 0.6140 RTEN -0.3152 0.8000 1.0798 0.9234 0.7952 0.7663 0.9637 0.9693 ORAL WRIT PHYS RTEN CONT -0.2444 -0.2344 -0.1983 -0.3152 INTG 0.7453 0.7319 0.4676 0.8000 DMNR 0.9939 0.9649 0.6263 1.0798 DILG 0.8917 0.8853 0.5629 0.9234 CFMG 0.7842 0.7781 0.5073 0.7952 DECI 0.7551 0.7511 0.5039 0.7663 PREP 0.9554 0.9498 0.5990 0.9637 FAMI 0.9680 0.9668 0.6140 0.9693 ORAL 0.9853 0.9744 0.6280 1.0032 WRIT 0.9744 0.9711 0.6184 0.9870 PHYS 0.6280 0.6184 0.4716 0.6520 RTEN 1.0032 0.9870 0.6520 1.0622 -------------------------------------------------------- USArrests 50 4 2.411726 Outliers: 4 [1] 2 28 33 39 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 7.05 150.66 64.66 19.37 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 23.8 380.8 19.2 29.7 Assault 380.8 8436.2 605.6 645.3 UrbanPop 19.2 605.6 246.5 78.8 Rape 29.7 645.3 78.8 77.3 -------------------------------------------------------- longley 16 7 1.038316 Outliers: 5 [1] 1 2 3 4 5 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 107.6 440.8 339.7 292.5 121.0 1957.1 67.2 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 100.6 954.7 1147.1 -507.6 74.2 GNP 954.7 9430.9 10115.8 -4616.5 730.1 Unemployed 1147.1 10115.8 19838.3 -6376.9 850.6 Armed.Forces -507.6 -4616.5 -6376.9 3240.2 -351.3 Population 74.2 730.1 850.6 -351.3 57.5 Year 46.4 450.8 539.5 -233.0 35.3 Employed 30.8 310.5 274.0 -160.8 23.3 Year Employed GNP.deflator 46.4 30.8 GNP 450.8 310.5 Unemployed 539.5 274.0 Armed.Forces -233.0 -160.8 Population 35.3 23.3 Year 21.9 14.6 Employed 14.6 11.2 -------------------------------------------------------- Loblolly 84 3 1.481317 Outliers: 14 [1] 6 12 18 24 30 36 42 48 54 60 66 72 78 84 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] 24.22 9.65 7.50 Robust Estimate of Covariance: height age Seed height 525.08 179.21 14.27 age 179.21 61.85 2.94 Seed 14.27 2.94 25.86 -------------------------------------------------------- quakes 1000 4 1.576855 Outliers: 223 [1] 7 12 15 17 22 25 27 28 32 37 40 41 45 48 53 [16] 63 64 73 78 87 91 92 94 99 108 110 117 118 119 120 [31] 121 122 126 133 136 141 143 145 148 152 154 155 157 159 160 [46] 163 170 192 205 222 226 230 239 243 250 251 252 254 258 263 [61] 267 268 271 283 292 300 301 305 311 312 318 320 321 325 328 [76] 330 334 352 357 360 365 381 382 384 389 400 402 408 413 416 [91] 417 419 426 429 437 441 443 453 456 467 474 477 490 492 496 [106] 504 507 508 509 517 524 527 528 531 532 534 536 538 539 541 [121] 542 543 544 545 546 547 552 553 560 571 581 583 587 593 594 [136] 596 597 605 612 613 618 620 625 629 638 642 647 649 653 655 [151] 656 672 675 681 686 699 701 702 712 714 716 721 725 726 735 [166] 744 754 756 759 765 766 769 779 781 782 785 787 797 804 813 [181] 825 827 837 840 844 852 853 857 860 865 866 869 870 872 873 [196] 883 884 887 888 890 891 893 908 909 912 915 916 921 927 930 [211] 952 962 963 969 974 980 982 986 987 988 992 997 1000 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: S-FAST Robust Estimate of Location: [1] -21.54 182.35 369.21 4.54 Robust Estimate of Covariance: lat long depth mag lat 2.81e+01 6.19e+00 3.27e+02 -4.56e-01 long 6.19e+00 7.54e+00 -5.95e+02 9.56e-02 depth 3.27e+02 -5.95e+02 8.36e+04 -2.70e+01 mag -4.56e-01 9.56e-02 -2.70e+01 2.35e-01 -------------------------------------------------------- =================================================== > dodata(method="sdet") Call: dodata(method = "sdet") Data Set n p LOG(det) Time =================================================== heart 12 2 2.017701 Outliers: 3 [1] 2 6 12 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 36.1 29.5 Robust Estimate of Covariance: height weight height 129 210 weight 210 365 -------------------------------------------------------- starsCYG 47 2 -1.450032 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 4.42 4.97 Robust Estimate of Covariance: log.Te log.light log.Te 0.0176 0.0617 log.light 0.0617 0.3880 -------------------------------------------------------- phosphor 18 2 2.320721 Outliers: 2 [1] 1 6 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 14.1 38.8 Robust Estimate of Covariance: inorg organic inorg 174 190 organic 190 268 -------------------------------------------------------- stackloss 21 3 1.470031 Outliers: 3 [1] 1 2 3 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 57.5 20.5 86.0 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 38.94 11.66 22.89 Water.Temp 11.66 9.96 7.81 Acid.Conc. 22.89 7.81 40.48 -------------------------------------------------------- coleman 20 5 0.491419 Outliers: 2 [1] 6 10 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 2.77 45.58 4.13 25.13 6.39 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2209 1.9568 1.4389 0.2638 0.0674 fatherWc 1.9568 940.7409 307.8297 8.3290 21.9143 sstatus 1.4389 307.8297 134.0540 4.1808 7.4799 teacherSc 0.2638 8.3290 4.1808 0.7604 0.2917 motherLev 0.0674 21.9143 7.4799 0.2917 0.5817 -------------------------------------------------------- salinity 28 3 0.734619 Outliers: 4 [1] 5 16 23 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 10.31 3.07 22.60 Robust Estimate of Covariance: X1 X2 X3 X1 13.200 0.784 -3.611 X2 0.784 4.441 -1.658 X3 -3.611 -1.658 2.877 -------------------------------------------------------- wood 20 5 -3.220754 Outliers: 4 [1] 4 6 8 19 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 0.580 0.123 0.530 0.538 0.890 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 8.16e-03 1.39e-03 1.97e-03 -2.82e-04 -7.61e-04 x2 1.39e-03 4.00e-04 8.14e-04 -8.51e-05 -5.07e-06 x3 1.97e-03 8.14e-04 4.74e-03 -9.59e-04 2.06e-05 x4 -2.82e-04 -8.51e-05 -9.59e-04 3.09e-03 1.87e-03 x5 -7.61e-04 -5.07e-06 2.06e-05 1.87e-03 2.28e-03 -------------------------------------------------------- hbk 75 3 0.283145 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 1.53 1.83 1.66 Robust Estimate of Covariance: X1 X2 X3 X1 1.8091 0.0479 0.2446 X2 0.0479 1.8190 0.2513 X3 0.2446 0.2513 1.7288 -------------------------------------------------------- Animals 28 2 4.685129 Outliers: 10 [1] 2 6 7 9 12 14 15 16 24 25 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 30.8 84.2 Robust Estimate of Covariance: body brain body 14806 28767 brain 28767 65194 -------------------------------------------------------- milk 86 8 -1.437863 Outliers: 15 [1] 1 2 3 12 13 14 15 16 17 41 44 47 70 74 75 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 1.03 35.81 32.97 26.04 25.02 24.94 122.81 14.36 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 8.30e-07 2.53e-04 4.43e-04 4.02e-04 3.92e-04 3.96e-04 1.44e-03 X2 2.53e-04 2.24e+00 4.77e-01 3.63e-01 2.91e-01 3.94e-01 2.44e+00 X3 4.43e-04 4.77e-01 1.58e+00 1.20e+00 1.18e+00 1.19e+00 1.65e+00 X4 4.02e-04 3.63e-01 1.20e+00 9.74e-01 9.37e-01 9.39e-01 1.39e+00 X5 3.92e-04 2.91e-01 1.18e+00 9.37e-01 9.78e-01 9.44e-01 1.37e+00 X6 3.96e-04 3.94e-01 1.19e+00 9.39e-01 9.44e-01 9.82e-01 1.41e+00 X7 1.44e-03 2.44e+00 1.65e+00 1.39e+00 1.37e+00 1.41e+00 6.96e+00 X8 7.45e-05 3.33e-01 2.82e-01 2.01e-01 1.80e-01 1.91e-01 6.38e-01 X8 X1 7.45e-05 X2 3.33e-01 X3 2.82e-01 X4 2.01e-01 X5 1.80e-01 X6 1.91e-01 X7 6.38e-01 X8 2.01e-01 -------------------------------------------------------- bushfire 38 5 2.443148 Outliers: 13 [1] 7 8 9 10 11 31 32 33 34 35 36 37 38 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 108 149 266 216 278 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 911 688 -3961 -856 -707 V2 688 587 -2493 -492 -420 V3 -3961 -2493 24146 5765 4627 V4 -856 -492 5765 1477 1164 V5 -707 -420 4627 1164 925 -------------------------------------------------------- rice 105 5 -0.724874 Outliers: 7 [1] 9 40 42 49 57 58 71 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] -0.2472 0.1211 -0.1207 0.0715 0.0640 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.423 0.345 0.427 0.405 -0.202 Appearance 0.345 0.592 0.570 0.549 -0.316 Taste 0.427 0.570 0.739 0.706 -0.393 Stickiness 0.405 0.549 0.706 0.876 -0.497 Toughness -0.202 -0.316 -0.393 -0.497 0.467 -------------------------------------------------------- hemophilia 75 2 -1.868949 Outliers: 2 [1] 11 36 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] -0.2126 -0.0357 Robust Estimate of Covariance: AHFactivity AHFantigen AHFactivity 0.0317 0.0112 AHFantigen 0.0112 0.0218 -------------------------------------------------------- fish 159 6 1.267294 Outliers: 33 [1] 61 72 73 74 75 76 77 78 79 80 81 82 83 85 86 87 88 89 90 [20] 91 92 93 94 95 96 97 98 99 100 101 102 103 142 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 381.2 25.6 27.8 30.8 31.0 14.9 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 148372.04 3260.48 3508.71 3976.93 1507.43 127.94 Length1 3260.48 77.00 82.52 92.18 27.56 3.29 Length2 3508.71 82.52 88.57 99.20 30.83 3.43 Length3 3976.93 92.18 99.20 113.97 45.50 2.21 Height 1507.43 27.56 30.83 45.50 70.54 -4.95 Width 127.94 3.29 3.43 2.21 -4.95 2.28 -------------------------------------------------------- airquality 153 4 2.684374 Outliers: 7 [1] 7 14 23 30 34 77 107 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 39.34 192.12 9.67 78.71 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 973.104 894.011 -61.856 243.560 Solar.R 894.011 9677.269 0.388 179.429 Wind -61.856 0.388 11.287 -14.310 Temp 243.560 179.429 -14.310 96.714 -------------------------------------------------------- attitude 30 7 2.091968 Outliers: 4 [1] 14 16 18 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 65.7 66.8 51.9 56.1 66.4 76.7 43.0 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 170.59 136.40 77.41 125.46 99.72 8.01 49.52 complaints 136.40 170.94 94.62 136.73 120.76 23.52 78.52 privileges 77.41 94.62 150.49 112.77 87.92 6.43 72.33 learning 125.46 136.73 112.77 173.77 131.46 25.81 81.38 raises 99.72 120.76 87.92 131.46 136.76 29.50 91.70 critical 8.01 23.52 6.43 25.81 29.50 84.75 30.59 advance 49.52 78.52 72.33 81.38 91.70 30.59 116.28 -------------------------------------------------------- attenu 182 5 1.148032 Outliers: 31 [1] 2 5 6 7 8 9 10 11 15 16 19 20 21 22 23 24 25 27 28 [20] 29 30 31 32 64 65 80 94 95 96 97 100 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 16.432 5.849 60.297 27.144 0.134 Robust Estimate of Covariance: event mag station dist accel event 54.9236 -3.0733 181.0954 -49.4195 -0.0628 mag -3.0733 0.6530 -8.4388 6.7388 0.0161 station 181.0954 -8.4388 1689.7161 -114.6321 0.7285 dist -49.4195 6.7388 -114.6321 597.3609 -1.7988 accel -0.0628 0.0161 0.7285 -1.7988 0.0152 -------------------------------------------------------- USJudgeRatings 43 12 -1.683847 Outliers: 7 [1] 5 7 12 13 14 23 31 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 7.43 8.16 7.75 7.89 7.68 7.76 7.67 7.67 7.51 7.58 8.19 7.86 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 0.8715 -0.3020 -0.4683 -0.1894 -0.0569 -0.0993 -0.1772 -0.1976 INTG -0.3020 0.6403 0.8600 0.6956 0.5733 0.5440 0.7093 0.7086 DMNR -0.4683 0.8600 1.2416 0.9109 0.7669 0.7307 0.9295 0.9161 DILG -0.1894 0.6956 0.9109 0.8555 0.7410 0.7037 0.8867 0.8793 CFMG -0.0569 0.5733 0.7669 0.7410 0.6995 0.6546 0.7789 0.7723 DECI -0.0993 0.5440 0.7307 0.7037 0.6546 0.6343 0.7493 0.7513 PREP -0.1772 0.7093 0.9295 0.8867 0.7789 0.7493 0.9543 0.9559 FAMI -0.1976 0.7086 0.9161 0.8793 0.7723 0.7513 0.9559 0.9788 ORAL -0.2445 0.7456 0.9942 0.8919 0.7844 0.7553 0.9557 0.9683 WRIT -0.2345 0.7321 0.9652 0.8856 0.7783 0.7513 0.9501 0.9671 PHYS -0.1986 0.4676 0.6264 0.5628 0.5072 0.5038 0.5990 0.6140 RTEN -0.3154 0.8002 1.0801 0.9236 0.7954 0.7665 0.9639 0.9695 ORAL WRIT PHYS RTEN CONT -0.2445 -0.2345 -0.1986 -0.3154 INTG 0.7456 0.7321 0.4676 0.8002 DMNR 0.9942 0.9652 0.6264 1.0801 DILG 0.8919 0.8856 0.5628 0.9236 CFMG 0.7844 0.7783 0.5072 0.7954 DECI 0.7553 0.7513 0.5038 0.7665 PREP 0.9557 0.9501 0.5990 0.9639 FAMI 0.9683 0.9671 0.6140 0.9695 ORAL 0.9856 0.9748 0.6281 1.0035 WRIT 0.9748 0.9714 0.6184 0.9873 PHYS 0.6281 0.6184 0.4713 0.6520 RTEN 1.0035 0.9873 0.6520 1.0624 -------------------------------------------------------- USArrests 50 4 2.411726 Outliers: 4 [1] 2 28 33 39 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 7.05 150.66 64.66 19.37 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 23.8 380.8 19.2 29.7 Assault 380.8 8436.2 605.6 645.3 UrbanPop 19.2 605.6 246.5 78.8 Rape 29.7 645.3 78.8 77.3 -------------------------------------------------------- longley 16 7 1.143113 Outliers: 4 [1] 1 2 3 4 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 107 435 334 293 120 1957 67 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 89.2 850.1 1007.4 -404.4 66.2 GNP 850.1 8384.4 9020.8 -3692.0 650.5 Unemployed 1007.4 9020.8 16585.4 -4990.7 752.5 Armed.Forces -404.4 -3692.0 -4990.7 2474.2 -280.9 Population 66.2 650.5 752.5 -280.9 51.2 Year 41.9 407.6 481.9 -186.4 31.9 Employed 27.9 279.7 255.6 -128.8 21.1 Year Employed GNP.deflator 41.9 27.9 GNP 407.6 279.7 Unemployed 481.9 255.6 Armed.Forces -186.4 -128.8 Population 31.9 21.1 Year 20.2 13.4 Employed 13.4 10.1 -------------------------------------------------------- Loblolly 84 3 1.481317 Outliers: 14 [1] 6 12 18 24 30 36 42 48 54 60 66 72 78 84 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] 24.22 9.65 7.50 Robust Estimate of Covariance: height age Seed height 525.08 179.21 14.27 age 179.21 61.85 2.94 Seed 14.27 2.94 25.86 -------------------------------------------------------- quakes 1000 4 1.576855 Outliers: 223 [1] 7 12 15 17 22 25 27 28 32 37 40 41 45 48 53 [16] 63 64 73 78 87 91 92 94 99 108 110 117 118 119 120 [31] 121 122 126 133 136 141 143 145 148 152 154 155 157 159 160 [46] 163 170 192 205 222 226 230 239 243 250 251 252 254 258 263 [61] 267 268 271 283 292 300 301 305 311 312 318 320 321 325 328 [76] 330 334 352 357 360 365 381 382 384 389 400 402 408 413 416 [91] 417 419 426 429 437 441 443 453 456 467 474 477 490 492 496 [106] 504 507 508 509 517 524 527 528 531 532 534 536 538 539 541 [121] 542 543 544 545 546 547 552 553 560 571 581 583 587 593 594 [136] 596 597 605 612 613 618 620 625 629 638 642 647 649 653 655 [151] 656 672 675 681 686 699 701 702 712 714 716 721 725 726 735 [166] 744 754 756 759 765 766 769 779 781 782 785 787 797 804 813 [181] 825 827 837 840 844 852 853 857 860 865 866 869 870 872 873 [196] 883 884 887 888 890 891 893 908 909 912 915 916 921 927 930 [211] 952 962 963 969 974 980 982 986 987 988 992 997 1000 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: DET-S Robust Estimate of Location: [1] -21.54 182.35 369.21 4.54 Robust Estimate of Covariance: lat long depth mag lat 2.81e+01 6.19e+00 3.27e+02 -4.56e-01 long 6.19e+00 7.54e+00 -5.95e+02 9.56e-02 depth 3.27e+02 -5.95e+02 8.36e+04 -2.70e+01 mag -4.56e-01 9.56e-02 -2.70e+01 2.35e-01 -------------------------------------------------------- =================================================== > ##dodata(method="suser") > ##dodata(method="surreal") > dodata(method="bisquare") Call: dodata(method = "bisquare") Data Set n p LOG(det) Time =================================================== heart 12 2 7.721793 Outliers: 3 [1] 2 6 12 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: height weight 36.1 29.4 Robust Estimate of Covariance: height weight height 109 177 weight 177 307 -------------------------------------------------------- starsCYG 47 2 -5.942108 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: log.Te log.light 4.42 4.97 Robust Estimate of Covariance: log.Te log.light log.Te 0.0164 0.0574 log.light 0.0574 0.3613 -------------------------------------------------------- phosphor 18 2 9.269096 Outliers: 2 [1] 1 6 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: inorg organic 14.1 38.7 Robust Estimate of Covariance: inorg organic inorg 173 189 organic 189 268 -------------------------------------------------------- stackloss 21 3 8.411100 Outliers: 3 [1] 1 2 3 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 57.5 20.5 86.0 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 33.82 10.17 20.02 Water.Temp 10.17 8.70 6.84 Acid.Conc. 20.02 6.84 35.51 -------------------------------------------------------- coleman 20 5 4.722046 Outliers: 2 [1] 6 10 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.77 45.59 4.14 25.13 6.39 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2135 1.8732 1.3883 0.2547 0.0648 fatherWc 1.8732 905.6704 296.1916 7.9820 21.0848 sstatus 1.3883 296.1916 128.9536 4.0196 7.1917 teacherSc 0.2547 7.9820 4.0196 0.7321 0.2799 motherLev 0.0648 21.0848 7.1917 0.2799 0.5592 -------------------------------------------------------- salinity 28 3 4.169963 Outliers: 4 [1] 5 16 23 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: X1 X2 X3 10.30 3.07 22.59 Robust Estimate of Covariance: X1 X2 X3 X1 12.234 0.748 -3.369 X2 0.748 4.115 -1.524 X3 -3.369 -1.524 2.655 -------------------------------------------------------- wood 20 5 -33.862485 Outliers: 5 [1] 4 6 8 11 19 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: x1 x2 x3 x4 x5 0.580 0.123 0.530 0.538 0.890 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 5.88e-03 9.96e-04 1.43e-03 -1.96e-04 -5.46e-04 x2 9.96e-04 2.86e-04 5.89e-04 -5.78e-05 -2.24e-06 x3 1.43e-03 5.89e-04 3.42e-03 -6.95e-04 1.43e-05 x4 -1.96e-04 -5.78e-05 -6.95e-04 2.23e-03 1.35e-03 x5 -5.46e-04 -2.24e-06 1.43e-05 1.35e-03 1.65e-03 -------------------------------------------------------- hbk 75 3 1.472421 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: X1 X2 X3 1.53 1.83 1.66 Robust Estimate of Covariance: X1 X2 X3 X1 1.6775 0.0447 0.2268 X2 0.0447 1.6865 0.2325 X3 0.2268 0.2325 1.6032 -------------------------------------------------------- Animals 28 2 18.528307 Outliers: 11 [1] 2 6 7 9 12 14 15 16 24 25 28 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: body brain 30.7 84.1 Robust Estimate of Covariance: body brain body 13278 25795 brain 25795 58499 -------------------------------------------------------- milk 86 8 -24.816943 Outliers: 19 [1] 1 2 3 11 12 13 14 15 16 17 20 27 41 44 47 70 74 75 77 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.81 32.96 26.04 25.02 24.94 122.79 14.35 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 6.80e-07 2.20e-04 3.70e-04 3.35e-04 3.27e-04 3.30e-04 1.21e-03 X2 2.20e-04 1.80e+00 3.96e-01 3.03e-01 2.45e-01 3.27e-01 2.00e+00 X3 3.70e-04 3.96e-01 1.27e+00 9.68e-01 9.49e-01 9.56e-01 1.37e+00 X4 3.35e-04 3.03e-01 9.68e-01 7.86e-01 7.55e-01 7.57e-01 1.15e+00 X5 3.27e-04 2.45e-01 9.49e-01 7.55e-01 7.88e-01 7.61e-01 1.14e+00 X6 3.30e-04 3.27e-01 9.56e-01 7.57e-01 7.61e-01 7.90e-01 1.17e+00 X7 1.21e-03 2.00e+00 1.37e+00 1.15e+00 1.14e+00 1.17e+00 5.71e+00 X8 6.57e-05 2.71e-01 2.30e-01 1.64e-01 1.48e-01 1.57e-01 5.27e-01 X8 X1 6.57e-05 X2 2.71e-01 X3 2.30e-01 X4 1.64e-01 X5 1.48e-01 X6 1.57e-01 X7 5.27e-01 X8 1.62e-01 -------------------------------------------------------- bushfire 38 5 21.704243 Outliers: 13 [1] 7 8 9 10 11 31 32 33 34 35 36 37 38 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: V1 V2 V3 V4 V5 108 149 266 216 278 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 528 398 -2298 -497 -410 V2 398 340 -1445 -285 -244 V3 -2298 -1445 14026 3348 2687 V4 -497 -285 3348 857 676 V5 -410 -244 2687 676 537 -------------------------------------------------------- rice 105 5 -7.346939 Outliers: 8 [1] 9 14 40 42 49 57 58 71 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: Favor Appearance Taste Stickiness Toughness -0.2480 0.1203 -0.1213 0.0710 0.0644 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.415 0.338 0.419 0.398 -0.198 Appearance 0.338 0.580 0.559 0.539 -0.310 Taste 0.419 0.559 0.725 0.693 -0.386 Stickiness 0.398 0.539 0.693 0.859 -0.487 Toughness -0.198 -0.310 -0.386 -0.487 0.457 -------------------------------------------------------- hemophilia 75 2 -7.465173 Outliers: 2 [1] 11 36 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: AHFactivity AHFantigen -0.2128 -0.0366 Robust Estimate of Covariance: AHFactivity AHFantigen AHFactivity 0.0321 0.0115 AHFantigen 0.0115 0.0220 -------------------------------------------------------- fish 159 6 13.465134 Outliers: 35 [1] 38 61 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 [20] 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 142 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 381.4 25.6 27.8 30.8 31.0 14.9 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 111094.92 2440.81 2626.59 2976.92 1129.78 95.85 Length1 2440.81 57.63 61.75 68.98 20.67 2.46 Length2 2626.59 61.75 66.28 74.24 23.13 2.57 Length3 2976.92 68.98 74.24 85.29 34.11 1.65 Height 1129.78 20.67 23.13 34.11 52.75 -3.70 Width 95.85 2.46 2.57 1.65 -3.70 1.71 -------------------------------------------------------- airquality 153 4 21.282926 Outliers: 8 [1] 7 11 14 23 30 34 77 107 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: Ozone Solar.R Wind Temp 39.40 192.29 9.66 78.74 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 930.566 849.644 -59.157 232.459 Solar.R 849.644 9207.569 0.594 168.122 Wind -59.157 0.594 10.783 -13.645 Temp 232.459 168.122 -13.645 92.048 -------------------------------------------------------- attitude 30 7 28.084183 Outliers: 6 [1] 6 9 14 16 18 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: rating complaints privileges learning raises critical 65.7 66.8 51.9 56.1 66.4 76.7 advance 43.0 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 143.88 114.95 64.97 105.69 83.95 6.96 41.78 complaints 114.95 143.84 79.28 115.00 101.48 19.69 66.13 privileges 64.97 79.28 126.38 94.70 73.87 5.37 61.07 learning 105.69 115.00 94.70 146.14 110.50 21.67 68.49 raises 83.95 101.48 73.87 110.50 115.01 24.91 77.16 critical 6.96 19.69 5.37 21.67 24.91 71.74 25.88 advance 41.78 66.13 61.07 68.49 77.16 25.88 97.71 -------------------------------------------------------- attenu 182 5 10.109049 Outliers: 35 [1] 2 4 5 6 7 8 9 10 11 15 16 19 20 21 22 23 24 25 27 [20] 28 29 30 31 32 64 65 80 93 94 95 96 97 98 99 100 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: event mag station dist accel 16.418 5.850 60.243 27.307 0.134 Robust Estimate of Covariance: event mag station dist accel event 41.9000 -2.3543 137.8110 -39.0321 -0.0447 mag -2.3543 0.4978 -6.4461 5.2644 0.0118 station 137.8110 -6.4461 1283.9675 -90.1657 0.5554 dist -39.0321 5.2644 -90.1657 462.3898 -1.3672 accel -0.0447 0.0118 0.5554 -1.3672 0.0114 -------------------------------------------------------- USJudgeRatings 43 12 -43.367499 Outliers: 10 [1] 5 7 8 12 13 14 20 23 31 35 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.43 8.16 7.75 7.89 7.69 7.76 7.68 7.67 7.52 7.59 8.19 7.87 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 0.6895 -0.2399 -0.3728 -0.1514 -0.0461 -0.0801 -0.1419 -0.1577 INTG -0.2399 0.5021 0.6746 0.5446 0.4479 0.4254 0.5564 0.5558 DMNR -0.3728 0.6746 0.9753 0.7128 0.5992 0.5715 0.7289 0.7181 DILG -0.1514 0.5446 0.7128 0.6691 0.5789 0.5501 0.6949 0.6892 CFMG -0.0461 0.4479 0.5992 0.5789 0.5468 0.5118 0.6100 0.6049 DECI -0.0801 0.4254 0.5715 0.5501 0.5118 0.4965 0.5872 0.5890 PREP -0.1419 0.5564 0.7289 0.6949 0.6100 0.5872 0.7497 0.7511 FAMI -0.1577 0.5558 0.7181 0.6892 0.6049 0.5890 0.7511 0.7696 ORAL -0.1950 0.5848 0.7798 0.6990 0.6143 0.5921 0.7508 0.7610 WRIT -0.1866 0.5747 0.7575 0.6946 0.6101 0.5895 0.7470 0.7607 PHYS -0.1620 0.3640 0.4878 0.4361 0.3927 0.3910 0.4655 0.4779 RTEN -0.2522 0.6268 0.8462 0.7220 0.6210 0.5991 0.7553 0.7599 ORAL WRIT PHYS RTEN CONT -0.1950 -0.1866 -0.1620 -0.2522 INTG 0.5848 0.5747 0.3640 0.6268 DMNR 0.7798 0.7575 0.4878 0.8462 DILG 0.6990 0.6946 0.4361 0.7220 CFMG 0.6143 0.6101 0.3927 0.6210 DECI 0.5921 0.5895 0.3910 0.5991 PREP 0.7508 0.7470 0.4655 0.7553 FAMI 0.7610 0.7607 0.4779 0.7599 ORAL 0.7745 0.7665 0.4893 0.7866 WRIT 0.7665 0.7645 0.4823 0.7745 PHYS 0.4893 0.4823 0.3620 0.5062 RTEN 0.7866 0.7745 0.5062 0.8313 -------------------------------------------------------- USArrests 50 4 19.266763 Outliers: 4 [1] 2 28 33 39 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: Murder Assault UrbanPop Rape 7.04 150.55 64.64 19.34 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 23.7 378.9 19.1 29.5 Assault 378.9 8388.2 601.3 639.7 UrbanPop 19.1 601.3 245.3 77.9 Rape 29.5 639.7 77.9 76.3 -------------------------------------------------------- longley 16 7 13.789499 Outliers: 4 [1] 1 2 3 4 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 107 435 333 293 120 Year Employed 1957 67 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 65.05 619.75 734.33 -294.02 48.27 GNP 619.75 6112.14 6578.12 -2684.52 474.26 Unemployed 734.33 6578.12 12075.90 -3627.79 548.58 Armed.Forces -294.02 -2684.52 -3627.79 1797.05 -204.25 Population 48.27 474.26 548.58 -204.25 37.36 Year 30.58 297.29 351.44 -135.53 23.29 Employed 20.36 203.96 186.62 -93.64 15.42 Year Employed GNP.deflator 30.58 20.36 GNP 297.29 203.96 Unemployed 351.44 186.62 Armed.Forces -135.53 -93.64 Population 23.29 15.42 Year 14.70 9.80 Employed 9.80 7.36 -------------------------------------------------------- Loblolly 84 3 8.518440 Outliers: 14 [1] 6 12 18 24 30 36 42 48 54 60 66 72 78 84 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: height age Seed 24.14 9.62 7.51 Robust Estimate of Covariance: height age Seed height 464.64 158.43 12.83 age 158.43 54.62 2.67 Seed 12.83 2.67 22.98 -------------------------------------------------------- quakes 1000 4 11.611413 Outliers: 234 [1] 7 12 15 17 22 25 27 28 32 37 40 41 45 48 53 [16] 63 64 73 78 87 91 92 94 99 108 110 117 118 119 120 [31] 121 122 126 133 136 141 143 145 148 152 154 155 157 159 160 [46] 163 166 170 174 192 205 222 226 230 239 243 250 251 252 254 [61] 258 263 267 268 271 283 292 297 300 301 305 311 312 318 320 [76] 321 325 328 330 331 334 352 357 360 365 368 376 381 382 384 [91] 389 399 400 402 408 413 416 417 418 419 426 429 437 441 443 [106] 453 456 467 474 477 490 492 496 504 507 508 509 517 524 527 [121] 528 531 532 534 536 538 539 541 542 543 544 545 546 547 552 [136] 553 558 560 570 571 581 583 587 593 594 596 597 605 612 613 [151] 618 620 625 629 638 642 647 649 653 655 656 672 675 681 686 [166] 699 701 702 712 714 716 721 725 726 735 744 753 754 756 759 [181] 765 766 769 779 781 782 785 787 797 804 813 825 827 837 840 [196] 844 852 853 857 860 865 866 869 870 872 873 883 884 887 888 [211] 890 891 893 908 909 912 915 916 921 927 930 952 962 963 969 [226] 974 980 982 986 987 988 992 997 1000 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: bisquare Robust Estimate of Location: lat long depth mag -21.54 182.35 369.29 4.54 Robust Estimate of Covariance: lat long depth mag lat 2.18e+01 4.82e+00 2.53e+02 -3.54e-01 long 4.82e+00 5.87e+00 -4.63e+02 7.45e-02 depth 2.53e+02 -4.63e+02 6.51e+04 -2.10e+01 mag -3.54e-01 7.45e-02 -2.10e+01 1.83e-01 -------------------------------------------------------- =================================================== > dodata(method="rocke") Call: dodata(method = "rocke") Data Set n p LOG(det) Time =================================================== heart 12 2 7.285196 Outliers: 3 [1] 2 6 12 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: height weight 34.3 26.1 Robust Estimate of Covariance: height weight height 105 159 weight 159 256 -------------------------------------------------------- starsCYG 47 2 -5.929361 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: log.Te log.light 4.42 4.93 Robust Estimate of Covariance: log.Te log.light log.Te 0.0193 0.0709 log.light 0.0709 0.3987 -------------------------------------------------------- phosphor 18 2 8.907518 Outliers: 3 [1] 1 6 10 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: inorg organic 15.8 39.4 Robust Estimate of Covariance: inorg organic inorg 196 252 organic 252 360 -------------------------------------------------------- stackloss 21 3 8.143313 Outliers: 4 [1] 1 2 3 21 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 56.8 20.2 86.4 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 29.26 9.62 14.78 Water.Temp 9.62 8.54 6.25 Acid.Conc. 14.78 6.25 29.70 -------------------------------------------------------- coleman 20 5 4.001659 Outliers: 5 [1] 2 6 9 10 13 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.81 40.27 2.11 25.01 6.27 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.2850 1.1473 2.0254 0.3536 0.0737 fatherWc 1.1473 798.0714 278.0145 6.4590 18.6357 sstatus 2.0254 278.0145 128.7601 4.0666 6.3845 teacherSc 0.3536 6.4590 4.0666 0.8749 0.2980 motherLev 0.0737 18.6357 6.3845 0.2980 0.4948 -------------------------------------------------------- salinity 28 3 3.455146 Outliers: 9 [1] 3 5 10 11 15 16 17 23 24 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: X1 X2 X3 9.89 3.10 22.46 Robust Estimate of Covariance: X1 X2 X3 X1 12.710 1.868 -4.135 X2 1.868 4.710 -0.663 X3 -4.135 -0.663 1.907 -------------------------------------------------------- wood 20 5 -35.020244 Outliers: 7 [1] 4 6 7 8 11 16 19 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: x1 x2 x3 x4 x5 0.588 0.123 0.534 0.535 0.891 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 6.60e-03 1.25e-03 2.16e-03 -3.73e-04 -1.10e-03 x2 1.25e-03 3.30e-04 8.91e-04 -1.23e-05 2.62e-05 x3 2.16e-03 8.91e-04 4.55e-03 -4.90e-04 1.93e-04 x4 -3.73e-04 -1.23e-05 -4.90e-04 2.01e-03 1.36e-03 x5 -1.10e-03 2.62e-05 1.93e-04 1.36e-03 1.95e-03 -------------------------------------------------------- hbk 75 3 1.413303 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: X1 X2 X3 1.56 1.77 1.68 Robust Estimate of Covariance: X1 X2 X3 X1 1.6483 0.0825 0.2133 X2 0.0825 1.6928 0.2334 X3 0.2133 0.2334 1.5334 -------------------------------------------------------- Animals 28 2 17.787210 Outliers: 11 [1] 2 6 7 9 12 14 15 16 24 25 28 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: body brain 60.6 150.2 Robust Estimate of Covariance: body brain body 10670 19646 brain 19646 41147 -------------------------------------------------------- milk 86 8 -25.169970 Outliers: 22 [1] 1 2 3 11 12 13 14 15 16 17 18 20 27 28 41 44 47 70 73 74 75 77 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.87 33.14 26.19 25.17 25.11 123.16 14.41 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 4.47e-07 1.77e-04 1.94e-04 1.79e-04 1.60e-04 1.45e-04 6.45e-04 X2 1.77e-04 2.36e+00 4.03e-01 3.08e-01 2.08e-01 3.45e-01 2.18e+00 X3 1.94e-04 4.03e-01 1.13e+00 8.31e-01 8.08e-01 7.79e-01 9.83e-01 X4 1.79e-04 3.08e-01 8.31e-01 6.62e-01 6.22e-01 5.95e-01 7.82e-01 X5 1.60e-04 2.08e-01 8.08e-01 6.22e-01 6.51e-01 5.93e-01 7.60e-01 X6 1.45e-04 3.45e-01 7.79e-01 5.95e-01 5.93e-01 5.88e-01 7.81e-01 X7 6.45e-04 2.18e+00 9.83e-01 7.82e-01 7.60e-01 7.81e-01 4.81e+00 X8 2.47e-05 2.57e-01 2.00e-01 1.37e-01 1.13e-01 1.28e-01 4.38e-01 X8 X1 2.47e-05 X2 2.57e-01 X3 2.00e-01 X4 1.37e-01 X5 1.13e-01 X6 1.28e-01 X7 4.38e-01 X8 1.61e-01 -------------------------------------------------------- bushfire 38 5 21.641566 Outliers: 13 [1] 7 8 9 10 11 31 32 33 34 35 36 37 38 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: V1 V2 V3 V4 V5 111 150 256 214 276 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 554 408 -2321 -464 -393 V2 408 343 -1361 -244 -215 V3 -2321 -1361 14690 3277 2684 V4 -464 -244 3277 783 629 V5 -393 -215 2684 629 509 -------------------------------------------------------- rice 105 5 -7.208835 Outliers: 8 [1] 9 14 40 42 49 57 58 71 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: Favor Appearance Taste Stickiness Toughness -0.21721 0.20948 -0.04581 0.15355 -0.00254 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.432 0.337 0.417 0.382 -0.201 Appearance 0.337 0.591 0.553 0.510 -0.295 Taste 0.417 0.553 0.735 0.683 -0.385 Stickiness 0.382 0.510 0.683 0.834 -0.462 Toughness -0.201 -0.295 -0.385 -0.462 0.408 -------------------------------------------------------- hemophilia 75 2 -7.453807 Outliers: 2 [1] 46 53 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: AHFactivity AHFantigen -0.2276 -0.0637 Robust Estimate of Covariance: AHFactivity AHFantigen AHFactivity 0.0405 0.0221 AHFantigen 0.0221 0.0263 -------------------------------------------------------- fish 159 6 13.110263 Outliers: 47 [1] 38 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 [20] 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 [39] 98 99 100 101 102 103 104 140 142 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 452.1 27.2 29.5 32.6 30.8 15.0 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 132559.85 2817.97 3035.69 3369.07 1231.68 112.19 Length1 2817.97 64.16 68.74 75.36 22.52 2.37 Length2 3035.69 68.74 73.77 81.12 25.57 2.47 Length3 3369.07 75.36 81.12 91.65 37.39 1.40 Height 1231.68 22.52 25.57 37.39 50.91 -3.92 Width 112.19 2.37 2.47 1.40 -3.92 1.87 -------------------------------------------------------- airquality 153 4 21.181656 Outliers: 13 [1] 6 7 11 14 17 20 23 30 34 53 63 77 107 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: Ozone Solar.R Wind Temp 40.21 198.33 9.76 79.35 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 885.7 581.1 -57.3 226.4 Solar.R 581.1 8870.9 26.2 -15.1 Wind -57.3 26.2 11.8 -13.4 Temp 226.4 -15.1 -13.4 89.4 -------------------------------------------------------- attitude 30 7 27.836398 Outliers: 8 [1] 1 9 13 14 17 18 24 26 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: rating complaints privileges learning raises critical 64.0 65.4 50.5 54.9 63.1 72.6 advance 40.5 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 180.10 153.16 42.04 128.90 90.25 18.75 39.81 complaints 153.16 192.38 58.32 142.48 94.29 8.13 45.33 privileges 42.04 58.32 113.65 82.31 69.53 23.13 61.96 learning 128.90 142.48 82.31 156.99 101.74 13.22 49.64 raises 90.25 94.29 69.53 101.74 110.85 47.84 55.76 critical 18.75 8.13 23.13 13.22 47.84 123.00 36.97 advance 39.81 45.33 61.96 49.64 55.76 36.97 53.59 -------------------------------------------------------- attenu 182 5 9.726797 Outliers: 44 [1] 1 2 4 5 6 7 8 9 10 11 13 15 16 19 20 21 22 23 24 [20] 25 27 28 29 30 31 32 40 45 60 61 64 65 78 80 81 93 94 95 [39] 96 97 98 99 100 108 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: event mag station dist accel 16.39 5.82 60.89 27.97 0.12 Robust Estimate of Covariance: event mag station dist accel event 4.20e+01 -1.97e+00 1.44e+02 -3.50e+01 4.05e-02 mag -1.97e+00 5.05e-01 -4.78e+00 4.63e+00 4.19e-03 station 1.44e+02 -4.78e+00 1.47e+03 -5.74e+01 7.88e-01 dist -3.50e+01 4.63e+00 -5.74e+01 3.99e+02 -1.18e+00 accel 4.05e-02 4.19e-03 7.88e-01 -1.18e+00 7.71e-03 -------------------------------------------------------- USJudgeRatings 43 12 -46.356873 Outliers: 15 [1] 1 5 7 8 12 13 14 17 20 21 23 30 31 35 42 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.56 8.12 7.70 7.91 7.74 7.82 7.66 7.66 7.50 7.58 8.22 7.86 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP CONT 0.63426 -0.20121 -0.31858 -0.09578 0.00521 -0.00436 -0.07140 INTG -0.20121 0.28326 0.37540 0.27103 0.20362 0.19838 0.25706 DMNR -0.31858 0.37540 0.58265 0.33615 0.25649 0.24804 0.31696 DILG -0.09578 0.27103 0.33615 0.32588 0.27022 0.26302 0.32236 CFMG 0.00521 0.20362 0.25649 0.27022 0.25929 0.24217 0.27784 DECI -0.00436 0.19838 0.24804 0.26302 0.24217 0.23830 0.27284 PREP -0.07140 0.25706 0.31696 0.32236 0.27784 0.27284 0.35071 FAMI -0.07118 0.25858 0.29511 0.32582 0.27863 0.27657 0.35941 ORAL -0.11149 0.27055 0.33919 0.31768 0.27339 0.26739 0.34200 WRIT -0.10050 0.26857 0.32570 0.32327 0.27860 0.27201 0.34399 PHYS -0.09693 0.15339 0.18416 0.17089 0.13837 0.14895 0.18472 RTEN -0.15643 0.31793 0.40884 0.33863 0.27073 0.26854 0.34049 FAMI ORAL WRIT PHYS RTEN CONT -0.07118 -0.11149 -0.10050 -0.09693 -0.15643 INTG 0.25858 0.27055 0.26857 0.15339 0.31793 DMNR 0.29511 0.33919 0.32570 0.18416 0.40884 DILG 0.32582 0.31768 0.32327 0.17089 0.33863 CFMG 0.27863 0.27339 0.27860 0.13837 0.27073 DECI 0.27657 0.26739 0.27201 0.14895 0.26854 PREP 0.35941 0.34200 0.34399 0.18472 0.34049 FAMI 0.38378 0.35617 0.36094 0.19998 0.35048 ORAL 0.35617 0.34918 0.34808 0.19759 0.35217 WRIT 0.36094 0.34808 0.35242 0.19666 0.35090 PHYS 0.19998 0.19759 0.19666 0.14770 0.20304 RTEN 0.35048 0.35217 0.35090 0.20304 0.39451 -------------------------------------------------------- USArrests 50 4 19.206310 Outliers: 4 [1] 2 28 33 39 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: Murder Assault UrbanPop Rape 7.55 160.94 65.10 19.97 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 25.6 409.5 23.4 32.1 Assault 409.5 8530.9 676.9 669.4 UrbanPop 23.4 676.9 269.9 76.6 Rape 32.1 669.4 76.6 76.6 -------------------------------------------------------- longley 16 7 13.387132 Outliers: 4 [1] 1 2 3 4 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 105.5 422.4 318.3 299.7 119.5 Year Employed 1956.1 66.5 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 59.97 582.66 694.99 -237.75 46.12 GNP 582.66 5849.82 6383.68 -2207.26 461.15 Unemployed 694.99 6383.68 11155.03 -3104.18 534.25 Armed.Forces -237.75 -2207.26 -3104.18 1429.11 -171.28 Population 46.12 461.15 534.25 -171.28 36.79 Year 29.01 287.48 340.95 -112.61 22.85 Employed 18.99 193.66 186.31 -76.88 14.94 Year Employed GNP.deflator 29.01 18.99 GNP 287.48 193.66 Unemployed 340.95 186.31 Armed.Forces -112.61 -76.88 Population 22.85 14.94 Year 14.36 9.45 Employed 9.45 6.90 -------------------------------------------------------- Loblolly 84 3 7.757906 Outliers: 27 [1] 5 6 11 12 18 23 24 29 30 35 36 41 42 47 48 53 54 59 60 65 66 71 72 77 78 [26] 83 84 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: height age Seed 21.72 8.60 7.58 Robust Estimate of Covariance: height age Seed height 316.590 102.273 5.939 age 102.273 33.465 -0.121 Seed 5.939 -0.121 27.203 -------------------------------------------------------- quakes 1000 4 11.473431 Outliers: 237 [1] 7 12 15 17 22 25 27 28 32 37 40 41 45 48 53 [16] 63 64 73 78 87 91 92 94 99 108 110 117 118 119 120 [31] 121 122 126 133 136 141 143 145 148 152 154 155 157 159 160 [46] 163 166 170 174 176 192 205 222 226 230 239 243 244 250 251 [61] 252 254 258 263 267 268 271 283 292 297 300 301 305 311 312 [76] 318 320 321 325 328 330 331 334 352 357 360 365 368 376 381 [91] 382 384 389 399 400 402 408 410 413 416 417 418 419 426 429 [106] 437 441 443 453 456 467 474 477 490 492 496 504 507 508 509 [121] 517 524 527 528 531 532 534 536 538 539 541 542 543 544 545 [136] 546 547 552 553 558 560 570 571 581 583 587 593 594 596 597 [151] 605 612 613 618 620 625 629 638 642 647 649 653 655 656 672 [166] 675 681 686 699 701 702 712 714 716 721 725 726 735 744 753 [181] 754 756 759 765 766 769 779 781 782 785 787 797 804 813 825 [196] 827 837 840 844 852 853 857 860 865 866 869 870 872 873 883 [211] 884 887 888 890 891 893 908 909 912 915 916 921 927 930 952 [226] 962 963 969 974 980 982 986 987 988 992 997 1000 ------------- Call: CovSest(x = x, method = method) -> Method: S-estimates: Rocke type Robust Estimate of Location: lat long depth mag -21.45 182.54 351.18 4.55 Robust Estimate of Covariance: lat long depth mag lat 2.10e+01 4.66e+00 2.45e+02 -3.38e-01 long 4.66e+00 5.88e+00 -4.63e+02 9.36e-02 depth 2.45e+02 -4.63e+02 6.38e+04 -2.02e+01 mag -3.38e-01 9.36e-02 -2.02e+01 1.78e-01 -------------------------------------------------------- =================================================== > dodata(method="MM") Call: dodata(method = "MM") Data Set n p LOG(det) Time =================================================== heart 12 2 2.017701 Outliers: 1 [1] 6 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: height weight 40.0 37.7 Robust Estimate of Covariance: height weight height 99.2 205.7 weight 205.7 458.9 -------------------------------------------------------- starsCYG 47 2 -1.450032 Outliers: 7 [1] 7 9 11 14 20 30 34 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: log.Te log.light 4.41 4.94 Robust Estimate of Covariance: log.Te log.light log.Te 0.0180 0.0526 log.light 0.0526 0.3217 -------------------------------------------------------- phosphor 18 2 2.320721 Outliers: 1 [1] 6 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: inorg organic 12.3 41.4 Robust Estimate of Covariance: inorg organic inorg 94.2 67.2 organic 67.2 162.1 -------------------------------------------------------- stackloss 21 3 1.470031 Outliers: 0 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: Air.Flow Water.Temp Acid.Conc. 60.2 21.0 86.4 Robust Estimate of Covariance: Air.Flow Water.Temp Acid.Conc. Air.Flow 81.13 21.99 23.15 Water.Temp 21.99 10.01 6.43 Acid.Conc. 23.15 6.43 27.22 -------------------------------------------------------- coleman 20 5 0.491419 Outliers: 1 [1] 10 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: salaryP fatherWc sstatus teacherSc motherLev 2.74 43.14 3.65 25.07 6.32 Robust Estimate of Covariance: salaryP fatherWc sstatus teacherSc motherLev salaryP 0.1878 2.0635 1.0433 0.2721 0.0582 fatherWc 2.0635 670.2232 211.0609 4.3625 15.6083 sstatus 1.0433 211.0609 92.8743 2.6532 5.1816 teacherSc 0.2721 4.3625 2.6532 1.2757 0.1613 motherLev 0.0582 15.6083 5.1816 0.1613 0.4192 -------------------------------------------------------- salinity 28 3 0.734619 Outliers: 2 [1] 5 16 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: X1 X2 X3 10.46 2.66 23.15 Robust Estimate of Covariance: X1 X2 X3 X1 10.079 -0.024 -1.899 X2 -0.024 3.466 -1.817 X3 -1.899 -1.817 3.665 -------------------------------------------------------- wood 20 5 -3.202636 Outliers: 0 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: x1 x2 x3 x4 x5 0.550 0.133 0.506 0.511 0.909 Robust Estimate of Covariance: x1 x2 x3 x4 x5 x1 0.008454 -0.000377 0.003720 0.002874 -0.003065 x2 -0.000377 0.000516 -0.000399 -0.000933 0.000645 x3 0.003720 -0.000399 0.004186 0.001720 -0.001714 x4 0.002874 -0.000933 0.001720 0.003993 -0.001028 x5 -0.003065 0.000645 -0.001714 -0.001028 0.002744 -------------------------------------------------------- hbk 75 3 0.283145 Outliers: 14 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: X1 X2 X3 1.54 1.79 1.68 Robust Estimate of Covariance: X1 X2 X3 X1 1.8016 0.0739 0.2000 X2 0.0739 1.8301 0.2295 X3 0.2000 0.2295 1.7101 -------------------------------------------------------- Animals 28 2 4.685129 Outliers: 10 [1] 2 6 7 9 12 14 15 16 24 25 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: body brain 82 148 Robust Estimate of Covariance: body brain body 21050 24534 brain 24534 35135 -------------------------------------------------------- milk 86 8 -1.437863 Outliers: 12 [1] 1 2 3 12 13 17 41 44 47 70 74 75 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: X1 X2 X3 X4 X5 X6 X7 X8 1.03 35.73 32.87 25.96 24.94 24.85 122.55 14.33 Robust Estimate of Covariance: X1 X2 X3 X4 X5 X6 X7 X1 1.08e-06 5.36e-04 6.80e-04 5.96e-04 5.87e-04 5.91e-04 2.22e-03 X2 5.36e-04 2.42e+00 7.07e-01 5.51e-01 4.89e-01 5.70e-01 3.08e+00 X3 6.80e-04 7.07e-01 1.64e+00 1.28e+00 1.25e+00 1.26e+00 2.38e+00 X4 5.96e-04 5.51e-01 1.28e+00 1.05e+00 1.01e+00 1.02e+00 2.01e+00 X5 5.87e-04 4.89e-01 1.25e+00 1.01e+00 1.05e+00 1.02e+00 1.96e+00 X6 5.91e-04 5.70e-01 1.26e+00 1.02e+00 1.02e+00 1.05e+00 2.01e+00 X7 2.22e-03 3.08e+00 2.38e+00 2.01e+00 1.96e+00 2.01e+00 9.22e+00 X8 1.68e-04 4.13e-01 3.37e-01 2.53e-01 2.34e-01 2.43e-01 8.81e-01 X8 X1 1.68e-04 X2 4.13e-01 X3 3.37e-01 X4 2.53e-01 X5 2.34e-01 X6 2.43e-01 X7 8.81e-01 X8 2.11e-01 -------------------------------------------------------- bushfire 38 5 2.443148 Outliers: 12 [1] 8 9 10 11 31 32 33 34 35 36 37 38 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: V1 V2 V3 V4 V5 109 149 258 215 276 Robust Estimate of Covariance: V1 V2 V3 V4 V5 V1 708 538 -2705 -558 -464 V2 538 497 -1376 -248 -216 V3 -2705 -1376 20521 4833 3914 V4 -558 -248 4833 1217 969 V5 -464 -216 3914 969 778 -------------------------------------------------------- rice 105 5 -0.724874 Outliers: 5 [1] 9 42 49 58 71 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: Favor Appearance Taste Stickiness Toughness -0.2653 0.0969 -0.1371 0.0483 0.0731 Robust Estimate of Covariance: Favor Appearance Taste Stickiness Toughness Favor 0.421 0.349 0.427 0.405 -0.191 Appearance 0.349 0.605 0.565 0.553 -0.316 Taste 0.427 0.565 0.725 0.701 -0.378 Stickiness 0.405 0.553 0.701 0.868 -0.484 Toughness -0.191 -0.316 -0.378 -0.484 0.464 -------------------------------------------------------- hemophilia 75 2 -1.868949 Outliers: 2 [1] 11 36 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: AHFactivity AHFantigen -0.2342 -0.0333 Robust Estimate of Covariance: AHFactivity AHFantigen AHFactivity 0.0309 0.0122 AHFantigen 0.0122 0.0231 -------------------------------------------------------- fish 159 6 1.285876 Outliers: 20 [1] 61 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 [20] 142 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: Weight Length1 Length2 Length3 Height Width 352.7 24.3 26.4 29.2 29.7 14.6 Robust Estimate of Covariance: Weight Length1 Length2 Length3 Height Width Weight 1.20e+05 2.89e+03 3.12e+03 3.51e+03 1.49e+03 2.83e+02 Length1 2.89e+03 7.73e+01 8.35e+01 9.28e+01 3.73e+01 9.26e+00 Length2 3.12e+03 8.35e+01 9.04e+01 1.01e+02 4.16e+01 1.01e+01 Length3 3.51e+03 9.28e+01 1.01e+02 1.14e+02 5.37e+01 1.01e+01 Height 1.49e+03 3.73e+01 4.16e+01 5.37e+01 6.75e+01 3.22e+00 Width 2.83e+02 9.26e+00 1.01e+01 1.01e+01 3.22e+00 4.18e+00 -------------------------------------------------------- airquality 153 4 2.684374 Outliers: 6 [1] 7 14 23 30 34 77 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: Ozone Solar.R Wind Temp 40.35 186.21 9.86 78.09 Robust Estimate of Covariance: Ozone Solar.R Wind Temp Ozone 951.0 959.9 -62.5 224.6 Solar.R 959.9 8629.9 -28.1 244.9 Wind -62.5 -28.1 11.6 -15.8 Temp 224.6 244.9 -15.8 93.1 -------------------------------------------------------- attitude 30 7 2.091968 Outliers: 4 [1] 14 16 18 24 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: rating complaints privileges learning raises critical 65.0 66.5 52.4 56.2 65.3 75.6 advance 42.7 Robust Estimate of Covariance: rating complaints privileges learning raises critical advance rating 143.5 123.4 62.4 92.5 79.2 17.7 28.2 complaints 123.4 159.8 83.9 99.7 96.0 27.3 44.0 privileges 62.4 83.9 133.5 78.6 62.0 13.4 46.4 learning 92.5 99.7 78.6 136.0 90.9 18.9 62.6 raises 79.2 96.0 62.0 90.9 107.6 34.6 63.3 critical 17.7 27.3 13.4 18.9 34.6 84.9 25.9 advance 28.2 44.0 46.4 62.6 63.3 25.9 94.4 -------------------------------------------------------- attenu 182 5 1.148032 Outliers: 21 [1] 2 7 8 9 10 11 15 16 24 25 28 29 30 31 32 64 65 94 95 [20] 96 100 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: event mag station dist accel 15.36 5.95 58.11 33.56 0.14 Robust Estimate of Covariance: event mag station dist accel event 4.88e+01 -2.74e+00 1.53e+02 -1.14e+02 5.95e-02 mag -2.74e+00 5.32e-01 -6.29e+00 1.10e+01 9.37e-03 station 1.53e+02 -6.29e+00 1.29e+03 -2.95e+02 1.04e+00 dist -1.14e+02 1.10e+01 -2.95e+02 1.13e+03 -2.41e+00 accel 5.95e-02 9.37e-03 1.04e+00 -2.41e+00 1.70e-02 -------------------------------------------------------- USJudgeRatings 43 12 -1.683847 Outliers: 7 [1] 5 7 12 13 14 23 31 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: CONT INTG DMNR DILG CFMG DECI PREP FAMI ORAL WRIT PHYS RTEN 7.45 8.15 7.74 7.87 7.67 7.74 7.65 7.65 7.50 7.57 8.17 7.85 Robust Estimate of Covariance: CONT INTG DMNR DILG CFMG DECI PREP FAMI CONT 0.9403 -0.2500 -0.3953 -0.1418 -0.0176 -0.0620 -0.1304 -0.1517 INTG -0.2500 0.6314 0.8479 0.6889 0.5697 0.5386 0.7007 0.6985 DMNR -0.3953 0.8479 1.2186 0.9027 0.7613 0.7232 0.9191 0.9055 DILG -0.1418 0.6889 0.9027 0.8474 0.7344 0.6949 0.8751 0.8655 CFMG -0.0176 0.5697 0.7613 0.7344 0.6904 0.6442 0.7683 0.7594 DECI -0.0620 0.5386 0.7232 0.6949 0.6442 0.6219 0.7362 0.7360 PREP -0.1304 0.7007 0.9191 0.8751 0.7683 0.7362 0.9370 0.9357 FAMI -0.1517 0.6985 0.9055 0.8655 0.7594 0.7360 0.9357 0.9547 ORAL -0.1866 0.7375 0.9841 0.8816 0.7747 0.7433 0.9400 0.9496 WRIT -0.1881 0.7208 0.9516 0.8711 0.7646 0.7357 0.9302 0.9439 PHYS -0.1407 0.4673 0.6261 0.5661 0.5105 0.5039 0.5996 0.6112 RTEN -0.2494 0.7921 1.0688 0.9167 0.7902 0.7585 0.9533 0.9561 ORAL WRIT PHYS RTEN CONT -0.1866 -0.1881 -0.1407 -0.2494 INTG 0.7375 0.7208 0.4673 0.7921 DMNR 0.9841 0.9516 0.6261 1.0688 DILG 0.8816 0.8711 0.5661 0.9167 CFMG 0.7747 0.7646 0.5105 0.7902 DECI 0.7433 0.7357 0.5039 0.7585 PREP 0.9400 0.9302 0.5996 0.9533 FAMI 0.9496 0.9439 0.6112 0.9561 ORAL 0.9712 0.9558 0.6271 0.9933 WRIT 0.9558 0.9483 0.6135 0.9725 PHYS 0.6271 0.6135 0.4816 0.6549 RTEN 0.9933 0.9725 0.6549 1.0540 -------------------------------------------------------- USArrests 50 4 2.411726 Outliers: 3 [1] 2 33 39 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: Murder Assault UrbanPop Rape 7.52 163.86 65.66 20.64 Robust Estimate of Covariance: Murder Assault UrbanPop Rape Murder 19.05 295.96 8.32 23.40 Assault 295.96 6905.03 396.53 523.49 UrbanPop 8.32 396.53 202.98 62.81 Rape 23.40 523.49 62.81 79.10 -------------------------------------------------------- longley 16 7 1.038316 Outliers: 5 [1] 1 2 3 4 5 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: GNP.deflator GNP Unemployed Armed.Forces Population 107.5 440.4 339.4 293.0 120.9 Year Employed 1957.0 67.2 Robust Estimate of Covariance: GNP.deflator GNP Unemployed Armed.Forces Population GNP.deflator 100.4 953.8 1140.8 -501.8 74.3 GNP 953.8 9434.3 10084.3 -4573.8 731.3 Unemployed 1140.8 10084.3 19644.6 -6296.3 848.4 Armed.Forces -501.8 -4573.8 -6296.3 3192.3 -348.5 Population 74.3 731.3 848.4 -348.5 57.7 Year 46.3 450.7 537.0 -230.7 35.3 Employed 30.8 310.2 273.8 -159.4 23.3 Year Employed GNP.deflator 46.3 30.8 GNP 450.7 310.2 Unemployed 537.0 273.8 Armed.Forces -230.7 -159.4 Population 35.3 23.3 Year 21.9 14.6 Employed 14.6 11.2 -------------------------------------------------------- Loblolly 84 3 1.481317 Outliers: 0 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: height age Seed 31.93 12.79 7.48 Robust Estimate of Covariance: height age Seed height 440.644 165.652 6.958 age 165.652 63.500 0.681 Seed 6.958 0.681 16.564 -------------------------------------------------------- quakes 1000 4 1.576855 Outliers: 218 [1] 7 12 15 17 22 27 32 37 40 41 45 48 53 63 64 [16] 73 78 87 91 92 94 99 108 110 117 118 119 120 121 122 [31] 126 133 136 141 143 145 148 152 154 155 157 159 160 163 170 [46] 192 205 222 226 230 239 243 250 251 252 254 258 263 267 268 [61] 271 283 292 300 301 305 311 312 318 320 321 325 328 330 334 [76] 352 357 360 365 381 382 384 389 400 402 408 413 416 417 419 [91] 429 437 441 443 453 456 467 474 477 490 492 496 504 507 508 [106] 509 517 524 527 528 531 532 534 536 538 539 541 542 543 544 [121] 545 546 547 552 553 560 571 581 583 587 593 594 596 597 605 [136] 612 613 618 620 625 629 638 642 647 649 653 655 656 672 675 [151] 681 686 699 701 702 712 714 716 721 725 726 735 744 754 756 [166] 759 765 766 769 779 781 782 785 787 797 804 813 825 827 837 [181] 840 844 852 853 857 860 865 866 869 870 872 873 883 884 887 [196] 888 890 891 893 908 909 912 915 916 921 927 930 962 963 969 [211] 974 980 982 986 987 988 997 1000 ------------- Call: CovMMest(x = x) -> Method: MM-estimates Robust Estimate of Location: lat long depth mag -21.74 182.37 356.37 4.56 Robust Estimate of Covariance: lat long depth mag lat 2.97e+01 6.53e+00 3.46e+02 -4.66e-01 long 6.53e+00 6.92e+00 -5.05e+02 5.62e-02 depth 3.46e+02 -5.05e+02 7.39e+04 -2.51e+01 mag -4.66e-01 5.62e-02 -2.51e+01 2.32e-01 -------------------------------------------------------- =================================================== > ##dogen() > ##cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons'' > > proc.time() user system elapsed 24.41 0.71 25.36 rrcov/tests/thubert.Rout.save0000644000176200001440000015462613373056076016064 0ustar liggesusers R Under development (unstable) (2018-11-12 r75592) -- "Unsuffered Consequences" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method=c("hubert", "hubert.mcd", "locantore", "cov", "classic")){ + ## Test the function PcaHubert() on the literature datasets: + ## + ## Call PcaHubert() for all regression datasets available in + ## robustbase/rrcov and print: + ## - execution time (if time == TRUE) + ## - loadings + ## - eigenvalues + ## - scores + ## + + dopca <- function(x, xname, nrep=1){ + + n <- dim(x)[1] + p <- dim(x)[2] + if(method == "hubert.mcd") + pca <- PcaHubert(x, k=p) + else if(method == "hubert") + pca <- PcaHubert(x, mcd=FALSE) + else if(method == "locantore") + pca <- PcaLocantore(x) + else if(method == "cov") + pca <- PcaCov(x) + else if(method == "classic") + pca <- PcaClassic(x) + else + stop("Undefined PCA method: ", method) + + + e1 <- getEigenvalues(pca)[1] + e2 <- getEigenvalues(pca)[2] + k <- pca@k + + if(time){ + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + xres <- sprintf("%3d %3d %3d %12.6f %12.6f %10.3f\n", dim(x)[1], dim(x)[2], k, e1, e2, xtime) + } + else{ + xres <- sprintf("%3d %3d %3d %12.6f %12.6f\n", dim(x)[1], dim(x)[2], k, e1, e2) + } + lpad<-lname-nchar(xname) + cat(pad.right(xname, lpad), xres) + + if(!short){ + cat("Scores: \n") + print(getScores(pca)) + + if(full){ + cat("-------------\n") + show(pca) + } + cat("----------------------------------------------------------\n") + } + } + + stopifnot(length(nrep) == 1, nrep >= 1) + method <- match.arg(method) + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + lname <- 20 + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + + data(Animals, package = "MASS") + brain <- Animals[c(1:24, 26:25, 27:28),] + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + + cat("Data Set n p k e1 e2\n") + cat("==========================================================\n") + dopca(heart[, 1:2], data(heart), nrep) + dopca(starsCYG, data(starsCYG), nrep) + dopca(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) + dopca(stack.x, data(stackloss), nrep) + ## dopca(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) # differences between the architectures + dopca(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) + ## dopca(data.matrix(subset(wood, select = -y)), data(wood), nrep) # differences between the architectures + dopca(data.matrix(subset(hbk, select = -Y)),data(hbk), nrep) + + ## dopca(brain, "Animals", nrep) + dopca(milk, data(milk), nrep) + dopca(bushfire, data(bushfire), nrep) + cat("==========================================================\n") + } > > dogen <- function(nrep=1, eps=0.49, method=c("hubert", "hubert.mcd", "locantore", "cov")){ + + dopca <- function(x, nrep=1){ + gc() + xtime <- system.time(dorep(x, nrep, method))[1]/nrep + cat(sprintf("%6d %3d %10.2f\n", dim(x)[1], dim(x)[2], xtime)) + xtime + } + + set.seed(1234) + + ## VT::15.09.2013 - this will render the output independent + ## from the version of the package + suppressPackageStartupMessages(library(rrcov)) + library(MASS) + + method <- match.arg(method) + + ap <- c(2, 5, 10, 20, 30) + an <- c(100, 500, 1000, 10000, 50000) + + tottime <- 0 + cat(" n p Time\n") + cat("=====================\n") + for(i in 1:length(an)) { + for(j in 1:length(ap)) { + n <- an[i] + p <- ap[j] + if(5*p <= n){ + xx <- gendata(n, p, eps) + X <- xx$X + ## print(dimnames(X)) + tottime <- tottime + dopca(X, nrep) + } + } + } + + cat("=====================\n") + cat("Total time: ", tottime*nrep, "\n") + } > > dorep <- function(x, nrep=1, method=c("hubert", "hubert.mcd", "locantore", "cov")){ + + method <- match.arg(method) + for(i in 1:nrep) + if(method == "hubert.mcd") + PcaHubert(x) + else if(method == "hubert") + PcaHubert(x, mcd=FALSE) + else if(method == "locantore") + PcaLocantore(x) + else if(method == "cov") + PcaCov(x) + else + stop("Undefined PCA method: ", method) + } > > #### gendata() #### > # Generates a location contaminated multivariate > # normal sample of n observations in p dimensions > # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) > # where > # m = (b,b,...,b) > # Defaults: eps=0 and b=10 > # > gendata <- function(n,p,eps=0,b=10){ + + if(missing(n) || missing(p)) + stop("Please specify (n,p)") + if(eps < 0 || eps >= 0.5) + stop(message="eps must be in [0,0.5)") + X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) + nbad <- as.integer(eps * n) + xind <- vector("numeric") + if(nbad > 0){ + Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) + xind <- sample(n,nbad) + X[xind,] <- Xbad + } + list(X=X, xind=xind) + } > > pad.right <- function(z, pads) + { + ### Pads spaces to right of text + padding <- paste(rep(" ", pads), collapse = "") + paste(z, padding, sep = "") + } > > whatis<-function(x){ + if(is.data.frame(x)) + cat("Type: data.frame\n") + else if(is.matrix(x)) + cat("Type: matrix\n") + else if(is.vector(x)) + cat("Type: vector\n") + else + cat("Type: don't know\n") + } > > ################################################################# > ## VT::27.08.2010 > ## bug report from Stephen Milborrow > ## > test.case.1 <- function() + { + X <- matrix(c( + -0.79984, -1.00103, 0.899794, 0.00000, + 0.34279, 0.52832, -1.303783, -1.17670, + -0.79984, -1.00103, 0.899794, 0.00000, + 0.34279, 0.52832, -1.303783, -1.17670, + 0.34279, 0.52832, -1.303783, -1.17670, + 1.48542, 0.66735, 0.716162, 1.17670, + -0.79984, -1.00103, 0.899794, 0.00000, + 1.69317, 1.91864, -0.018363, 1.76505, + -1.00759, -0.16684, -0.385626, 0.58835, + -0.79984, -1.00103, 0.899794, 0.00000), ncol=4, byrow=TRUE) + + cc1 <- PcaHubert(X, k=3) + + cc2 <- PcaLocantore(X, k=3) + cc3 <- PcaCov(X, k=3, cov.control=CovControlSest()) + + cc4 <- PcaProj(X, k=2) # with k=3 will produce warnings in .distances - too small eignevalues + cc5 <- PcaGrid(X, k=2) # dito + + list(cc1, cc2, cc3, cc4, cc5) + } > > ################################################################# > ## VT::05.08.2016 > ## bug report from Matthieu Lesnoff > ## > test.case.2 <- function() + { + do.test.case.2 <- function(z) + { + if(missing(z)) + { + set.seed(12345678) + n <- 5 + z <- data.frame(v1 = rnorm(n), v2 = rnorm(n), v3 = rnorm(n)) + z + } + + fm <- PcaLocantore(z, k = 2, scale = TRUE) + fm@scale + apply(z, MARGIN = 2, FUN = mad) + scale(z, center = fm@center, scale = fm@scale) + + T <- fm@scores + P <- fm@loadings + E <- scale(z, center = fm@center, scale = fm@scale) - T %*% t(P) + d2 <- apply(E^2, MARGIN = 1, FUN = sum) + ## print(sqrt(d2)); print(fm@od) + print(ret <- all.equal(sqrt(d2), fm@od)) + + ret + } + do.test.case.2() + do.test.case.2(phosphor) + do.test.case.2(stackloss) + do.test.case.2(salinity) + do.test.case.2(hbk) + do.test.case.2(milk) + do.test.case.2(bushfire) + data(rice); do.test.case.2(rice) + data(un86); do.test.case.2(un86) + } > > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > > dodata(method="classic") Call: dodata(method = "classic") Data Set n p k e1 e2 ========================================================== heart 12 2 2 812.379735 9.084962 Scores: PC1 PC2 1 2.7072 1.46576 2 59.9990 -1.43041 3 -3.5619 -1.54067 4 -7.7696 2.52687 5 14.7660 -0.95822 6 -20.0489 6.91079 7 1.4189 2.25961 8 -34.3308 -4.23717 9 -6.0487 -0.97859 10 -33.0102 -3.73143 11 -18.6372 0.25821 12 44.5163 -0.54476 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 28.5023 3.0141 ---------------------------------------------------------- starsCYG 47 2 2 0.331279 0.079625 Scores: PC1 PC2 1 0.2072999 0.089973 2 0.6855999 0.349644 3 -0.0743007 -0.061028 4 0.6855999 0.349644 5 0.1775161 0.015053 6 0.4223986 0.211351 7 -0.2926077 -0.516156 8 0.2188453 0.293607 9 0.5593696 0.028761 10 0.0983878 0.074540 11 0.8258140 -0.711176 12 0.4167063 0.180244 13 0.3799883 0.225541 14 -0.9105236 -0.432014 15 -0.7418831 -0.125322 16 -0.4432862 0.048287 17 -1.0503005 -0.229623 18 -0.8393302 -0.007831 19 -0.8126742 -0.195952 20 0.9842316 -0.688729 21 -0.6230699 -0.108486 22 -0.7814875 -0.130933 23 -0.6017038 0.025840 24 -0.1857772 0.155474 25 -0.0020261 0.070412 26 -0.3640775 0.059510 27 -0.3458392 -0.069204 28 -0.1208393 0.053577 29 -0.6033482 -0.176391 30 1.1440521 -0.676183 31 -0.5960920 -0.013765 32 0.0519296 0.259855 33 0.1861752 0.167779 34 1.3802755 -0.632611 35 -0.6542566 -0.173505 36 0.5583690 0.392215 37 0.0561384 0.230152 38 0.1861752 0.167779 39 0.1353472 0.241376 40 0.5355195 0.197080 41 -0.3980701 0.014294 42 0.0277576 0.145332 43 0.2979736 0.234120 44 0.3049884 0.184614 45 0.4889809 0.311684 46 -0.0514512 0.134108 47 -0.5224950 0.037063 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 0.57557 0.28218 ---------------------------------------------------------- phosphor 18 2 2 220.403422 68.346121 Scores: PC1 PC2 1 4.04290 -15.3459 2 -22.30489 -1.0004 3 -24.52683 3.2836 4 -12.54839 -6.0848 5 -19.37044 2.2979 6 15.20366 -19.9424 7 0.44222 -3.1379 8 -10.64042 3.6933 9 -11.67967 5.9670 10 14.26805 -7.0221 11 -4.98832 1.5268 12 8.74986 7.9379 13 12.26290 6.0251 14 6.27607 7.5768 15 17.53246 3.1560 16 -10.17024 -5.8994 17 21.05826 5.4492 18 16.39281 11.5191 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 14.8460 8.2672 ---------------------------------------------------------- stackloss 21 3 3 99.576089 19.581136 Scores: PC1 PC2 PC3 1 20.15352 -4.359452 0.324585 2 19.81554 -5.300468 0.308294 3 15.45222 -1.599136 -0.203125 4 2.40370 -0.145282 2.370302 5 1.89538 0.070566 0.448061 6 2.14954 -0.037358 1.409182 7 4.43153 5.500810 2.468051 8 4.43153 5.500810 2.468051 9 -1.47521 1.245404 2.511773 10 -5.11183 -4.802083 -2.407870 11 -2.07009 3.667055 -2.261247 12 -2.66223 2.833964 -3.238659 13 -4.43589 -2.920053 -2.375287 14 -0.46404 7.323193 -1.234961 15 -9.31959 6.232579 -0.056064 16 -10.33350 3.409533 -0.104938 17 -14.81094 -9.872607 0.628103 18 -12.44514 -3.285499 0.742143 19 -11.85300 -2.452408 1.719555 20 -5.73994 -2.494520 0.098250 21 9.98843 1.484952 -3.614198 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 9.9788 4.4251 1.8986 ---------------------------------------------------------- salinity 28 3 3 11.410736 7.075409 Scores: PC1 PC2 PC3 1 -0.937789 -2.40535 0.812909 2 -1.752631 -2.57774 2.004437 3 -6.509364 -0.78762 -1.821906 4 -5.619847 -2.41333 -1.586891 5 -7.268242 1.61012 1.563568 6 -4.316558 -3.20411 0.029376 7 -2.379545 -3.32371 0.703101 8 0.013514 -3.50586 1.260502 9 0.265262 -0.16736 -2.886883 10 1.890755 2.43623 -0.986832 11 0.804196 2.56656 0.387577 12 0.935082 -1.03559 -0.074081 13 1.814839 -1.61087 0.612290 14 3.407535 -0.15880 2.026088 15 1.731273 2.95159 -1.840286 16 -6.129708 7.21368 2.632273 17 -0.645124 1.06260 0.028697 18 -1.307532 -2.54679 -0.280273 19 0.483455 -0.55896 -3.097281 20 2.053267 0.47308 -1.858703 21 3.277664 -1.31002 0.453753 22 4.631644 -0.78005 1.519894 23 1.864403 5.32790 -0.849694 24 0.623899 4.29317 0.056461 25 1.301696 0.37871 -0.646220 26 2.852126 -0.79527 -0.347711 27 4.134051 -0.92756 0.449222 28 4.781679 -0.20467 1.736616 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 3.3780 2.6600 1.4836 ---------------------------------------------------------- hbk 75 3 3 216.162129 1.981077 Scores: PC1 PC2 PC3 1 26.2072 -0.660756 0.503340 2 27.0406 -0.108506 -0.225059 3 28.8351 -1.683721 0.263078 4 29.9221 -0.812174 -0.674480 5 29.3181 -0.909915 -0.121600 6 27.5360 -0.599697 0.916574 7 27.6617 -0.073753 0.676620 8 26.5576 -0.882312 0.159620 9 28.8726 -1.074223 -0.673462 10 27.6643 -1.463829 -0.868593 11 34.2019 -0.664473 -0.567265 12 35.4805 -2.730949 -0.259320 13 34.7544 1.325449 0.749884 14 38.9522 8.171389 0.034382 15 -5.5375 0.390704 1.679172 16 -7.4319 0.803850 1.925633 17 -8.5880 0.957577 -1.010312 18 -6.6022 -0.425109 0.625148 19 -6.5596 1.154721 -0.640680 20 -5.2525 0.812527 1.377832 21 -6.2771 0.067747 0.958907 22 -6.2501 1.325491 -1.104428 23 -7.2419 0.839808 0.728712 24 -7.6489 1.131606 0.154897 25 -9.0763 -0.670721 -0.167577 26 -5.5967 0.999411 -0.810000 27 -5.1460 -0.339018 1.326712 28 -7.1659 -0.993461 0.125933 29 -8.2104 -0.169338 -0.073569 30 -6.2499 -1.689222 -0.877481 31 -7.3180 -0.225795 1.687204 32 -7.9446 1.473868 -0.541790 33 -6.3604 1.237472 0.061800 34 -8.9812 -0.710662 -0.830422 35 -5.1698 -0.435484 1.102817 36 -5.9995 -0.058135 -0.713550 37 -5.8753 0.852882 -1.610556 38 -8.4501 0.334363 0.404813 39 -8.1751 -1.300317 0.633282 40 -7.4495 0.672712 -0.829815 41 -5.6213 -1.106765 1.395315 42 -6.8571 -0.900977 -1.509937 43 -7.0633 1.987372 -1.079934 44 -6.3763 -1.867647 -0.251224 45 -8.6456 -0.866053 0.630132 46 -6.5356 -1.763526 -0.189838 47 -8.2224 -1.183284 1.615150 48 -5.6136 -1.100704 1.079239 49 -5.9907 0.220336 1.443387 50 -5.2675 0.142923 0.194023 51 -7.9324 0.324710 1.113289 52 -7.5544 -1.033884 1.792496 53 -6.7119 -1.712257 -1.711778 54 -7.4679 1.856542 0.046658 55 -7.4666 1.161504 -0.725948 56 -6.7110 1.574868 0.534288 57 -8.2571 -0.399824 0.521995 58 -5.9781 1.312567 0.926790 59 -5.6960 -0.394338 -0.332938 60 -6.1017 -0.797579 -1.679359 61 -5.2628 0.919128 -1.436156 62 -9.1245 -0.516135 -0.229065 63 -7.7140 1.659145 0.068510 64 -4.9886 0.173613 0.865810 65 -6.6157 -1.479786 0.098390 66 -7.9511 0.772770 -0.998321 67 -7.1856 0.459602 0.216588 68 -8.7345 -0.860784 -1.238576 69 -8.5833 -0.313481 0.832074 70 -5.8642 -0.142883 -0.870064 71 -5.8879 0.186456 0.464467 72 -7.1865 0.497156 -0.826767 73 -6.8671 -0.058606 -1.335842 74 -7.1398 0.727642 -1.422331 75 -7.2696 -1.347832 -1.496927 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 14.70245 1.40751 0.95725 ---------------------------------------------------------- milk 86 8 8 15.940298 2.771345 Scores: PC1 PC2 PC3 PC4 PC5 PC6 PC7 1 6.471620 1.031110 0.469432 0.5736412 1.0294362 -0.6054039 -0.2005117 2 7.439545 0.320597 0.081922 -0.6305898 0.7128977 -1.1601053 -0.1170582 3 1.240654 -1.840458 0.520870 -0.1717469 0.2752079 -0.3815506 0.6004089 4 5.952685 -1.856375 1.638710 0.3358626 -0.5834205 -0.0665348 -0.1580799 5 -0.706973 0.261795 0.423736 0.2916399 -0.5307716 -0.3325563 -0.0062349 6 2.524050 0.293380 -0.572997 0.2466367 -0.3497882 0.0386014 -0.1418131 7 3.136085 -0.050202 -0.818165 -0.0451560 -0.5226337 -0.1597194 0.1669050 8 3.260390 0.312365 -0.110776 0.4908006 -0.5225353 -0.1972222 -0.1068433 9 -0.808914 -2.355785 1.344204 -0.4743284 -0.1394914 -0.1390080 -0.2620731 10 -2.511226 -0.995321 -0.087218 -0.5950040 0.4268321 0.2561918 0.0891170 11 -9.204096 -0.598364 1.587275 0.0833647 0.1865626 0.0358228 0.0920394 12 -12.946774 1.951332 -0.179186 0.2560603 0.1300954 -0.1179820 -0.0999494 13 -10.011603 0.726323 -2.102423 -1.3105560 0.3291550 0.0660007 -0.0794410 14 -11.983644 0.768224 -0.532227 -0.5161201 -0.0817164 -0.4358934 -0.1734612 15 -10.465714 -0.704271 2.035437 0.3713778 -0.0564830 -0.2696432 -0.1940091 16 -2.527619 -0.286939 0.354497 0.8571223 0.1585009 0.2272835 0.4386955 17 -0.514527 -2.895087 1.657181 0.2208239 0.1961109 0.1280496 -0.0182491 18 -1.763931 0.854269 -0.686282 0.2848209 -0.4813608 -0.2623962 0.4757030 19 -1.538419 -0.866477 1.103818 0.3874507 0.2086661 0.1267277 0.2354264 20 0.732842 -1.455594 1.097358 -0.2530588 -0.0302385 0.2654274 0.6093330 21 -2.530155 1.932885 -0.873095 0.6202295 -0.4153607 0.0048383 0.0067484 22 -0.772646 0.675846 -0.259539 0.4844670 -0.0893266 -0.2785557 -0.0424662 23 0.185417 1.413719 0.066135 1.1014470 0.0468093 0.0288637 0.2539994 24 -0.280536 0.908864 0.113221 1.3370381 0.3289929 0.2588134 -0.0356289 25 -3.503626 1.971233 0.203620 1.1975494 -0.3175317 0.1149685 0.0584396 26 -0.639313 1.175503 0.403906 0.9082134 -0.2648165 -0.1238813 -0.0174853 27 -2.923327 -0.365168 0.149478 0.8201430 -0.1544609 -0.4856934 -0.0058424 28 2.505633 3.050292 -0.554424 2.1416405 -0.0378764 0.1002280 -0.3888580 29 4.649504 1.054863 -0.081018 1.1454466 0.1502080 0.4967323 0.0879775 30 1.049282 1.355215 -0.142701 0.7805566 -0.2059790 0.0193142 0.0815524 31 1.962583 1.595396 -2.050642 0.3556747 0.1384801 0.1197984 0.1608247 32 1.554846 0.095644 -1.423054 -0.3175620 0.4260008 -0.1612463 -0.0567196 33 2.248977 0.010348 -0.062469 0.6388269 0.2098648 0.1330250 0.0906704 34 0.993109 -0.828812 0.284059 0.3446686 0.1899096 -0.0515571 -0.2281197 35 -0.335103 1.614093 -0.920661 1.2502617 0.2435013 0.1264875 0.0469238 36 4.346795 1.208134 0.368889 1.1429977 -0.1362052 -0.0158169 -0.0183852 37 0.992634 2.013738 -1.350619 0.8714694 0.0057776 -0.2122691 0.1760918 38 2.213341 1.706516 -0.705418 1.2670281 -0.0707149 0.0670467 -0.1863588 39 -1.213255 0.644062 0.163988 1.1213961 0.2945355 0.1093574 0.0019574 40 3.942604 -1.704266 0.660327 0.1618506 0.4259076 0.0070193 0.3462765 41 4.262054 1.687193 0.351875 0.5396477 1.0052810 -0.9331689 0.0056063 42 6.865198 -1.091248 1.153585 1.1248797 0.0873276 0.2565221 0.0333265 43 3.476720 0.555449 -1.030771 -0.3015720 -0.1748109 -0.1584968 0.4079902 44 5.691730 -0.141240 0.565189 0.3174238 0.6478440 1.0579977 -0.5387916 45 0.327134 0.152011 -0.394798 0.4998430 0.1599781 0.3159518 0.1623656 46 0.280225 1.569387 -0.100397 1.2800976 0.0446645 0.0946513 0.0461599 47 3.119928 -0.384834 -3.325600 -1.8865310 -0.1334744 0.1249987 -0.2561273 48 0.501542 0.739816 -1.384556 -0.1244721 0.2948958 0.4836170 -0.1182802 49 -1.953218 0.269986 -1.726474 -0.8510637 0.5047958 0.4860651 0.2318735 50 3.706878 -2.400570 1.361047 -0.4949076 0.2180352 0.4080879 0.1156540 51 -1.060358 -0.521609 -1.387412 -1.2767491 -0.0521356 0.1665452 -0.0044412 52 -4.900528 0.157011 -1.015880 -0.9941168 0.2069608 0.3239762 -0.1921715 53 -0.388496 0.062051 -0.643721 -0.8544141 -0.1857141 0.0063293 0.2664606 54 0.109234 -0.018709 -0.242825 -0.2064701 -0.0585165 0.1720867 0.1117397 55 1.176175 0.644539 -0.373694 0.0038605 -0.3436524 0.0194450 -0.0838883 56 0.407259 -0.606637 0.222915 -0.3622451 -0.0737834 0.0228104 0.0297333 57 -1.022756 -0.071860 0.741957 0.2273628 -0.1388444 -0.2396467 -0.2327738 58 0.245419 1.167059 0.225934 0.8318795 -0.5365166 -0.0090816 -0.1680757 59 -1.300617 -1.110325 -0.262740 -0.8857801 -0.0816954 -0.1186886 -0.0928322 60 -1.110561 -0.832357 -0.212713 -0.4754481 -0.4105982 -0.1886992 -0.0602872 61 0.381831 -1.475116 0.601047 -0.6260156 -0.1854501 -0.1749306 -0.0013904 62 2.734462 -1.887861 0.813453 -0.5856987 0.2310656 0.1117041 -0.0293373 63 3.092464 -0.172602 0.017725 0.4874693 -0.5428206 0.0151218 -0.0683340 64 3.092464 -0.172602 0.017725 0.4874693 -0.5428206 0.0151218 -0.0683340 65 0.004744 -2.712679 1.178987 -0.6677199 0.0208119 0.0621903 -0.0655693 66 -2.014851 -1.060090 -0.099959 -0.7225044 -0.1947648 -0.2282902 -0.0505015 67 0.621739 -1.296106 0.255632 -0.3309504 -0.0880200 0.2524306 0.1465779 68 -0.271385 -1.709161 -1.100349 -2.0937671 0.2166264 0.0191278 0.0114174 69 -0.326350 -0.737232 0.021639 -0.3850383 -0.4338287 0.2156624 0.1597594 70 4.187093 9.708082 4.632803 -4.9751240 -0.0881576 0.2392433 0.0568049 71 -1.868507 -1.600166 0.436353 -0.8078214 -0.1530893 0.0479471 -0.1999893 72 2.768081 -0.556824 -0.148923 -0.3197853 -0.5524427 0.0907804 -0.0694488 73 -1.441846 -2.735114 -0.294134 -1.2172969 0.0109453 -0.0562910 0.1505788 74 -10.995490 0.615992 1.950966 1.1687190 0.2798335 0.2713257 0.0652135 75 0.508992 -2.363945 -0.407064 -0.9522316 0.1040307 0.1088110 -0.7368484 76 -1.015714 -0.307662 -1.088162 -1.0181862 -0.0440888 -0.1362208 0.0271200 77 -8.028891 -0.580763 0.933638 0.4619362 0.3379832 -0.1368644 -0.0669441 78 1.763308 -1.336175 -0.127809 -0.7161775 -0.1904861 -0.0900461 0.0037539 79 0.208944 -0.580698 -0.626297 -0.7620610 -0.0262368 -0.2928202 0.0285908 80 -3.230608 1.251352 0.195280 0.8687004 0.1812011 0.2600692 -0.1516375 81 1.498160 0.669731 -0.266114 0.3772866 -0.2769688 -0.1066593 -0.1608395 82 3.232051 -1.776018 0.485524 0.1170945 0.0557260 0.2219872 0.1187681 83 2.999977 -0.228275 -0.467724 -0.4287672 0.0494902 -0.2337809 -0.0718159 84 1.238083 0.320956 -1.806006 -1.0142266 0.2359630 -0.0857149 0.0593938 85 1.276376 -2.081214 2.540850 0.3745805 -0.2596482 -0.1228412 -0.2199985 86 0.930715 0.836457 -1.385153 -0.6074929 -0.2476354 0.1680713 -0.0117324 PC8 1 9.0765e-04 2 2.1811e-04 3 1.1834e-03 4 8.4077e-05 5 9.9209e-04 6 1.6277e-03 7 2.4907e-04 8 6.8383e-04 9 -5.0924e-04 10 3.1215e-04 11 3.0654e-04 12 -1.1951e-03 13 -1.2849e-03 14 -9.0801e-04 15 -1.2686e-03 16 -1.8441e-03 17 -2.1068e-03 18 -5.7816e-04 19 -1.2330e-03 20 3.3857e-05 21 3.8623e-04 22 1.3035e-04 23 -3.8648e-04 24 -1.7400e-04 25 -3.9196e-04 26 -7.6996e-04 27 -4.8042e-04 28 -2.0628e-04 29 -4.5672e-04 30 -1.4716e-04 31 -4.6385e-05 32 -2.0481e-04 33 -3.0020e-04 34 -5.8179e-05 35 1.3870e-04 36 -6.7177e-04 37 -3.0799e-04 38 6.2140e-04 39 4.5912e-04 40 -3.7165e-04 41 -5.4362e-04 42 -1.0155e-03 43 1.3449e-04 44 -5.4761e-04 45 1.0300e-03 46 1.1039e-03 47 -6.4858e-04 48 -7.6886e-05 49 3.2590e-04 50 8.6845e-05 51 4.9423e-04 52 9.2973e-04 53 4.4342e-04 54 4.9888e-04 55 7.2171e-04 56 -3.2133e-05 57 -1.8101e-04 58 -5.4969e-06 59 -8.3841e-04 60 5.9446e-05 61 -6.5683e-05 62 -3.4073e-04 63 -6.5145e-04 64 -6.5145e-04 65 1.4986e-04 66 2.8096e-04 67 -6.5170e-05 68 -1.3775e-04 69 6.8225e-06 70 -1.6290e-04 71 3.9009e-04 72 -1.3981e-04 73 6.2613e-04 74 2.6513e-03 75 3.7088e-04 76 9.9539e-04 77 1.2979e-03 78 5.6500e-04 79 3.0940e-04 80 8.7993e-04 81 -3.1353e-04 82 4.9625e-04 83 -6.3951e-04 84 -4.5582e-04 85 5.9440e-04 86 -3.6234e-04 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 3.99253025 1.66473582 1.10660264 0.96987790 0.33004256 0.29263512 0.20843280 [8] 0.00074024 ---------------------------------------------------------- bushfire 38 5 5 38435.075910 1035.305774 Scores: PC1 PC2 PC3 PC4 PC5 1 -111.9345 4.9970 -1.00881 -1.224361 3.180569 2 -113.4128 7.4784 -0.79170 -0.235184 2.385812 3 -105.8364 10.9615 -3.15662 -0.251662 1.017328 4 -89.1684 8.7232 -6.15080 -0.075611 1.431111 5 -58.7216 -1.9543 -12.70661 -0.151328 1.425570 6 -35.0370 -12.8434 -17.06841 -0.525664 3.499743 7 -250.2123 -49.4348 23.31261 -19.070238 0.647348 8 -292.6877 -69.7708 -21.30815 13.093808 -1.288764 9 -294.0765 -70.9903 -23.96326 14.940985 -0.939076 10 -290.0193 -57.3747 3.51346 1.858995 0.083107 11 -289.8168 -43.3207 16.08046 -1.745099 -1.506042 12 -290.8645 6.2503 40.52173 -7.496479 -0.033767 13 -232.6865 41.8090 37.19429 -1.280348 -0.470837 14 9.8483 25.1954 -14.56970 0.538484 1.772046 15 137.1924 11.8521 -37.12452 -5.130459 -0.586695 16 92.9804 10.3923 -24.97267 -7.551314 -1.867125 17 90.4493 10.5630 -21.92735 -5.669651 -1.001362 18 78.6325 5.2211 -19.74718 -6.107880 -1.939986 19 82.1178 3.6913 -21.37810 -4.259855 -1.278838 20 92.9044 7.1961 -21.22900 -4.125571 -0.127089 21 74.9157 10.2991 -16.60924 -5.660751 -0.406343 22 66.7350 12.0460 -16.73298 -4.669080 1.333436 23 -62.1981 22.7394 6.03613 -5.182356 -0.453624 24 -116.5696 32.3182 12.74846 -1.465657 -0.097851 25 -53.8907 22.4278 -2.18861 -2.742014 -0.990071 26 -60.6384 20.2952 -3.05206 -2.953685 -0.629061 27 -74.7621 28.9067 -0.65817 1.473357 -0.443957 28 -50.2202 37.3457 -1.44989 5.530426 -1.073521 29 -38.7483 50.2749 2.34469 10.156457 -0.416262 30 -93.3887 51.7884 20.08872 8.798781 -1.620216 31 35.3096 41.7158 13.46272 14.464358 -0.475973 32 290.8493 3.5924 7.41501 15.244293 2.141354 33 326.7236 -29.8194 15.64898 2.612061 0.064931 34 322.9095 -30.6372 16.21520 1.248005 -0.711322 35 328.5307 -29.9533 16.49656 1.138916 0.974792 36 325.6791 -30.6990 16.83840 -0.050949 -1.211360 37 323.8136 -30.7474 19.55764 -1.545150 -0.267580 38 325.2991 -30.5350 20.31878 -1.928580 -0.120425 ------------- Call: PcaClassic(x = x) Standard deviations: [1] 196.0487 32.1762 18.4819 6.9412 1.3510 ---------------------------------------------------------- ========================================================== > dodata(method="hubert.mcd") Call: dodata(method = "hubert.mcd") Data Set n p k e1 e2 ========================================================== heart 12 2 2 602.892739 7.727093 Scores: PC1 PC2 1 -12.2285 0.86283 2 -68.9906 -7.43256 3 -5.7035 -1.53793 4 -1.8988 2.90891 5 -24.0044 -2.68946 6 9.9115 8.43321 7 -11.0210 1.77484 8 25.1826 -1.31573 9 -3.2809 -0.74345 10 23.8200 -0.93701 11 9.1344 1.67701 12 -53.6607 -5.08826 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 24.5539 2.7798 ---------------------------------------------------------- starsCYG 47 2 2 0.381108 0.008040 Scores: PC1 PC2 1 -0.285731 -0.0899858 2 -0.819689 0.0153191 3 0.028077 -0.1501882 4 -0.819689 0.0153191 5 -0.234971 -0.1526225 6 -0.527231 -0.0382380 7 0.372118 -0.5195605 8 -0.357448 0.1009508 9 -0.603553 -0.2533541 10 -0.177170 -0.0722541 11 -0.637339 -1.0390758 12 -0.512526 -0.0662337 13 -0.490978 -0.0120517 14 0.936868 -0.2550656 15 0.684479 -0.0125787 16 0.347708 0.0641382 17 1.009966 -0.0202111 18 0.742477 0.1286170 19 0.773105 -0.0588983 20 -0.795247 -1.0648673 21 0.566048 -0.0319223 22 0.723956 -0.0061308 23 0.505616 0.0899297 24 0.069956 0.0896997 25 -0.080090 -0.0462652 26 0.268755 0.0512425 27 0.289710 -0.0770574 28 0.038341 -0.0269216 29 0.567463 -0.1026188 30 -0.951542 -1.1005280 31 0.512064 0.0504528 32 -0.188059 0.1184850 33 -0.288758 -0.0094200 34 -1.190016 -1.1293460 35 0.615197 -0.0846898 36 -0.710930 0.0938781 37 -0.183223 0.0888774 38 -0.288758 -0.0094200 39 -0.262177 0.0759816 40 -0.630957 -0.0855773 41 0.314679 0.0182135 42 -0.130850 0.0163715 43 -0.415248 0.0205825 44 -0.407188 -0.0287636 45 -0.620693 0.0376892 46 -0.051896 0.0292672 47 0.426662 0.0770340 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 0.617339 0.089666 ---------------------------------------------------------- phosphor 18 2 2 356.981009 40.133815 Scores: PC1 PC2 1 -2.89681 -18.08811 2 21.34021 -0.40854 3 22.98065 4.13006 4 12.33544 -6.72947 5 17.99823 2.47611 6 -13.35773 -24.10967 7 -0.92957 -5.51314 8 9.16061 2.71354 9 9.89243 5.10403 10 -14.12600 -11.17832 11 3.84175 -0.17605 12 -10.61905 4.37646 13 -13.85065 2.01919 14 -8.11927 4.34325 15 -18.69805 -1.51673 16 9.95352 -6.85784 17 -22.49433 0.29387 18 -18.66592 6.92359 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 18.8939 6.3351 ---------------------------------------------------------- stackloss 21 3 3 90.759236 22.197591 Scores: PC1 PC2 PC3 1 -20.323997 10.26124 0.92041 2 -19.761418 11.08797 0.92383 3 -16.469919 6.43190 0.22593 4 -4.171902 1.68262 2.50695 5 -3.756174 1.40774 0.57004 6 -3.964038 1.54518 1.53850 7 -7.547376 -3.27780 2.48643 8 -7.547376 -3.27780 2.48643 9 -0.763294 -0.63699 2.53518 10 4.214079 4.46296 -2.28315 11 -0.849132 -2.97767 -2.31393 12 -0.078689 -2.28838 -3.27896 13 3.088921 2.80948 -2.28999 14 -3.307313 -6.14718 -1.35916 15 5.552354 -7.34201 -0.32057 16 7.240091 -4.86180 -0.31031 17 14.908334 6.84995 0.70603 18 10.970281 1.06279 0.68209 19 10.199838 0.37350 1.64712 20 4.273564 1.99328 0.14526 21 -11.992249 2.19025 -3.37391 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 9.5268 4.7114 2.3614 ---------------------------------------------------------- salinity 28 3 3 14.598180 5.145994 Scores: PC1 PC2 PC3 1 1.68712 1.62591 0.19812128 2 2.35772 2.37290 1.24965734 3 6.80132 -2.14412 0.68142276 4 6.41982 -0.61348 -0.31907921 5 6.36697 -1.98030 4.87319903 6 5.22050 1.20864 0.10252555 7 3.34007 2.02950 0.00064329 8 1.06220 2.89801 -0.35658064 9 0.34692 -2.20572 -1.71677710 10 -2.21421 -2.74842 0.76862599 11 -1.40111 -2.16163 2.21124383 12 -0.38242 0.32284 -0.23732191 13 -1.12809 1.33152 -0.28800043 14 -3.24998 1.35943 1.17514969 15 -2.11006 -3.70114 0.45102357 16 3.46920 -5.41242 8.56937909 17 0.46682 -1.46753 1.48992481 18 2.21807 0.99168 -0.61894625 19 0.28525 -2.00333 -2.16450483 20 -1.66639 -1.76768 -1.06946404 21 -2.58106 1.23534 -0.65557612 22 -4.15573 1.71244 0.08170141 23 -3.07670 -4.87628 2.53200755 24 -1.70808 -3.71657 2.99305849 25 -1.08172 -1.05713 0.02468813 26 -2.23187 0.27323 -0.85760867 27 -3.50498 1.07657 -0.68503455 28 -4.49819 1.43219 0.53416609 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 3.8208 2.2685 1.2048 ---------------------------------------------------------- hbk 75 3 3 1.966655 1.617943 Scores: PC1 PC2 PC3 1 -31.105415 4.714217 10.4566165 2 -31.707650 5.748724 10.7682402 3 -33.366131 4.625897 12.1570167 4 -34.173377 6.069657 12.4466895 5 -33.780418 5.508823 11.9872893 6 -32.493478 4.684595 10.5679819 7 -32.592637 5.235522 10.3765493 8 -31.293363 4.865797 10.9379676 9 -33.160964 5.714260 12.3098920 10 -31.919786 5.384537 12.3374332 11 -38.231962 6.810641 13.5994385 12 -39.290479 5.393906 15.2942554 13 -39.418445 7.326461 11.5194898 14 -43.906584 13.214819 8.3282743 15 -1.906326 -0.716061 -0.8635112 16 -0.263255 -0.926016 -1.9009292 17 1.776489 1.072332 -0.5496140 18 -0.464648 -0.702441 0.0482897 19 -0.267826 1.283779 -0.2925812 20 -2.122108 -0.165970 -0.8924686 21 -0.937217 -0.548532 -0.4132196 22 -0.423273 1.781869 -0.0323061 23 -0.047532 -0.018909 -1.1259327 24 0.490041 0.520202 -1.1065753 25 2.143049 -0.720869 -0.0495474 26 -1.094748 1.459175 0.2226246 27 -2.070705 -0.898573 0.0023229 28 0.294998 -0.830258 0.5929001 29 1.242995 -0.300216 -0.2010507 30 -0.147958 -0.439099 2.0003038 31 -0.170818 -1.440946 -0.9755627 32 0.958531 1.199730 -1.0129867 33 -0.697307 0.874343 -0.7260649 34 2.278946 -0.261106 0.4196544 35 -1.962829 -0.809318 0.2033113 36 -0.626631 0.600666 0.8004036 37 -0.550885 1.881448 0.7382776 38 1.249717 -0.336214 -0.9349845 39 1.106696 -1.569418 0.1869576 40 0.684034 0.939963 -0.1034965 41 -1.559314 -1.551408 0.3660323 42 0.538741 0.447358 1.6361099 43 0.252685 2.080564 -0.7765259 44 -0.217012 -1.027281 1.7015154 45 1.497600 -1.349234 -0.2698932 46 -0.100388 -1.026443 1.5390401 47 0.811117 -2.195271 -0.5208141 48 -1.462210 -1.321318 0.5600144 49 -1.383976 -0.740714 -0.7348906 50 -1.636773 0.215464 0.3195369 51 0.530918 -0.759743 -1.2069247 52 0.109566 -2.107455 -0.5315473 53 0.564334 0.060847 2.3910630 54 0.272234 1.122711 -1.5060028 55 0.608660 1.197219 -0.5255609 56 -0.565430 0.710345 -1.3708230 57 1.115629 -0.888816 -0.4186014 58 -1.351288 0.374815 -1.1980618 59 -0.998016 0.151228 0.9007970 60 -0.124017 0.764846 1.9005963 61 -1.189858 1.905264 0.7721322 62 2.190589 -0.579614 -0.1377914 63 0.518278 0.931130 -1.4534768 64 -2.124566 -0.194391 -0.0327092 65 -0.154218 -1.050861 1.1309885 66 1.197852 1.044147 -0.2265269 67 0.114174 0.094763 -0.5168926 68 2.201115 -0.032271 0.8573493 69 1.307843 -1.104815 -0.7741270 70 -0.691449 0.676665 1.0004603 71 -1.150975 -0.050861 -0.0717068 72 0.457293 0.861871 0.1026350 73 0.392258 0.897451 0.9178065 74 0.584658 1.450471 0.3201857 75 0.972517 0.063777 1.8223995 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 1.4024 1.2720 1.1801 ---------------------------------------------------------- milk 86 8 8 6.897629 2.890481 Scores: PC1 PC2 PC3 PC4 PC5 PC6 PC7 1 -5.710924 -1.346213 0.01332091 -0.3709242 -0.566813 0.7529298 -1.2525433 2 -6.578612 -0.440749 1.16354746 0.2870685 -0.573207 0.7368064 -1.6101427 3 -0.720902 1.777381 -0.21532020 -0.3213950 0.287603 -0.4764464 -0.5638337 4 -5.545889 1.621147 -0.85212883 0.4380154 0.022241 0.0718035 0.1176140 5 1.323210 -0.143897 -0.78611461 0.5966857 0.043139 -0.0512545 -0.1419726 6 -1.760792 -0.662792 0.46402240 0.2149752 0.130000 0.0797221 0.1916948 7 -2.344198 -0.363657 0.92442296 0.3921371 0.241463 -0.2370967 0.0636268 8 -2.556824 -0.680132 0.04339934 0.4635077 0.154136 0.0371259 0.0260340 9 1.203234 2.712342 -1.00693092 0.1251739 0.170679 0.2231851 -0.0118196 10 3.151858 1.255826 -0.01678562 -0.5087398 -0.087933 0.0115055 -0.0097828 11 9.562891 1.580419 -2.65612113 -0.1748178 -0.153031 -0.0880112 -0.1648752 12 13.617821 -0.999033 -1.92168237 0.0326918 -0.038488 0.0870082 -0.1809687 13 10.958032 -0.097916 0.95915085 -0.2348663 0.147875 0.1219202 0.0419067 14 12.675941 0.158747 -1.04153243 0.3117402 0.302036 0.1187749 -0.2310830 15 10.726828 1.775339 -3.36786799 0.1285422 0.151594 0.0998947 -0.2028458 16 3.042705 0.212589 -1.23921907 -0.5596596 0.277061 -0.5037073 0.0612182 17 0.780071 2.990008 -1.58490147 -0.5441119 0.436485 -0.0603833 0.1016610 18 2.523916 -0.923373 -0.03221722 0.3830822 0.208008 -0.5505270 -0.1252648 19 1.990563 1.062648 -1.42038451 -0.3602257 -0.068006 -0.1932744 -0.1197842 20 -0.243938 1.674555 -0.72225359 -0.1475652 -0.397855 -0.5385123 -0.0559660 21 3.354424 -2.001060 -0.22542149 0.3346180 0.032502 -0.0953825 0.1293148 22 1.477177 -0.777534 -0.35362339 0.1224412 0.203208 0.0514382 -0.2166274 23 0.502055 -1.618511 -0.85013853 -0.1298862 -0.144328 -0.1941806 -0.1923681 24 0.900504 -1.227820 -1.07180474 -0.5851197 0.112657 0.0467164 0.0405544 25 4.161393 -1.869015 -1.54507759 0.2003123 -0.152582 -0.1382908 0.0864320 26 1.277795 -1.185179 -1.13445511 0.2771556 -0.101901 0.0070037 -0.1279016 27 3.447256 0.257652 -1.13407954 -0.0077859 0.853002 -0.1376443 -0.1897380 28 -1.695730 -3.781876 -0.72940594 -0.0956421 0.064475 0.3665470 0.0726448 29 -3.923610 -1.654818 -0.16117226 -0.4242302 -0.303749 -0.0209844 0.1723890 30 -0.309616 -1.564739 -0.39909943 0.1657509 -0.178739 -0.0600221 -0.0571706 31 -0.960838 -2.242733 1.50477679 -0.2957897 0.163758 -0.1034399 0.0257903 32 -0.671285 -0.459839 1.39124475 -0.3669914 0.246127 0.2094780 -0.2681284 33 -1.589089 -0.390812 -0.16505762 -0.3992573 0.086870 -0.0402114 -0.0399923 34 -0.421868 0.636139 -0.42563447 -0.2985726 0.311365 0.2398515 -0.0540852 35 1.118429 -2.116328 -0.22329747 -0.4864401 0.289927 -0.0503006 0.0101706 36 -3.660291 -1.630831 -0.57876280 0.1294792 -0.260224 0.0912904 -0.1565668 37 -0.087686 -2.530609 0.50076931 -0.0319873 0.194898 -0.1233526 -0.2494283 38 -1.418620 -2.303011 -0.09405565 -0.0931745 0.169466 0.1581787 0.0850095 39 1.815225 -0.838968 -1.10222194 -0.4897630 0.180933 0.0096330 -0.0600652 40 -3.420975 1.398516 -0.17143314 -0.5852146 0.090464 -0.2066323 -0.2974177 41 -3.462295 -1.795174 -0.17500650 -0.1610267 -0.595086 0.5981680 -1.5930268 42 -6.401429 0.451242 -0.78723149 -0.4285618 0.055395 -0.0212476 0.0808936 43 -2.583017 -0.871790 1.29937081 0.2422349 -0.190002 -0.2822972 -0.2625721 44 -5.027244 -0.167503 -0.02382957 -0.8288929 -0.852207 0.7399343 0.4606076 45 0.364494 -0.440380 -0.07746564 -0.4552133 0.095711 -0.1662998 0.1566706 46 0.420706 -1.880819 -0.82180986 -0.1823454 -0.022661 -0.0304227 -0.0516440 47 -1.932985 -0.120002 4.00934170 0.0930728 0.295428 0.2787446 0.3766231 48 0.395402 -1.021393 1.07953292 -0.4599764 -0.132386 0.1895780 0.2771755 49 2.886100 -0.276587 1.48851137 -0.6314648 -0.203963 -0.0891955 0.1347804 50 -3.255379 2.479232 -0.37933775 -0.3651497 -0.415000 0.0045750 0.0671055 51 1.939333 0.617579 1.57113225 0.0310866 -0.039226 0.0409183 0.1830694 52 5.727154 0.275898 0.58814711 -0.1739820 -0.222791 0.2553797 0.1959402 53 1.207873 0.131451 0.80899235 0.2872465 -0.353544 -0.1697200 -0.0987230 54 0.612921 0.040062 0.17807459 -0.0053074 -0.202244 -0.0671788 0.0530276 55 -0.399075 -0.727144 0.26196635 0.3657576 -0.192705 0.0903564 0.0641289 56 0.240719 0.733792 -0.05030509 0.0967214 -0.186906 0.0310231 -0.0594812 57 1.589641 0.289427 -1.02478822 0.2723190 -0.048378 0.2599262 -0.2040853 58 0.423483 -1.262515 -0.85026016 0.4749963 -0.082647 0.0752412 0.1352259 59 1.983684 1.335122 0.42593757 0.1345894 0.096456 0.1153107 -0.0385994 60 1.770171 0.935428 0.14901569 0.3641973 0.274015 -0.0280119 0.0690244 61 0.182845 1.706453 -0.18364654 0.2517421 -0.035773 0.0357087 -0.1363470 62 -2.191617 1.966324 -0.03573689 -0.2203900 -0.235704 0.1682332 -0.1145174 63 -2.442239 -0.209694 -0.06681921 0.3184048 0.206772 -0.0608468 0.2425649 64 -2.442239 -0.209694 -0.06681921 0.3184048 0.206772 -0.0608468 0.2425649 65 0.407575 2.996346 -0.63021113 -0.1335795 0.087668 0.0627032 0.0486166 66 2.660379 1.322824 0.10122110 0.2420451 0.192938 0.0344019 -0.0771918 67 -0.032273 1.315299 -0.04511689 -0.1293380 -0.025923 -0.1655965 0.1887534 68 1.117637 2.005809 1.97078787 -0.0429209 -0.176568 0.1634287 -0.0916254 69 0.970730 0.837158 0.01621375 0.2347502 -0.071757 -0.2464626 0.2907551 70 -2.688271 -5.335891 -0.64225481 4.1819517 -9.523550 2.0943027 -2.8098426 71 2.428718 1.976051 -0.24749122 0.1308738 0.018276 0.1711292 0.1346284 72 -2.061944 0.405943 0.50472914 0.4393739 -0.056420 -0.0031558 0.2663880 73 2.029606 2.874991 0.68310320 -0.2067254 0.511537 -0.2010371 0.0805608 74 11.293757 0.328931 -3.84783031 -0.4130266 -0.210499 -0.1103148 -0.0381326 75 0.120896 2.287914 0.83639076 -0.2462845 0.551353 0.6629701 0.3789055 76 1.859499 0.422019 1.18435547 0.1546108 0.017266 0.0470615 -0.1071011 77 8.435857 1.147499 -2.19924186 -0.4156770 0.386548 0.0294075 -0.1911399 78 -1.090858 1.311287 0.62897430 0.1727009 0.077341 0.0135972 -0.0096934 79 0.560012 0.623617 0.83727267 0.1680787 0.087477 0.0611949 -0.2588084 80 3.873817 -1.133641 -1.27469019 -0.2717298 -0.165066 0.1696232 0.0635047 81 -0.758664 -0.880260 0.00057124 0.2838720 0.016243 0.1527299 -0.0150514 82 -2.709588 1.464049 -0.12598126 -0.3828567 0.213647 -0.1425385 0.1552827 83 -2.213670 0.059563 0.87565603 0.1255703 -0.082005 0.2189829 -0.2938264 84 -0.242242 -0.483552 2.05089334 -0.0681005 -0.101578 0.1304632 -0.2218093 85 -1.032129 2.375018 -2.19321259 0.2332079 -0.066379 0.1854598 -0.0873859 86 0.015327 -0.948155 1.39530555 0.2701225 -0.268889 0.0578145 0.1608678 PC8 1 2.1835e-03 2 1.6801e-03 3 1.6623e-03 4 2.6286e-04 5 9.5884e-04 6 1.4430e-03 7 1.8784e-04 8 6.8473e-04 9 -6.8490e-04 10 1.1565e-04 11 5.6907e-06 12 -1.8395e-03 13 -2.1582e-03 14 -1.6294e-03 15 -1.6964e-03 16 -1.9664e-03 17 -2.2448e-03 18 -6.5884e-04 19 -1.1536e-03 20 2.6887e-04 21 3.3199e-05 22 1.1170e-04 23 -1.7617e-04 24 -2.1577e-04 25 -6.1495e-04 26 -7.2903e-04 27 -6.8773e-04 28 -2.0742e-04 29 -2.6937e-04 30 -6.7472e-05 31 -1.3222e-04 32 -1.6516e-04 33 -1.8836e-04 34 -1.1273e-04 35 3.0703e-05 36 -3.0311e-04 37 -1.9380e-04 38 5.5526e-04 39 4.1987e-04 40 8.4807e-05 41 8.8725e-04 42 -6.5647e-04 43 4.3202e-04 44 -5.3330e-04 45 8.9161e-04 46 1.1588e-03 47 -1.2714e-03 48 -4.0376e-04 49 4.1280e-06 50 3.0116e-04 51 5.8510e-05 52 3.3236e-04 53 4.0982e-04 54 4.0428e-04 55 6.1600e-04 56 -4.0496e-05 57 -1.8342e-04 58 -1.6748e-04 59 -1.0894e-03 60 -2.6876e-04 61 -5.8951e-05 62 -1.5517e-04 63 -7.9933e-04 64 -7.9933e-04 65 2.2592e-05 66 2.4984e-05 67 -2.2714e-04 68 -3.3991e-04 69 -3.0375e-04 70 3.4033e-03 71 2.3288e-05 72 -3.4126e-04 73 2.5528e-04 74 2.2760e-03 75 -2.8985e-04 76 7.9077e-04 77 9.4636e-04 78 4.9099e-04 79 3.0501e-04 80 6.5280e-04 81 -3.6570e-04 82 4.9966e-04 83 -4.3245e-04 84 -4.6152e-04 85 7.4691e-04 86 -6.1103e-04 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 2.62633379 1.70014141 1.01464625 0.36921951 0.21696728 0.19573429 0.17585482 [8] 0.00059393 ---------------------------------------------------------- bushfire 38 5 5 38703.789699 444.618237 Scores: PC1 PC2 PC3 PC4 PC5 1 155.972 1.08098 -23.31135 -1.93015 1.218941 2 157.738 0.35648 -20.95658 -2.42375 0.466415 3 150.667 2.12545 -16.20395 -2.00140 -0.582924 4 133.892 5.25124 -15.88873 -2.78469 -0.275261 5 102.462 13.00611 -21.54096 -4.69409 -0.944176 6 77.694 18.75377 -28.71865 -6.44244 0.446350 7 286.266 -11.36184 -98.67134 10.95233 -3.625338 8 326.627 29.92767 -112.60824 -29.26330 -13.710094 9 327.898 32.39553 -113.34314 -31.65905 -13.830781 10 325.131 5.81628 -105.58927 -13.45695 -8.987971 11 326.458 -7.84562 -94.25242 -6.11547 -8.572845 12 333.171 -37.69907 -50.89207 8.98187 -1.742979 13 279.789 -40.78415 -8.06209 7.65884 0.181748 14 37.714 10.54231 13.46530 -1.55051 2.102662 15 -90.034 34.68964 18.98186 0.69260 0.417573 16 -46.492 23.65086 10.07282 4.36090 -0.748517 17 -43.990 20.36443 9.61049 2.83084 -0.127983 18 -32.938 19.11199 2.64850 2.92879 -1.473988 19 -36.555 20.60142 2.01879 0.63832 -1.235075 20 -46.837 19.89630 6.65142 0.89120 0.271108 21 -28.670 15.29534 6.59311 3.29638 0.402194 22 -20.331 15.06559 7.33721 2.16591 2.006327 23 108.644 -7.92707 -1.45130 6.27388 0.356715 24 163.697 -16.15568 0.61663 4.24231 0.464415 25 100.471 -0.30739 0.87762 2.86452 -0.692735 26 106.922 0.90864 -1.91436 2.54557 -0.565023 27 121.966 -3.29641 4.85626 -0.47676 -0.490047 28 98.650 -4.51455 16.64160 -3.08996 -0.839397 29 88.795 -10.85457 30.46708 -5.37360 0.315657 30 142.981 -27.89100 22.40713 -1.67126 -0.680158 31 14.125 -21.60028 29.80480 -8.25272 -0.019693 32 -244.044 -11.76430 24.53390 -12.52294 2.022312 33 -283.842 -13.21931 -6.23565 -2.63367 -0.080728 34 -280.168 -13.41903 -7.69318 -1.24571 -0.722513 35 -285.666 -13.78452 -6.50318 -1.23756 1.074669 36 -282.938 -13.82281 -7.63902 0.20435 -0.971673 37 -281.129 -16.20408 -8.57154 1.85797 0.234486 38 -282.589 -16.91969 -8.36010 2.35589 0.490630 ------------- Call: PcaHubert(x = x, k = p) Standard deviations: [1] 196.7328 21.0860 18.0481 4.4044 1.0324 ---------------------------------------------------------- ========================================================== > dodata(method="hubert") Call: dodata(method = "hubert") Data Set n p k e1 e2 ========================================================== heart 12 2 1 546.354097 NA Scores: PC1 1 13.2197 2 69.9817 3 6.6946 4 2.8899 5 24.9956 6 -8.9203 7 12.0121 8 -24.1915 9 4.2721 10 -22.8289 11 -8.1433 12 54.6519 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 23.374 ---------------------------------------------------------- starsCYG 47 2 1 0.308922 NA Scores: PC1 1 0.224695 2 0.758653 3 -0.089113 4 0.758653 5 0.173934 6 0.466195 7 -0.433154 8 0.296411 9 0.542517 10 0.116133 11 0.576303 12 0.451490 13 0.429942 14 -0.997904 15 -0.745515 16 -0.408745 17 -1.071002 18 -0.803514 19 -0.834141 20 0.734210 21 -0.627085 22 -0.784992 23 -0.566652 24 -0.130992 25 0.019053 26 -0.329791 27 -0.350747 28 -0.099378 29 -0.628499 30 0.890506 31 -0.573100 32 0.127022 33 0.227721 34 1.128979 35 -0.676234 36 0.649894 37 0.122186 38 0.227721 39 0.201140 40 0.569920 41 -0.375716 42 0.069814 43 0.354212 44 0.346152 45 0.559656 46 -0.009140 47 -0.487699 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 0.55581 ---------------------------------------------------------- phosphor 18 2 1 215.172048 NA Scores: PC1 1 1.12634 2 -22.10340 3 -23.49216 4 -13.45927 5 -18.60808 6 11.24086 7 -0.14748 8 -9.77075 9 -10.37022 10 12.71798 11 -4.61857 12 10.07037 13 13.16767 14 7.57254 15 17.81362 16 -11.08799 17 21.70358 18 18.24496 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 14.669 ---------------------------------------------------------- stackloss 21 3 2 92.695059 22.692615 Scores: PC1 PC2 1 -20.334936 10.28081 2 -19.772121 11.10736 3 -16.461573 6.43794 4 -4.258672 1.73213 5 -3.773146 1.41928 6 -4.015909 1.57571 7 -7.635560 -3.22715 8 -7.635560 -3.22715 9 -0.855388 -0.58707 10 4.298129 4.41664 11 -0.767202 -3.02229 12 0.038375 -2.35217 13 3.172500 2.76354 14 -3.261224 -6.17206 15 5.553840 -7.34784 16 7.242284 -4.86820 17 14.878925 6.85989 18 10.939223 1.07406 19 10.133645 0.40394 20 4.267234 1.99501 21 -11.859921 2.12579 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 9.6278 4.7637 ---------------------------------------------------------- salinity 28 3 2 9.897101 7.246198 Scores: PC1 PC2 1 2.858444 1.04359 2 3.807704 1.55974 3 6.220733 -4.32114 4 6.388841 -2.83649 5 6.077450 -3.70092 6 5.974494 -0.67230 7 4.531584 0.78322 8 2.725849 2.41297 9 0.100501 -2.13615 10 -2.358003 -1.49718 11 -1.317688 -1.15391 12 0.434635 0.58230 13 0.116019 1.79022 14 -1.771501 2.71749 15 -2.630757 -2.44003 16 2.289743 -5.51829 17 0.637985 -1.26452 18 3.076147 0.19883 19 0.097381 -1.95868 20 -1.572471 -0.93003 21 -1.284185 2.21858 22 -2.531713 3.30313 23 -3.865359 -3.01230 24 -2.143461 -2.41918 25 -0.714414 -0.41227 26 -1.327781 1.18373 27 -2.201166 2.41566 28 -2.931988 3.20536 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 3.1460 2.6919 ---------------------------------------------------------- hbk 75 3 3 1.966655 1.617943 Scores: PC1 PC2 PC3 1 31.105415 -4.714217 -10.4566165 2 31.707650 -5.748724 -10.7682402 3 33.366131 -4.625897 -12.1570167 4 34.173377 -6.069657 -12.4466895 5 33.780418 -5.508823 -11.9872893 6 32.493478 -4.684595 -10.5679819 7 32.592637 -5.235522 -10.3765493 8 31.293363 -4.865797 -10.9379676 9 33.160964 -5.714260 -12.3098920 10 31.919786 -5.384537 -12.3374332 11 38.231962 -6.810641 -13.5994385 12 39.290479 -5.393906 -15.2942554 13 39.418445 -7.326461 -11.5194898 14 43.906584 -13.214819 -8.3282743 15 1.906326 0.716061 0.8635112 16 0.263255 0.926016 1.9009292 17 -1.776489 -1.072332 0.5496140 18 0.464648 0.702441 -0.0482897 19 0.267826 -1.283779 0.2925812 20 2.122108 0.165970 0.8924686 21 0.937217 0.548532 0.4132196 22 0.423273 -1.781869 0.0323061 23 0.047532 0.018909 1.1259327 24 -0.490041 -0.520202 1.1065753 25 -2.143049 0.720869 0.0495474 26 1.094748 -1.459175 -0.2226246 27 2.070705 0.898573 -0.0023229 28 -0.294998 0.830258 -0.5929001 29 -1.242995 0.300216 0.2010507 30 0.147958 0.439099 -2.0003038 31 0.170818 1.440946 0.9755627 32 -0.958531 -1.199730 1.0129867 33 0.697307 -0.874343 0.7260649 34 -2.278946 0.261106 -0.4196544 35 1.962829 0.809318 -0.2033113 36 0.626631 -0.600666 -0.8004036 37 0.550885 -1.881448 -0.7382776 38 -1.249717 0.336214 0.9349845 39 -1.106696 1.569418 -0.1869576 40 -0.684034 -0.939963 0.1034965 41 1.559314 1.551408 -0.3660323 42 -0.538741 -0.447358 -1.6361099 43 -0.252685 -2.080564 0.7765259 44 0.217012 1.027281 -1.7015154 45 -1.497600 1.349234 0.2698932 46 0.100388 1.026443 -1.5390401 47 -0.811117 2.195271 0.5208141 48 1.462210 1.321318 -0.5600144 49 1.383976 0.740714 0.7348906 50 1.636773 -0.215464 -0.3195369 51 -0.530918 0.759743 1.2069247 52 -0.109566 2.107455 0.5315473 53 -0.564334 -0.060847 -2.3910630 54 -0.272234 -1.122711 1.5060028 55 -0.608660 -1.197219 0.5255609 56 0.565430 -0.710345 1.3708230 57 -1.115629 0.888816 0.4186014 58 1.351288 -0.374815 1.1980618 59 0.998016 -0.151228 -0.9007970 60 0.124017 -0.764846 -1.9005963 61 1.189858 -1.905264 -0.7721322 62 -2.190589 0.579614 0.1377914 63 -0.518278 -0.931130 1.4534768 64 2.124566 0.194391 0.0327092 65 0.154218 1.050861 -1.1309885 66 -1.197852 -1.044147 0.2265269 67 -0.114174 -0.094763 0.5168926 68 -2.201115 0.032271 -0.8573493 69 -1.307843 1.104815 0.7741270 70 0.691449 -0.676665 -1.0004603 71 1.150975 0.050861 0.0717068 72 -0.457293 -0.861871 -0.1026350 73 -0.392258 -0.897451 -0.9178065 74 -0.584658 -1.450471 -0.3201857 75 -0.972517 -0.063777 -1.8223995 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 1.4024 1.2720 1.1801 ---------------------------------------------------------- milk 86 8 2 7.629557 3.124392 Scores: PC1 PC2 1 -5.768003 -0.9174359 2 -6.664422 0.0280812 3 -0.484521 1.7923710 4 -5.211590 2.0747301 5 1.422641 -0.3268437 6 -1.810360 -0.5469828 7 -2.402924 -0.1987041 8 -2.553389 -0.4963662 9 1.583399 2.5410448 10 3.267946 0.9141367 11 9.924771 0.6501301 12 13.628569 -2.3009846 13 10.774550 -1.1628697 14 12.716376 -1.0670330 15 11.176408 0.7403371 16 3.209269 -0.0804317 17 1.256577 2.8931153 18 2.468720 -1.2008647 19 2.253229 0.8379608 20 0.021073 1.6394221 21 3.205298 -2.3518286 22 1.470733 -0.9618655 23 0.475732 -1.7044535 24 0.930144 -1.3288398 25 4.151553 -2.2882554 26 1.314488 -1.3527439 27 3.613405 -0.0813605 28 -1.909178 -3.6473200 29 -3.987263 -1.3255834 30 -0.370601 -1.5855086 31 -1.273254 -2.1892809 32 -0.816634 -0.4514478 33 -1.553394 -0.2792004 34 -0.275027 0.6359374 35 0.980782 -2.2353223 36 -3.678470 -1.3459182 37 -0.327102 -2.5615283 38 -1.563492 -2.2008288 39 1.876146 -1.0292641 40 -3.204182 1.6694332 41 -3.561892 -1.5844770 42 -6.175135 1.0123714 43 -2.736601 -0.7040261 44 -4.981783 0.2434304 45 0.368802 -0.5011413 46 0.369508 -1.9511091 47 -2.306673 -0.0089446 48 0.215195 -1.1000357 49 2.704678 -0.5919929 50 -2.930879 2.7161936 51 1.846250 0.3732500 52 5.661288 -0.3139157 53 1.154929 -0.0575094 54 0.625715 -0.0733934 55 -0.453714 -0.7535924 56 0.343722 0.6460318 57 1.743002 0.0794685 58 0.433705 -1.3500731 59 2.078550 1.0860506 60 1.867913 0.7162287 61 0.392645 1.6184583 62 -1.958732 2.0993596 63 -2.383251 -0.0253919 64 -2.383251 -0.0253919 65 0.780239 2.9018927 66 2.785329 1.0142893 67 0.131210 1.2703167 68 1.110073 1.8140467 69 1.076878 0.6954148 70 -3.260160 -5.6233069 71 2.647036 1.6892084 72 -2.017340 0.5353349 73 2.247524 2.6406249 74 11.649291 -0.7374197 75 0.280544 2.2306959 76 1.791213 0.1796005 77 8.730344 0.3412271 78 -0.987405 1.3467910 79 0.560808 0.5006661 80 3.897879 -1.5270179 81 -0.792759 -0.8649399 82 -2.493611 1.6796838 83 -2.245966 0.1889555 84 -0.468812 -0.5359088 85 -0.538372 2.4105954 86 -0.185347 -1.0176989 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 2.7622 1.7676 ---------------------------------------------------------- bushfire 38 5 1 38435.075910 NA Scores: PC1 1 -111.9345 2 -113.4128 3 -105.8364 4 -89.1684 5 -58.7216 6 -35.0370 7 -250.2123 8 -292.6877 9 -294.0765 10 -290.0193 11 -289.8168 12 -290.8645 13 -232.6865 14 9.8483 15 137.1924 16 92.9804 17 90.4493 18 78.6325 19 82.1178 20 92.9044 21 74.9157 22 66.7350 23 -62.1981 24 -116.5696 25 -53.8907 26 -60.6384 27 -74.7621 28 -50.2202 29 -38.7483 30 -93.3887 31 35.3096 32 290.8493 33 326.7236 34 322.9095 35 328.5307 36 325.6791 37 323.8136 38 325.2991 ------------- Call: PcaHubert(x = x, mcd = FALSE) Standard deviations: [1] 196.05 ---------------------------------------------------------- ========================================================== > > ##dodata(method="locantore") > ##dodata(method="cov") > > ## VT::14.11.2018 - commented out - on some platforms PcaHubert will hoose only 1 PC > ## and will show difference > ## test.case.1() > test.case.2() [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE [1] TRUE > > proc.time() user system elapsed 1.57 0.20 1.76 rrcov/tests/togk4.R0000644000176200001440000000517213607363530013735 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) ## VT::14.01.2020 ## On some platforms minor differences are shown - use ## IGNORE_RDIFF_BEGIN ## IGNORE_RDIFF_END dodata <- function(nrep=1, time=FALSE, short=FALSE, full=TRUE, method = c("FASTMCD","MASS")){ domcd <- function(x, xname, nrep=1){ n <- dim(x)[1] p <- dim(x)[2] mcd<-CovOgk(x) xres <- sprintf("%3d %3d\n", dim(x)[1], dim(x)[2]) lpad<-lname-nchar(xname) cat(pad.right(xname,lpad), xres) dist <- getDistance(mcd) quantiel <- qchisq(0.975, p) ibad <- which(dist >= quantiel) names(ibad) <- NULL nbad <- length(ibad) cat("Outliers: ",nbad,"\n") if(nbad > 0) print(ibad) cat("-------------\n") show(mcd) cat("--------------------------------------------------------\n") } lname <- 20 ## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) method <- match.arg(method) data(heart) data(starsCYG) data(phosphor) data(stackloss) data(coleman) data(salinity) data(wood) data(hbk) data(Animals, package = "MASS") brain <- Animals[c(1:24, 26:25, 27:28),] data(milk) data(bushfire) tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("Data Set n p Half LOG(obj) Time\n") cat("========================================================\n") domcd(heart[, 1:2], data(heart), nrep) ## IGNORE_RDIFF_BEGIN domcd(starsCYG,data(starsCYG), nrep) ## IGNORE_RDIFF_END domcd(data.matrix(subset(phosphor, select = -plant)), data(phosphor), nrep) domcd(stack.x,data(stackloss), nrep) domcd(data.matrix(subset(coleman, select = -Y)), data(coleman), nrep) domcd(data.matrix(subset(salinity, select = -Y)), data(salinity), nrep) ## IGNORE_RDIFF_BEGIN domcd(data.matrix(subset(wood, select = -y)), data(wood), nrep) ## IGNORE_RDIFF_END domcd(data.matrix(subset(hbk, select = -Y)), data(hbk), nrep) domcd(brain, "Animals", nrep) domcd(milk, data(milk), nrep) domcd(bushfire, data(bushfire), nrep) cat("========================================================\n") } pad.right <- function(z, pads) { ### Pads spaces to right of text padding <- paste(rep(" ", pads), collapse = "") paste(z, padding, sep = "") } dodata() rrcov/tests/tqda.R0000644000176200001440000000241512763517421013635 0ustar liggesusers## VT::15.09.2013 - this will render the output independent ## from the version of the package suppressPackageStartupMessages(library(rrcov)) dodata <- function(method) { options(digits = 5) set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat("===================================================\n") data(hemophilia); show(QdaCov(as.factor(gr)~., data=hemophilia, method=method)) data(anorexia, package="MASS"); show(QdaCov(Treat~., data=anorexia, method=method)) data(Pima.tr, package="MASS"); show(QdaCov(type~., data=Pima.tr, method=method)) data(iris); # show(QdaCov(Species~., data=iris, method=method)) data(crabs, package="MASS"); # show(QdaCov(sp~., data=crabs, method=method)) show(QdaClassic(as.factor(gr)~., data=hemophilia)) show(QdaClassic(Treat~., data=anorexia)) show(QdaClassic(type~., data=Pima.tr)) show(QdaClassic(Species~., data=iris)) ## show(QdaClassic(sp~., data=crabs)) cat("===================================================\n") } ## -- now do it: dodata(method="mcd") dodata(method="m") dodata(method="ogk") dodata(method="sde") rrcov/tests/tlda.Rout.save0000644000176200001440000032163113607364027015321 0ustar liggesusers R Under development (unstable) (2020-01-08 r77640) -- "Unsuffered Consequences" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## VT::15.09.2013 - this will render the output independent > ## from the version of the package > suppressPackageStartupMessages(library(rrcov)) > library(MASS) > > ## VT::14.01.2020 > ## On some platforms minor differences are shown - use > ## IGNORE_RDIFF_BEGIN > ## IGNORE_RDIFF_END > > dodata <- function(method) { + + options(digits = 5) + set.seed(101) # <<-- sub-sampling algorithm now based on R's RNG and seed + + tmp <- sys.call() + cat("\nCall: ", deparse(substitute(tmp)),"\n") + cat("===================================================\n") + + cat("\nData: ", "hemophilia\n") + data(hemophilia) + show(rlda <- Linda(as.factor(gr)~., data=hemophilia, method=method)) + show(predict(rlda)) + + cat("\nData: ", "anorexia\n") + data(anorexia) + show(rlda <- Linda(Treat~., data=anorexia, method=method)) + show(predict(rlda)) + + cat("\nData: ", "Pima\n") + data(Pima.tr) + show(rlda <- Linda(type~., data=Pima.tr, method=method)) + show(predict(rlda)) + + cat("\nData: ", "Forest soils\n") + data(soil) + soil1983 <- soil[soil$D == 0, -2] # only 1983, remove column D (always 0) + + ## IGNORE_RDIFF_BEGIN + show(rlda <- Linda(F~., data=soil1983, method=method)) + ## IGNORE_RDIFF_END + show(predict(rlda)) + + cat("\nData: ", "Raven and Miller diabetes data\n") + data(diabetes) + show(rlda <- Linda(group~insulin+glucose+sspg, data=diabetes, method=method)) + show(predict(rlda)) + + cat("\nData: ", "iris\n") + data(iris) + if(method != "mcdA") + { + show(rlda <- Linda(Species~., data=iris, method=method, l1med=TRUE)) + show(predict(rlda)) + } + + cat("\nData: ", "crabs\n") + data(crabs) + show(rlda <- Linda(sp~., data=crabs, method=method)) + show(predict(rlda)) + + cat("\nData: ", "fish\n") + data(fish) + fish <- fish[-14,] # remove observation #14 containing missing value + + # The height and width are calculated as percentages + # of the third length variable + fish[,5] <- fish[,5]*fish[,4]/100 + fish[,6] <- fish[,6]*fish[,4]/100 + + ## There is one class with only 6 observations (p=6). Normally + ## Linda will fail, therefore use l1med=TRUE. + ## This works only for methods mcdB and mcdC + + table(fish$Species) + if(method != "mcdA") + { + ## IGNORE_RDIFF_BEGIN + show(rlda <- Linda(Species~., data=fish, method=method, l1med=TRUE)) + ## IGNORE_RDIFF_END + show(predict(rlda)) + } + + cat("\nData: ", "pottery\n") + data(pottery) + show(rlda <- Linda(origin~., data=pottery, method=method)) + show(predict(rlda)) + + cat("\nData: ", "olitos\n") + data(olitos) + if(method != "mcdA") + { + ## IGNORE_RDIFF_BEGIN + show(rlda <- Linda(grp~., data=olitos, method=method, l1med=TRUE)) + ## IGNORE_RDIFF_END + show(predict(rlda)) + } + + cat("===================================================\n") + } > > > ## -- now do it: > dodata(method="mcdA") Call: dodata(method = "mcdA") =================================================== Data: hemophilia Call: Linda(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.30795 -0.0059911 normal -0.12920 -0.0603000 Within-groups Covariance Matrix: AHFactivity AHFantigen AHFactivity 0.019035 0.012637 AHFantigen 0.012637 0.020875 Linear Coeficients: AHFactivity AHFantigen carrier -26.7292 15.8940 normal -8.1418 2.0402 Constants: carrier normal -4.5788 -1.3807 Apparent error rate 0.1333 Classification table Predicted Actual carrier normal carrier 39 6 normal 4 26 Confusion matrix Predicted Actual carrier normal carrier 0.867 0.133 normal 0.133 0.867 Data: anorexia Call: Linda(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.633 82.950 Cont 81.558 81.108 FT 84.331 94.762 Within-groups Covariance Matrix: Prewt Postwt Prewt 35.236 9.120 Postwt 9.120 25.313 Linear Coeficients: Prewt Postwt CBT 1.6509 2.6822 Cont 1.6380 2.6141 FT 1.5709 3.1777 Constants: CBT Cont FT -180.36 -173.83 -218.24 Apparent error rate 0.4167 Classification table Predicted Actual CBT Cont FT CBT 16 5 8 Cont 11 13 2 FT 0 4 13 Confusion matrix Predicted Actual CBT Cont FT CBT 0.552 0.172 0.276 Cont 0.423 0.500 0.077 FT 0.000 0.235 0.765 Data: Pima Call: Linda(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 1.8602 107.69 67.344 25.29 30.642 0.40777 24.667 Yes 5.3167 145.85 74.283 31.80 34.095 0.49533 37.883 Within-groups Covariance Matrix: npreg glu bp skin bmi ped age npreg 9.706635 -6.22068 5.511519 1.62465 0.930142 -0.020624 14.03895 glu -6.220683 790.08188 61.345250 19.65694 29.744834 -0.477622 20.05841 bp 5.511519 61.34525 147.176158 36.36459 16.264038 -0.083953 25.34483 skin 1.624652 19.65694 36.364593 141.44078 56.033516 -0.215665 8.64726 bmi 0.930142 29.74483 16.264038 56.03352 45.266617 0.043775 2.57539 ped -0.020624 -0.47762 -0.083953 -0.21566 0.043775 0.077364 -0.10287 age 14.038947 20.05841 25.344826 8.64726 2.575386 -0.102867 73.32846 Linear Coeficients: npreg glu bp skin bmi ped age No -0.37963 0.077767 0.36932 -0.23799 0.77512 5.3054 0.26843 Yes -0.17660 0.125772 0.35917 -0.19784 0.76053 7.0697 0.39843 Constants: No Yes -29.944 -42.239 Apparent error rate 0.21 Classification table Predicted Actual No Yes No 109 23 Yes 19 49 Confusion matrix Predicted Actual No Yes No 0.826 0.174 Yes 0.279 0.721 Data: Forest soils Call: Linda(F ~ ., data = soil1983, method = method) Prior Probabilities of Groups: 1 2 3 0.18966 0.39655 0.41379 Group means: Al Ca Mg K Na 1 97.588 9.515 2.0288 4.8438 1.4250 2 125.531 12.662 2.5344 8.3044 1.0063 3 146.020 20.093 2.3427 9.2293 1.0327 Within-groups Covariance Matrix: Al Ca Mg K Na Al 10290.311 814.4770 137.7378 427.9014 78.6332 Ca 814.477 137.5707 11.1133 45.9755 1.1929 Mg 137.738 11.1133 2.4744 7.1536 1.1148 K 427.901 45.9755 7.1536 26.6947 2.1072 Na 78.633 1.1929 1.1148 2.1072 1.8993 Linear Coeficients: Al Ca Mg K Na 1 -0.015036 0.098323 1.50272 -0.20104 0.65207 2 -0.011314 0.014336 0.79365 0.23427 0.26346 3 -0.010075 0.108029 -0.23845 0.33268 0.66382 Constants: 1 2 3 -2.8987 -2.4166 -2.8307 Apparent error rate 0.3966 Classification table Predicted Actual 1 2 3 1 2 6 3 2 1 13 9 3 1 3 20 Confusion matrix Predicted Actual 1 2 3 1 0.182 0.545 0.273 2 0.043 0.565 0.391 3 0.042 0.125 0.833 Data: Raven and Miller diabetes data Call: Linda(group ~ insulin + glucose + sspg, data = diabetes, method = method) Prior Probabilities of Groups: normal chemical overt 0.52414 0.24828 0.22759 Group means: insulin glucose sspg normal 163.939 345.8 99.076 chemical 299.448 476.9 223.621 overt 95.958 1026.4 343.000 Within-groups Covariance Matrix: insulin glucose sspg insulin 10353.6 -2304.2 1309.2 glucose -2304.2 30716.6 8010.5 sspg 1309.2 8010.5 4904.4 Linear Coeficients: insulin glucose sspg normal 0.020692 0.015647 -0.010878 chemical 0.030151 0.013928 0.014799 overt 0.013713 0.029891 0.017455 Constants: normal chemical overt -4.5086 -10.8833 -20.4714 Apparent error rate 0.1931 Classification table Predicted Actual normal chemical overt normal 69 7 0 chemical 14 22 0 overt 3 4 26 Confusion matrix Predicted Actual normal chemical overt normal 0.908 0.092 0.000 chemical 0.389 0.611 0.000 overt 0.091 0.121 0.788 Data: iris Data: crabs Call: Linda(sp ~ ., data = crabs, method = method) Prior Probabilities of Groups: B O 0.5 0.5 Group means: sexM index FL RW CL CW BD B 0.34722 27.333 14.211 12.253 30.397 35.117 12.765 O 0.56627 25.554 17.131 13.405 34.247 38.155 15.525 Within-groups Covariance Matrix: sexM index FL RW CL CW BD sexM 0.32495 0.99846 0.27043 -0.38424 0.8947 0.83713 0.38943 index 0.99846 235.34252 47.02247 32.51217 101.2140 112.95209 46.76417 FL 0.27043 47.02247 10.37905 6.94554 22.2286 24.90044 10.16835 RW -0.38424 32.51217 6.94554 6.06757 14.6094 16.70517 6.69952 CL 0.89470 101.21397 22.22862 14.60936 48.7002 54.28090 22.22051 CW 0.83713 112.95209 24.90044 16.70517 54.2809 60.85954 24.79469 BD 0.38943 46.76417 10.16835 6.69952 22.2205 24.79469 10.29765 Linear Coeficients: sexM index FL RW CL CW BD B 21.908 -1.9991 8.7204 12.348 0.80966 -3.5091 -0.45264 O 32.617 -3.1291 21.4650 18.245 2.42215 -13.9386 9.75383 Constants: B O -62.591 -127.368 Apparent error rate 0 Classification table Predicted Actual B O B 100 0 O 0 100 Confusion matrix Predicted Actual B O B 1 0 O 0 1 Data: fish Data: pottery Call: Linda(origin ~ ., data = pottery, method = method) Prior Probabilities of Groups: Attic Eritrean 0.48148 0.51852 Group means: SI AL FE MG CA TI Attic 55.36 13.73 9.82 5.45 6.03 0.863 Eritrean 52.52 16.23 9.13 3.09 6.26 0.814 Within-groups Covariance Matrix: SI AL FE MG CA TI SI 17.8214054 3.888635 -0.857514 0.229867 -0.48380 -0.0067872 AL 3.8886351 2.142219 0.652607 0.946141 0.10067 0.0176169 FE -0.8575143 0.652607 1.403928 -0.530783 -2.51300 0.0754965 MG 0.2298674 0.946141 -0.530783 3.709841 4.27174 -0.0570645 CA -0.4837951 0.100667 -2.512998 4.271737 9.99402 -0.1894384 TI -0.0067872 0.017617 0.075497 -0.057065 -0.18944 0.0057590 Linear Coeficients: SI AL FE MG CA TI Attic 48.097 -150.232 238.55 5.94797 43.434 -973.45 Eritrean 31.493 -93.772 152.77 -0.45512 33.141 -451.84 Constants: Attic Eritrean -1199.10 -683.24 Apparent error rate 0.1111 Classification table Predicted Actual Attic Eritrean Attic 12 1 Eritrean 2 12 Confusion matrix Predicted Actual Attic Eritrean Attic 0.923 0.077 Eritrean 0.143 0.857 Data: olitos =================================================== > dodata(method="mcdB") Call: dodata(method = "mcdB") =================================================== Data: hemophilia Call: Linda(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.31456 -0.014775 normal -0.13582 -0.069084 Within-groups Covariance Matrix: AHFactivity AHFantigen AHFactivity 0.016444 0.011351 AHFantigen 0.011351 0.023937 Linear Coeficients: AHFactivity AHFantigen carrier -27.8058 12.5688 normal -9.3172 1.5323 Constants: carrier normal -4.7913 -1.4961 Apparent error rate 0.16 Classification table Predicted Actual carrier normal carrier 38 7 normal 5 25 Confusion matrix Predicted Actual carrier normal carrier 0.844 0.156 normal 0.167 0.833 Data: anorexia Call: Linda(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 83.254 82.381 Cont 82.178 80.539 FT 84.951 94.193 Within-groups Covariance Matrix: Prewt Postwt Prewt 29.566 13.653 Postwt 13.653 38.906 Linear Coeficients: Prewt Postwt CBT 2.1935 1.3477 Cont 2.1762 1.3064 FT 2.0947 1.6859 Constants: CBT Cont FT -147.73 -143.05 -169.82 Apparent error rate 0.4861 Classification table Predicted Actual CBT Cont FT CBT 16 5 8 Cont 16 8 2 FT 0 4 13 Confusion matrix Predicted Actual CBT Cont FT CBT 0.552 0.172 0.276 Cont 0.615 0.308 0.077 FT 0.000 0.235 0.765 Data: Pima Call: Linda(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.0767 109.45 67.790 26.158 30.930 0.41455 24.695 Yes 5.5938 145.40 74.748 33.754 34.501 0.49898 37.821 Within-groups Covariance Matrix: npreg glu bp skin bmi ped age npreg 8.253576 11.92843 9.170629 4.47646 2.08222 -0.024996 13.330294 glu 11.928434 716.46162 75.731612 35.47043 37.86433 -0.545890 35.405751 bp 9.170629 75.73161 140.079879 34.70380 16.92999 -0.050649 30.872456 skin 4.476462 35.47043 34.703804 140.03693 59.04382 0.125528 16.764129 bmi 2.082224 37.86433 16.929993 59.04382 47.98303 0.219914 8.302882 ped -0.024996 -0.54589 -0.050649 0.12553 0.21991 0.078207 -0.088361 age 13.330294 35.40575 30.872456 16.76413 8.30288 -0.088361 50.627190 Linear Coeficients: npreg glu bp skin bmi ped age No -1.0456 0.086784 0.38714 -0.24505 0.68786 4.7825 0.44300 Yes -1.0506 0.130049 0.35576 -0.20410 0.63846 6.4944 0.68999 Constants: No Yes -31.095 -43.129 Apparent error rate 0.245 Classification table Predicted Actual No Yes No 106 26 Yes 23 45 Confusion matrix Predicted Actual No Yes No 0.803 0.197 Yes 0.338 0.662 Data: Forest soils Call: Linda(F ~ ., data = soil1983, method = method) Prior Probabilities of Groups: 1 2 3 0.18966 0.39655 0.41379 Group means: Al Ca Mg K Na 1 94.017 8.7693 2.0645 4.8409 1.38034 2 121.961 11.9168 2.5701 8.3015 0.96159 3 142.450 19.3469 2.3784 9.2264 0.98801 Within-groups Covariance Matrix: Al Ca Mg K Na Al 5577.543 402.99291 87.24346 272.0090 33.51195 Ca 402.993 69.16394 7.02779 27.5314 -0.10027 Mg 87.243 7.02779 1.72469 5.2026 0.58145 K 272.009 27.53139 5.20264 18.6054 1.22367 Na 33.512 -0.10027 0.58145 1.2237 0.73272 Linear Coeficients: Al Ca Mg K Na 1 -0.0216522 0.247417 2.37117 -0.58409 2.00180 2 -0.0142803 0.064941 0.94536 0.24041 0.82269 3 -0.0051346 0.311146 -1.77318 0.45712 2.26953 Constants: 1 2 3 -4.1450 -3.0493 -4.6478 Apparent error rate 0.3448 Classification table Predicted Actual 1 2 3 1 3 4 4 2 2 14 7 3 1 2 21 Confusion matrix Predicted Actual 1 2 3 1 0.273 0.364 0.364 2 0.087 0.609 0.304 3 0.042 0.083 0.875 Data: Raven and Miller diabetes data Call: Linda(group ~ insulin + glucose + sspg, data = diabetes, method = method) Prior Probabilities of Groups: normal chemical overt 0.52414 0.24828 0.22759 Group means: insulin glucose sspg normal 152.405 346.55 99.387 chemical 288.244 478.80 226.226 overt 84.754 1028.28 345.605 Within-groups Covariance Matrix: insulin glucose sspg insulin 7615.09 435.85 3116.93 glucose 435.85 2983.58 579.71 sspg 3116.93 579.71 4513.83 Linear Coeficients: insulin glucose sspg normal 0.014590 0.11456 -0.0027697 chemical 0.023165 0.15432 0.0143035 overt -0.030375 0.33858 0.0540565 Constants: normal chemical overt -21.470 -43.293 -183.612 Apparent error rate 0.1103 Classification table Predicted Actual normal chemical overt normal 73 3 0 chemical 6 30 0 overt 0 7 26 Confusion matrix Predicted Actual normal chemical overt normal 0.961 0.039 0.000 chemical 0.167 0.833 0.000 overt 0.000 0.212 0.788 Data: iris Call: Linda(Species ~ ., data = iris, method = method, l1med = TRUE) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 4.9834 3.4153 1.4532 0.22474 versicolor 5.8947 2.8149 4.2263 1.35024 virginica 6.5255 3.0017 5.4485 2.06756 Within-groups Covariance Matrix: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.248728 0.104224 0.127326 0.045769 Sepal.Width 0.104224 0.134015 0.062132 0.039263 Petal.Length 0.127326 0.062132 0.148630 0.055656 Petal.Width 0.045769 0.039263 0.055656 0.040584 Linear Coeficients: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 18.228 22.179632 -2.9809 -32.3888 versicolor 14.202 5.155493 19.5706 -14.5732 virginica 13.336 0.012598 24.2312 2.6632 Constants: setosa versicolor virginica -78.585 -81.731 -113.394 Apparent error rate 0.0267 Classification table Predicted Actual setosa versicolor virginica setosa 50 0 0 versicolor 0 48 2 virginica 0 2 48 Confusion matrix Predicted Actual setosa versicolor virginica setosa 1 0.00 0.00 versicolor 0 0.96 0.04 virginica 0 0.04 0.96 Data: crabs Call: Linda(sp ~ ., data = crabs, method = method) Prior Probabilities of Groups: B O 0.5 0.5 Group means: sexM index FL RW CL CW BD B 0.41060 25.420 13.947 11.922 29.783 34.404 12.470 O 0.60279 23.202 16.782 13.086 33.401 37.230 15.131 Within-groups Covariance Matrix: sexM index FL RW CL CW BD sexM 0.29887 0.26826 0.13913 -0.37768 0.53244 0.4518 0.22036 index 0.26826 222.02891 45.88529 30.74525 97.13899 109.0306 44.32640 FL 0.13913 45.88529 10.28571 6.79799 21.73780 24.4728 9.83350 RW -0.37768 30.74525 6.79799 5.58065 14.16132 16.2172 6.41632 CL 0.53244 97.13899 21.73780 14.16132 46.85017 52.5599 21.15716 CW 0.45180 109.03063 24.47279 16.21721 52.55989 59.2452 23.74432 BD 0.22036 44.32640 9.83350 6.41632 21.15716 23.7443 9.67786 Linear Coeficients: sexM index FL RW CL CW BD B 11.300 -2.1322 6.6646 8.6474 2.0998 -2.4077 -0.39115 O 12.076 -3.4494 19.4275 10.6323 4.6071 -12.7866 11.59846 Constants: B O -61.35 -123.56 Apparent error rate 0 Classification table Predicted Actual B O B 100 0 O 0 100 Confusion matrix Predicted Actual B O B 1 0 O 0 1 Data: fish Call: Linda(Species ~ ., data = fish, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 5 6 7 0.215190 0.037975 0.126582 0.069620 0.088608 0.107595 0.354430 Group means: Weight Length1 Length2 Length3 Height Width 1 595.6580 29.892 32.639 37.822 15.1297 5.2245 2 426.2876 26.488 28.988 31.888 9.4082 5.2931 3 128.7053 19.863 21.447 23.963 6.2497 3.5184 4 127.1961 18.776 20.486 23.028 9.2399 3.1031 5 -7.7908 10.513 11.077 12.307 1.9496 1.1613 6 492.2095 39.290 41.818 44.803 6.5847 4.3818 7 188.2288 21.970 23.960 25.411 6.4408 3.9196 Within-groups Covariance Matrix: Weight Length1 Length2 Length3 Height Width Weight 10307.256 311.1217 327.4531 348.5864 111.9344 65.18676 Length1 311.122 12.4736 13.0429 13.8128 3.9868 2.23104 Length2 327.453 13.0429 13.6888 14.5200 4.2226 2.35475 Length3 348.586 13.8128 14.5200 15.4620 4.5272 2.51917 Height 111.934 3.9868 4.2226 4.5272 1.5967 0.77020 Width 65.187 2.2310 2.3547 2.5192 0.7702 0.50506 Linear Coeficients: Weight Length1 Length2 Length3 Height Width 1 -0.14016 4.66132 -52.6510 47.4146 16.4622 -8.28255 2 -0.17831 -17.90956 10.5348 9.2671 2.4405 13.54607 3 -0.21829 -3.39328 -11.2809 17.5360 1.6745 12.70410 4 -0.25676 -0.62855 -9.3172 10.3249 16.3429 9.07821 5 -0.10288 1.43667 -12.4904 14.5200 -3.4014 0.22846 6 -0.03936 -25.70770 12.1247 26.1500 -24.0771 -22.92857 7 -0.22506 -22.26278 36.3775 -10.7537 1.6280 16.70299 Constants: 1 2 3 4 5 6 7 -169.767 -75.846 -71.040 -93.469 -27.365 -197.327 -72.443 Apparent error rate 0.0886 Classification table Predicted Actual 1 2 3 4 5 6 7 1 34 0 0 0 0 0 0 2 0 6 0 0 0 0 0 3 0 0 20 0 0 0 0 4 0 0 0 11 0 0 0 5 0 0 0 0 13 0 1 6 0 0 0 0 0 17 0 7 0 12 0 0 1 0 43 Confusion matrix Predicted Actual 1 2 3 4 5 6 7 1 1 0.000 0 0 0.000 0 0.000 2 0 1.000 0 0 0.000 0 0.000 3 0 0.000 1 0 0.000 0 0.000 4 0 0.000 0 1 0.000 0 0.000 5 0 0.000 0 0 0.929 0 0.071 6 0 0.000 0 0 0.000 1 0.000 7 0 0.214 0 0 0.018 0 0.768 Data: pottery Call: Linda(origin ~ ., data = pottery, method = method) Prior Probabilities of Groups: Attic Eritrean 0.48148 0.51852 Group means: SI AL FE MG CA TI Attic 55.362 13.847 10.0065 5.3141 5.5371 0.87124 Eritrean 52.522 16.347 9.3165 2.9541 5.7671 0.82224 Within-groups Covariance Matrix: SI AL FE MG CA TI SI 14.289193 3.4784663 -0.164844 0.757461 -0.869987 0.0373657 AL 3.478466 1.2524784 0.065480 0.713995 0.355258 0.0034364 FE -0.164844 0.0654798 0.364654 -0.388388 -0.740613 0.0240216 MG 0.757461 0.7139945 -0.388388 2.367904 2.231515 -0.0430910 CA -0.869987 0.3552582 -0.740613 2.231515 3.613917 -0.0782308 TI 0.037366 0.0034364 0.024022 -0.043091 -0.078231 0.0025627 Linear Coeficients: SI AL FE MG CA TI Attic 76.578 -250.51 360.48 5.1529 101.645 -630.17 Eritrean 52.453 -166.23 249.33 -2.5811 79.417 -177.23 Constants: Attic Eritrean -2210.3 -1333.2 Apparent error rate 0.1111 Classification table Predicted Actual Attic Eritrean Attic 12 1 Eritrean 2 12 Confusion matrix Predicted Actual Attic Eritrean Attic 0.923 0.077 Eritrean 0.143 0.857 Data: olitos Call: Linda(grp ~ ., data = olitos, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 0.416667 0.208333 0.283333 0.091667 Group means: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 0.61656 61.906 0.13686 0.0081090 12.267 0.80489 2.3462 6.3270 0.72945 0.52233 2 0.45078 61.687 0.15394 0.0085591 12.482 0.78669 2.0993 6.0396 0.61587 0.40528 3 0.80394 61.864 0.18131 0.0111781 13.705 1.07615 2.1611 7.1020 0.61887 0.44040 4 1.54761 61.523 0.16626 0.0126077 13.034 0.94291 2.0852 6.7778 0.81447 0.61730 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 0.44540 241.32 3.3226 0.96723 89.616 95.582 1.9662 15.597 27.183 40.032 2 0.35486 260.70 3.3327 0.87368 91.883 95.748 3.3486 10.677 23.204 47.470 3 0.37729 248.27 3.0123 1.04047 89.480 95.847 3.2502 16.575 31.863 36.731 4 0.53571 273.62 3.2936 1.56869 89.478 95.082 1.8318 12.703 25.293 42.923 X21 X22 X23 X24 X25 1 17.166 66.150 0.38562 2.8982 82.490 2 18.715 53.161 0.49669 1.4147 73.939 3 14.893 53.741 0.26415 4.3469 82.398 4 19.151 58.156 0.29248 9.0577 84.658 Within-groups Covariance Matrix: X1 X2 X3 X4 X5 X6 X1 1.0075e-01 -0.01558851 1.9653e-03 2.9589e-04 -0.01678073 7.5468e-04 X2 -1.5589e-02 0.03774722 3.9639e-04 -1.3962e-04 -0.00833081 5.3858e-04 X3 1.9653e-03 0.00039639 7.8972e-04 4.4363e-05 -0.00267972 2.3537e-04 X4 2.9589e-04 -0.00013962 4.4363e-05 1.3073e-05 -0.00078407 8.5879e-05 X5 -1.6781e-02 -0.00833081 -2.6797e-03 -7.8407e-04 0.51505366 2.8378e-02 X6 7.5468e-04 0.00053858 2.3537e-04 8.5879e-05 0.02837750 1.1153e-02 X7 3.0868e-03 0.00470723 -6.9139e-04 -1.3441e-04 0.00880946 -3.6488e-03 X8 7.1794e-03 0.00961786 4.5009e-03 -5.0919e-04 0.13367484 -1.4867e-02 X9 5.8926e-05 0.00188753 -1.0991e-04 -1.8427e-04 0.02940887 -2.9770e-03 X10 4.6811e-03 0.00133752 -2.4714e-04 -1.1014e-04 0.00677281 -5.0715e-04 X11 -3.1876e-03 0.00334658 -1.3911e-04 -1.1625e-04 -0.00342804 -1.9757e-03 X12 7.4459e-01 -0.01395916 2.5029e-01 4.0035e-02 -8.81185765 2.6367e-01 X13 -9.0527e-03 0.00037205 -8.3614e-04 -2.0133e-04 0.01736112 -7.0723e-04 X14 5.5920e-02 0.00238741 1.2112e-03 2.8022e-04 0.00426822 4.7915e-03 X15 2.5077e-02 -0.04378063 -1.3704e-03 -5.6372e-04 0.22138752 -3.8430e-02 X16 -4.9743e-02 -0.00578575 -1.1361e-04 -1.9542e-04 0.03208921 -4.3213e-03 X17 2.4926e-02 -0.01902778 7.4078e-03 6.3535e-04 0.13388265 -1.5674e-02 X18 4.3537e-01 -0.06532118 1.1496e-02 1.9759e-03 -0.93912182 -6.2638e-02 X19 1.4354e-01 -0.03403202 -6.1778e-03 -2.7771e-03 1.01570784 6.4485e-02 X20 -4.7327e-01 0.12579554 2.0555e-02 2.3470e-03 -0.29362394 -3.8608e-02 X21 -1.0441e-01 -0.02566435 -2.5838e-02 -1.5441e-03 0.21654588 3.6622e-02 X22 3.0771e-01 -0.00852777 -6.6009e-02 2.8499e-03 -3.01570657 4.1747e-02 X23 -6.5152e-03 -0.02455614 7.3912e-04 -6.3861e-05 0.04763930 4.6270e-03 X24 1.3012e-02 -0.02148568 1.8808e-03 3.2722e-06 -0.17355656 5.1221e-02 X25 4.0052e-01 -0.07965637 -1.1004e-02 3.8341e-03 -1.12813808 -5.6574e-02 X7 X8 X9 X10 X11 X12 X1 0.00308676 0.00717938 5.8926e-05 0.00468110 -0.00318758 0.744590 X2 0.00470723 0.00961786 1.8875e-03 0.00133752 0.00334658 -0.013959 X3 -0.00069139 0.00450086 -1.0991e-04 -0.00024714 -0.00013911 0.250293 X4 -0.00013441 -0.00050919 -1.8427e-04 -0.00011014 -0.00011625 0.040035 X5 0.00880946 0.13367484 2.9409e-02 0.00677281 -0.00342804 -8.811858 X6 -0.00364879 -0.01486678 -2.9770e-03 -0.00050715 -0.00197571 0.263669 X7 0.01860202 0.02084255 6.1650e-03 0.00620821 0.00258873 -0.996138 X8 0.02084255 0.43761650 2.8359e-02 0.00024653 -0.00887803 -3.003400 X9 0.00616501 0.02835917 2.2814e-02 0.01099041 0.00739075 -0.897231 X10 0.00620821 0.00024653 1.0990e-02 0.01429493 0.00745539 -0.099134 X11 0.00258873 -0.00887803 7.3908e-03 0.00745539 0.01230347 -0.054913 X12 -0.99613784 -3.00339973 -8.9723e-01 -0.09913367 -0.05491279 637.249036 X13 0.00695659 -0.02774334 2.4374e-03 0.00266226 0.00305983 -2.226230 X14 0.00192086 -0.03672969 5.9712e-03 0.00345789 -0.00254399 0.720595 X15 0.02298077 0.14264842 7.0473e-02 0.01979711 0.02731600 -5.219577 X16 -0.00630934 0.08475976 3.1722e-03 -0.00052350 0.00366847 0.755587 X17 -0.00967837 0.14048414 5.9395e-03 -0.00819101 -0.01247029 -0.200470 X18 0.02097609 0.09538331 -3.8574e-02 -0.00501225 -0.04697676 16.831103 X19 0.11225492 0.54860260 6.5086e-02 0.04802989 -0.03462261 -29.903351 X20 -0.07048230 -0.15379415 4.1964e-02 -0.03301947 0.07710836 23.673715 X21 -0.06378517 -0.48947297 -6.8125e-02 -0.01061014 0.00385171 -10.510261 X22 -0.11529920 -2.30363771 -2.3368e-01 -0.06896527 0.06494587 23.914418 X23 -0.01364284 -0.04196183 4.8457e-03 0.00264627 0.00135742 -3.659631 X24 -0.06684020 -0.48307193 -1.3904e-01 -0.00772448 -0.05149164 22.680721 X25 0.13300210 0.23478052 -1.0210e-01 -0.01157060 -0.20230086 25.458870 X13 X14 X15 X16 X17 X18 X1 -0.00905269 0.05591992 0.02507716 -0.04974285 0.02492615 0.4353743 X2 0.00037205 0.00238741 -0.04378063 -0.00578575 -0.01902778 -0.0653212 X3 -0.00083614 0.00121118 -0.00137041 -0.00011361 0.00740783 0.0114962 X4 -0.00020133 0.00028022 -0.00056372 -0.00019542 0.00063535 0.0019759 X5 0.01736112 0.00426822 0.22138752 0.03208921 0.13388265 -0.9391218 X6 -0.00070723 0.00479150 -0.03842956 -0.00432129 -0.01567448 -0.0626381 X7 0.00695659 0.00192086 0.02298077 -0.00630934 -0.00967837 0.0209761 X8 -0.02774334 -0.03672969 0.14264842 0.08475976 0.14048414 0.0953833 X9 0.00243742 0.00597120 0.07047310 0.00317221 0.00593954 -0.0385744 X10 0.00266226 0.00345789 0.01979711 -0.00052350 -0.00819101 -0.0050123 X11 0.00305983 -0.00254399 0.02731600 0.00366847 -0.01247029 -0.0469768 X12 -2.22622981 0.72059459 -5.21957741 0.75558726 -0.20047022 16.8311031 X13 0.11108327 -0.01567907 -0.16752185 -0.11529652 -0.04544999 -0.2552620 X14 -0.01567907 0.09994108 -0.01569824 -0.07015906 0.02720200 0.2503806 X15 -0.16752185 -0.01569824 2.00392037 0.37160795 0.62715042 0.7967627 X16 -0.11529652 -0.07015906 0.37160795 0.27323468 0.19210016 0.1549772 X17 -0.04544999 0.02720200 0.62715042 0.19210016 1.23501579 0.4138355 X18 -0.25526201 0.25038063 0.79676269 0.15497723 0.41383545 10.3070627 X19 0.24155488 -0.08664877 0.19326403 -0.14513626 0.52955109 2.5196441 X20 -0.11964239 -0.26108797 -0.21426592 0.43565119 -0.28114580 -8.4471850 X21 0.13275742 0.09850232 -0.77055987 -0.44676392 -0.66024342 -4.3822959 X22 0.10341083 0.28327916 -3.68412649 -1.24107699 -6.14923068 4.2346310 X23 0.04231795 -0.00981335 0.01340726 -0.08799677 -0.04630938 -0.2590000 X24 -0.01552074 -0.07346550 0.27008407 0.13238579 -0.13664092 2.8673671 X25 -1.31348704 0.72203060 0.33499610 1.01362410 -0.53993979 11.4867022 X19 X20 X21 X22 X23 X24 X1 0.1435431 -0.473272 -0.1044050 0.3077074 -6.5152e-03 1.3012e-02 X2 -0.0340320 0.125796 -0.0256643 -0.0085278 -2.4556e-02 -2.1486e-02 X3 -0.0061778 0.020555 -0.0258375 -0.0660089 7.3912e-04 1.8808e-03 X4 -0.0027771 0.002347 -0.0015441 0.0028499 -6.3861e-05 3.2722e-06 X5 1.0157078 -0.293624 0.2165459 -3.0157066 4.7639e-02 -1.7356e-01 X6 0.0644851 -0.038608 0.0366216 0.0417473 4.6270e-03 5.1221e-02 X7 0.1122549 -0.070482 -0.0637852 -0.1152992 -1.3643e-02 -6.6840e-02 X8 0.5486026 -0.153794 -0.4894730 -2.3036377 -4.1962e-02 -4.8307e-01 X9 0.0650863 0.041964 -0.0681251 -0.2336808 4.8457e-03 -1.3904e-01 X10 0.0480299 -0.033019 -0.0106101 -0.0689653 2.6463e-03 -7.7245e-03 X11 -0.0346226 0.077108 0.0038517 0.0649459 1.3574e-03 -5.1492e-02 X12 -29.9033513 23.673715 -10.5102611 23.9144176 -3.6596e+00 2.2681e+01 X13 0.2415549 -0.119642 0.1327574 0.1034108 4.2318e-02 -1.5521e-02 X14 -0.0866488 -0.261088 0.0985023 0.2832792 -9.8133e-03 -7.3466e-02 X15 0.1932640 -0.214266 -0.7705599 -3.6841265 1.3407e-02 2.7008e-01 X16 -0.1451363 0.435651 -0.4467639 -1.2410770 -8.7997e-02 1.3239e-01 X17 0.5295511 -0.281146 -0.6602434 -6.1492307 -4.6309e-02 -1.3664e-01 X18 2.5196441 -8.447185 -4.3822959 4.2346310 -2.5900e-01 2.8674e+00 X19 14.5564984 -12.266488 -4.8140511 -7.1199778 5.6512e-01 -3.6612e+00 X20 -12.2664877 21.197239 -0.4800891 -2.3537488 -8.1626e-01 -2.4633e+00 X21 -4.8140511 -0.480089 9.6825218 5.2593408 5.1455e-01 3.2295e+00 X22 -7.1199778 -2.353749 5.2593408 89.5162661 2.1312e-01 -1.1447e+01 X23 0.5651189 -0.816263 0.5145496 0.2131155 3.4460e-01 -1.4205e-01 X24 -3.6611682 -2.463317 3.2295104 -11.4467578 -1.4205e-01 2.1281e+01 X25 -12.0846229 1.596400 -1.0406194 4.3940585 -2.2439e+00 9.8644e+00 X25 X1 0.4005158 X2 -0.0796564 X3 -0.0110045 X4 0.0038341 X5 -1.1281381 X6 -0.0565740 X7 0.1330021 X8 0.2347805 X9 -0.1021017 X10 -0.0115706 X11 -0.2023009 X12 25.4588697 X13 -1.3134870 X14 0.7220306 X15 0.3349961 X16 1.0136241 X17 -0.5399398 X18 11.4867022 X19 -12.0846229 X20 1.5964001 X21 -1.0406194 X22 4.3940585 X23 -2.2438922 X24 9.8643698 X25 71.0469583 Linear Coeficients: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 -114.98 584.26 3539.5 162830 -84.213 -1950.9 1946.3 47.889 -2806.1 1069.4 2 -118.16 576.10 3572.0 162272 -86.893 -1944.1 1932.6 47.549 -2821.2 1080.6 3 -119.84 576.68 3592.6 162772 -80.727 -1927.3 1942.2 49.663 -2815.1 1074.4 4 -105.85 575.31 3494.3 163269 -86.611 -1950.6 1922.4 53.594 -2812.1 1070.4 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 X21 1 3879.0 -9.4031 3709.5 2525.6 -218.27 3533.2 -486.04 48511 48726 48579 48653 2 3865.7 -9.3867 3711.4 2527.8 -215.40 3529.9 -486.68 48538 48754 48607 48681 3 3895.8 -9.4594 3696.4 2517.6 -218.75 3522.9 -483.99 48562 48777 48630 48703 4 3909.2 -9.3699 3718.0 2537.3 -217.73 3536.7 -487.05 48554 48772 48624 48698 X22 X23 X24 X25 1 -5.4754 -174.12 66.147 39.613 2 -5.7252 -176.47 65.782 39.574 3 -5.4008 -177.56 66.351 39.555 4 -5.4476 -174.58 66.861 39.958 Constants: 1 2 3 4 -2617094 -2619257 -2620690 -2621479 Apparent error rate 0.15 Classification table Predicted Actual 1 2 3 4 1 44 1 4 1 2 2 23 0 0 3 6 1 26 1 4 1 1 0 9 Confusion matrix Predicted Actual 1 2 3 4 1 0.880 0.020 0.080 0.020 2 0.080 0.920 0.000 0.000 3 0.176 0.029 0.765 0.029 4 0.091 0.091 0.000 0.818 =================================================== > dodata(method="mcdC") Call: dodata(method = "mcdC") =================================================== Data: hemophilia Call: Linda(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.32583 -0.011545 normal -0.12783 -0.071377 Within-groups Covariance Matrix: AHFactivity AHFantigen AHFactivity 0.0120964 0.0075536 AHFantigen 0.0075536 0.0164883 Linear Coeficients: AHFactivity AHFantigen carrier -37.117 16.30377 normal -11.015 0.71742 Constants: carrier normal -6.4636 -1.5947 Apparent error rate 0.16 Classification table Predicted Actual carrier normal carrier 38 7 normal 5 25 Confusion matrix Predicted Actual carrier normal carrier 0.844 0.156 normal 0.167 0.833 Data: anorexia Call: Linda(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.477 82.073 Cont 82.039 80.835 FT 85.242 94.750 Within-groups Covariance Matrix: Prewt Postwt Prewt 19.6589 8.3891 Postwt 8.3891 22.8805 Linear Coeficients: Prewt Postwt CBT 3.1590 2.4288 Cont 3.1599 2.3743 FT 3.0454 3.0245 Constants: CBT Cont FT -230.85 -226.60 -274.53 Apparent error rate 0.4583 Classification table Predicted Actual CBT Cont FT CBT 16 5 8 Cont 14 10 2 FT 0 4 13 Confusion matrix Predicted Actual CBT Cont FT CBT 0.552 0.172 0.276 Cont 0.538 0.385 0.077 FT 0.000 0.235 0.765 Data: Pima Call: Linda(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.3056 110.63 67.991 26.444 31.010 0.41653 25.806 Yes 5.0444 142.58 74.267 33.067 34.309 0.49422 35.156 Within-groups Covariance Matrix: npreg glu bp skin bmi ped age npreg 6.164422 8.43753 6.879286 3.252980 1.54269 -0.020158 9.543745 glu 8.437528 542.79578 57.156929 26.218837 28.63494 -0.421819 23.809124 bp 6.879286 57.15693 106.687356 26.315526 12.86691 -0.039577 22.992973 skin 3.252980 26.21884 26.315526 106.552759 44.95420 0.094311 12.005740 bmi 1.542689 28.63494 12.866911 44.954202 36.56262 0.167258 6.112925 ped -0.020158 -0.42182 -0.039577 0.094311 0.16726 0.059609 -0.072712 age 9.543745 23.80912 22.992973 12.005740 6.11292 -0.072712 35.594886 Linear Coeficients: npreg glu bp skin bmi ped age No -1.4165 0.11776 0.49336 -0.31564 0.88761 6.5013 0.67462 Yes -1.3784 0.17062 0.46662 -0.26771 0.83745 8.5204 0.90557 Constants: No Yes -41.716 -55.056 Apparent error rate 0.235 Classification table Predicted Actual No Yes No 107 25 Yes 22 46 Confusion matrix Predicted Actual No Yes No 0.811 0.189 Yes 0.324 0.676 Data: Forest soils Call: Linda(F ~ ., data = soil1983, method = method) Prior Probabilities of Groups: 1 2 3 0.18966 0.39655 0.41379 Group means: Al Ca Mg K Na 1 64.117 7.9967 1.5450 3.9600 0.89333 2 125.869 11.9769 2.6531 8.6756 1.00125 3 142.650 19.2450 2.3429 8.9007 1.10643 Within-groups Covariance Matrix: Al Ca Mg K Na Al 3022.734 237.23886 45.22952 156.12659 16.64305 Ca 237.239 43.57847 4.08960 16.96110 -0.22626 Mg 45.230 4.08960 0.89797 2.97554 0.28453 K 156.127 16.96110 2.97554 11.26046 0.64452 Na 16.643 -0.22626 0.28453 0.64452 0.40939 Linear Coeficients: Al Ca Mg K Na 1 -0.031062 0.361286 4.6083 -1.104355 2.1804 2 -0.016899 0.074875 3.0648 0.024569 1.0053 3 -0.006418 0.555117 -2.1890 0.381863 4.1906 Constants: 1 2 3 -4.4585 -4.9853 -7.2197 Apparent error rate 0.3276 Classification table Predicted Actual 1 2 3 1 5 2 4 2 2 13 8 3 1 2 21 Confusion matrix Predicted Actual 1 2 3 1 0.455 0.182 0.364 2 0.087 0.565 0.348 3 0.042 0.083 0.875 Data: Raven and Miller diabetes data Call: Linda(group ~ insulin + glucose + sspg, data = diabetes, method = method) Prior Probabilities of Groups: normal chemical overt 0.52414 0.24828 0.22759 Group means: insulin glucose sspg normal 167.31 348.69 106.44 chemical 247.18 478.18 213.36 overt 101.83 932.92 322.42 Within-groups Covariance Matrix: insulin glucose sspg insulin 4070.84 118.89 1701.54 glucose 118.89 2195.95 426.95 sspg 1701.54 426.95 2664.49 Linear Coeficients: insulin glucose sspg normal 0.041471 0.15888 -0.011992 chemical 0.048103 0.21216 0.015359 overt -0.013579 0.41323 0.063462 Constants: normal chemical overt -31.177 -59.703 -203.775 Apparent error rate 0.0828 Classification table Predicted Actual normal chemical overt normal 72 4 0 chemical 2 34 0 overt 0 6 27 Confusion matrix Predicted Actual normal chemical overt normal 0.947 0.053 0.000 chemical 0.056 0.944 0.000 overt 0.000 0.182 0.818 Data: iris Call: Linda(Species ~ ., data = iris, method = method, l1med = TRUE) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.0163 3.4510 1.4653 0.2449 versicolor 5.9435 2.7891 4.2543 1.3239 virginica 6.3867 3.0033 5.3767 2.0700 Within-groups Covariance Matrix: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.186186 0.082478 0.094998 0.035445 Sepal.Width 0.082478 0.100137 0.049723 0.030678 Petal.Length 0.094998 0.049723 0.113105 0.043078 Petal.Width 0.035445 0.030678 0.043078 0.030885 Linear Coeficients: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 23.678 30.2896 -3.1124 -44.9900 versicolor 20.342 4.6372 27.3265 -23.2006 virginica 18.377 -2.0004 31.4235 4.0906 Constants: setosa versicolor virginica -104.96 -110.79 -145.49 Apparent error rate 0.0333 Classification table Predicted Actual setosa versicolor virginica setosa 50 0 0 versicolor 0 48 2 virginica 0 3 47 Confusion matrix Predicted Actual setosa versicolor virginica setosa 1 0.00 0.00 versicolor 0 0.96 0.04 virginica 0 0.06 0.94 Data: crabs Call: Linda(sp ~ ., data = crabs, method = method) Prior Probabilities of Groups: B O 0.5 0.5 Group means: sexM index FL RW CL CW BD B 0.50000 23.956 13.790 11.649 29.390 33.934 12.274 O 0.51087 24.478 16.903 13.330 33.707 37.595 15.276 Within-groups Covariance Matrix: sexM index FL RW CL CW BD sexM 0.25272 0.39179 0.14054 -0.30017 0.51191 0.45114 0.21708 index 0.39179 192.47099 39.97343 26.56698 84.63152 94.99987 38.67917 FL 0.14054 39.97343 8.97950 5.91408 18.98672 21.38046 8.60313 RW -0.30017 26.56698 5.91408 4.81389 12.31798 14.10613 5.58933 CL 0.51191 84.63152 18.98672 12.31798 40.94109 45.94330 18.52367 CW 0.45114 94.99987 21.38046 14.10613 45.94330 51.80106 20.79704 BD 0.21708 38.67917 8.60313 5.58933 18.52367 20.79704 8.49355 Linear Coeficients: sexM index FL RW CL CW BD B 13.993 -2.5515 9.152 9.9187 2.2321 -2.9774 -0.66797 O 14.362 -4.0280 23.369 12.1556 5.3672 -14.9236 12.94057 Constants: B O -72.687 -142.365 Apparent error rate 0 Classification table Predicted Actual B O B 100 0 O 0 100 Confusion matrix Predicted Actual B O B 1 0 O 0 1 Data: fish Call: Linda(Species ~ ., data = fish, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 5 6 7 0.215190 0.037975 0.126582 0.069620 0.088608 0.107595 0.354430 Group means: Weight Length1 Length2 Length3 Height Width 1 602.8421 30.242 32.968 38.279 15.1147 5.3605 2 282.0000 24.433 26.833 29.600 8.4346 4.3926 3 150.5000 20.300 21.944 24.531 6.5338 3.5796 4 154.8182 18.727 20.345 22.791 8.9624 3.2207 5 9.7417 10.883 11.467 12.592 2.0939 1.2346 6 508.2500 41.300 44.000 46.925 7.2142 4.6369 7 160.5000 21.166 23.128 24.534 6.2186 3.7232 Within-groups Covariance Matrix: Weight Length1 Length2 Length3 Height Width Weight 5489.837 182.2663 193.0905 205.7724 66.13661 34.10995 Length1 182.266 7.6894 8.0638 8.5532 2.49205 1.30543 Length2 193.090 8.0638 8.4916 9.0194 2.65007 1.38633 Length3 205.772 8.5532 9.0194 9.6183 2.84968 1.48728 Height 66.137 2.4921 2.6501 2.8497 1.01153 0.45513 Width 34.110 1.3054 1.3863 1.4873 0.45513 0.26690 Linear Coeficients: Weight Length1 Length2 Length3 Height Width 1 -0.23792 -5.4202 -71.45249 78.781 21.4602 -27.4539 2 -0.37698 -33.9495 21.23223 19.473 3.3998 6.0906 3 -0.37975 -14.7737 -7.70833 29.179 1.8817 8.4347 4 -0.43710 -8.9415 -0.20863 11.940 23.9955 5.2911 5 -0.19610 -6.7323 -6.69841 20.882 -5.4728 -9.6234 6 -0.17657 -54.1758 28.62914 51.313 -38.8746 -63.4321 7 -0.42543 -35.5939 58.10668 -15.372 3.9328 19.5463 Constants: 1 2 3 4 5 6 7 -266.44 -136.15 -118.11 -135.10 -46.23 -385.10 -122.21 Apparent error rate 0.0316 Classification table Predicted Actual 1 2 3 4 5 6 7 1 34 0 0 0 0 0 0 2 0 5 0 0 1 0 0 3 0 0 20 0 0 0 0 4 0 0 0 11 0 0 0 5 0 0 0 0 13 0 1 6 0 0 0 0 0 17 0 7 0 0 0 0 3 0 53 Confusion matrix Predicted Actual 1 2 3 4 5 6 7 1 1 0.000 0 0 0.000 0 0.000 2 0 0.833 0 0 0.167 0 0.000 3 0 0.000 1 0 0.000 0 0.000 4 0 0.000 0 1 0.000 0 0.000 5 0 0.000 0 0 0.929 0 0.071 6 0 0.000 0 0 0.000 1 0.000 7 0 0.000 0 0 0.054 0 0.946 Data: pottery Call: Linda(origin ~ ., data = pottery, method = method) Prior Probabilities of Groups: Attic Eritrean 0.48148 0.51852 Group means: SI AL FE MG CA TI Attic 55.450 13.738 10.0000 5.0750 5.0750 0.87375 Eritrean 52.444 16.444 9.3222 3.1667 6.1778 0.82000 Within-groups Covariance Matrix: SI AL FE MG CA TI SI 6.565481 1.6098148 -0.075259 0.369556 -0.359407 0.0169667 AL 1.609815 0.5640648 0.029407 0.302056 0.112426 0.0018583 FE -0.075259 0.0294074 0.167704 -0.180222 -0.343704 0.0110667 MG 0.369556 0.3020556 -0.180222 1.031667 0.915222 -0.0192167 CA -0.359407 0.1124259 -0.343704 0.915222 1.447370 -0.0348167 TI 0.016967 0.0018583 0.011067 -0.019217 -0.034817 0.0011725 Linear Coeficients: SI AL FE MG CA TI Attic 190.17 -622.48 922.21 1.5045 293.30 -990.323 Eritrean 135.34 -431.40 666.59 -14.3288 237.68 -44.025 Constants: Attic Eritrean -5924.2 -3802.9 Apparent error rate 0.1111 Classification table Predicted Actual Attic Eritrean Attic 12 1 Eritrean 2 12 Confusion matrix Predicted Actual Attic Eritrean Attic 0.923 0.077 Eritrean 0.143 0.857 Data: olitos Call: Linda(grp ~ ., data = olitos, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 0.416667 0.208333 0.283333 0.091667 Group means: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 0.64294 61.921 0.13791 0.0081515 12.248 0.80324 2.3245 6.3305 0.73445 0.51021 2 0.46111 61.683 0.15479 0.0093684 12.438 0.78374 2.1369 6.0727 0.63216 0.45216 3 0.81050 61.874 0.17840 0.0099500 13.900 1.07350 2.1825 7.2095 0.62950 0.44100 4 1.31500 61.449 0.16260 0.0126000 12.757 0.99300 2.0330 6.2830 0.69700 0.52900 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 0.43142 243.62 3.3090 0.98597 89.735 95.558 2.0217 15.591 27.181 39.963 2 0.38058 260.69 3.3727 0.88426 91.844 95.704 3.4858 11.064 23.417 47.387 3 0.38900 242.41 3.0110 1.07600 89.299 95.847 3.0565 16.396 32.557 35.792 4 0.48900 279.81 3.1830 1.29900 89.477 95.499 1.5950 12.853 23.303 44.931 X21 X22 X23 X24 X25 1 17.294 66.468 0.48324 2.3235 81.471 2 18.160 52.869 0.38111 1.6337 74.808 3 15.281 53.653 0.28300 4.2515 82.525 4 18.939 58.287 0.03300 12.2430 88.203 Within-groups Covariance Matrix: X1 X2 X3 X4 X5 X6 X1 0.08192984 -1.4804e-02 1.6222e-03 2.5574e-04 -0.01926070 0.00143293 X2 -0.01480374 3.0815e-02 4.1084e-04 -8.8101e-05 -0.01270958 0.00042495 X3 0.00162220 4.1084e-04 6.6120e-04 3.3939e-05 -0.00180448 0.00024347 X4 0.00025574 -8.8101e-05 3.3939e-05 9.7372e-06 -0.00047911 0.00008244 X5 -0.01926070 -1.2710e-02 -1.8045e-03 -4.7911e-04 0.40752640 0.02398390 X6 0.00143293 4.2495e-04 2.4347e-04 8.2440e-05 0.02398390 0.00923965 X7 0.00184589 3.3208e-03 -5.2715e-04 -9.7685e-05 0.00323853 -0.00310095 X8 -0.00228054 3.9423e-03 3.9439e-03 -3.6048e-04 0.09316455 -0.01139272 X9 -0.00199165 6.1845e-04 -8.5603e-05 -1.4661e-04 0.02106528 -0.00223360 X10 0.00257748 6.0951e-04 -2.1561e-04 -9.6934e-05 0.00359901 -0.00017581 X11 -0.00340244 2.6140e-03 -1.1022e-04 -9.7441e-05 -0.00468098 -0.00154221 X12 0.72257320 5.6434e-02 2.0568e-01 3.1016e-02 -6.91486269 0.21413113 X13 -0.00930585 8.2797e-04 -8.3881e-04 -2.0912e-04 0.01706489 0.00011381 X14 0.04303799 -1.8159e-04 1.0473e-03 2.6788e-04 -0.00576272 0.00484686 X15 0.02062031 -3.6173e-02 -1.5239e-03 -5.8544e-04 0.20597410 -0.03232787 X16 -0.03561929 -4.2594e-03 1.8684e-04 -1.0880e-04 0.02798146 -0.00570779 X17 0.01711872 -1.5022e-02 5.8357e-03 3.8079e-04 0.13128713 -0.01182319 X18 0.37133025 -6.9297e-02 1.1156e-02 2.0110e-03 -0.84907264 -0.05901073 X19 0.08525820 -6.8412e-02 -2.4834e-03 -1.3360e-03 0.67816743 0.05310675 X20 -0.36324847 1.6458e-01 1.2916e-02 3.5649e-04 0.02189381 -0.02559493 X21 -0.09342145 -2.6850e-02 -2.1599e-02 -1.0308e-03 0.14908644 0.03146858 X22 0.26007045 -2.2426e-02 -5.5114e-02 2.8727e-03 -2.62480736 0.03052551 X23 -0.01063391 -2.3502e-02 5.9722e-04 -1.4575e-05 0.03270833 0.00471201 X24 0.06866746 5.0890e-03 2.2764e-03 -1.4651e-04 -0.07352365 0.03340318 X25 0.40646770 -5.3335e-02 -7.0022e-03 3.4926e-03 -0.94794120 -0.06422767 X7 X8 X9 X10 X11 X12 X1 1.8459e-03 -0.00228054 -1.9916e-03 2.5775e-03 -3.4024e-03 0.722573 X2 3.3208e-03 0.00394227 6.1845e-04 6.0951e-04 2.6140e-03 0.056434 X3 -5.2715e-04 0.00394388 -8.5603e-05 -2.1561e-04 -1.1022e-04 0.205684 X4 -9.7685e-05 -0.00036048 -1.4661e-04 -9.6934e-05 -9.7441e-05 0.031016 X5 3.2385e-03 0.09316455 2.1065e-02 3.5990e-03 -4.6810e-03 -6.914863 X6 -3.1009e-03 -0.01139272 -2.2336e-03 -1.7581e-04 -1.5422e-03 0.214131 X7 1.4626e-02 0.01416383 4.4486e-03 4.2667e-03 1.5223e-03 -0.747339 X8 1.4164e-02 0.35090522 1.9188e-02 -3.5397e-03 -9.8703e-03 -2.122989 X9 4.4486e-03 0.01918824 1.8282e-02 8.4147e-03 5.7831e-03 -0.689536 X10 4.2667e-03 -0.00353975 8.4147e-03 1.0979e-02 5.6659e-03 -0.024538 X11 1.5223e-03 -0.00987030 5.7831e-03 5.6659e-03 1.0045e-02 0.010425 X12 -7.4734e-01 -2.12298901 -6.8954e-01 -2.4538e-02 1.0425e-02 528.021699 X13 5.6182e-03 -0.02617066 1.4205e-03 1.2657e-03 2.0122e-03 -1.880820 X14 1.4474e-04 -0.04271352 2.4885e-03 1.1360e-03 -3.1714e-03 0.793783 X15 2.3251e-02 0.12988364 6.1204e-02 1.8438e-02 2.5089e-02 -4.937326 X16 -4.7036e-03 0.08431243 5.6934e-03 2.0999e-03 4.4307e-03 0.559833 X17 -7.3926e-03 0.11992315 3.8683e-03 -9.2427e-03 -1.1110e-02 -0.529966 X18 5.9929e-03 0.06325323 -3.8778e-02 -1.1760e-02 -4.3369e-02 14.665332 X19 6.4989e-02 0.33281344 2.5819e-02 1.9600e-02 -4.2651e-02 -22.404179 X20 -1.9352e-02 0.03831912 7.2476e-02 -4.6512e-03 8.0268e-02 16.067296 X21 -5.1676e-02 -0.43417424 -5.9466e-02 -3.2553e-03 5.7380e-03 -8.334793 X22 -1.0003e-01 -1.97988438 -2.0294e-01 -5.6006e-02 5.8615e-02 20.456167 X23 -1.0828e-02 -0.04493945 2.1193e-03 2.5431e-03 1.6178e-03 -3.069866 X24 -5.1168e-02 -0.29807074 -9.1349e-02 7.5238e-03 -3.8252e-02 18.339747 X25 9.9946e-02 0.29267421 -6.4705e-02 -7.2911e-03 -1.7524e-01 21.956647 X13 X14 X15 X16 X17 X18 X1 -0.00930585 0.04303799 0.02062031 -0.03561929 0.01711872 0.3713302 X2 0.00082797 -0.00018159 -0.03617337 -0.00425936 -0.01502219 -0.0692965 X3 -0.00083881 0.00104734 -0.00152393 0.00018684 0.00583572 0.0111562 X4 -0.00020912 0.00026788 -0.00058544 -0.00010880 0.00038079 0.0020110 X5 0.01706489 -0.00576272 0.20597410 0.02798146 0.13128713 -0.8490726 X6 0.00011381 0.00484686 -0.03232787 -0.00570779 -0.01182319 -0.0590107 X7 0.00561818 0.00014474 0.02325121 -0.00470365 -0.00739263 0.0059929 X8 -0.02617066 -0.04271352 0.12988364 0.08431243 0.11992315 0.0632532 X9 0.00142053 0.00248849 0.06120418 0.00569339 0.00386827 -0.0387778 X10 0.00126574 0.00113596 0.01843799 0.00209990 -0.00924273 -0.0117601 X11 0.00201218 -0.00317144 0.02508867 0.00443067 -0.01110991 -0.0433685 X12 -1.88082048 0.79378336 -4.93732591 0.55983317 -0.52996566 14.6653317 X13 0.09251619 -0.01474724 -0.14362180 -0.09332066 -0.04401368 -0.2050390 X14 -0.01474724 0.07935056 -0.01141736 -0.05297175 0.02142245 0.2064316 X15 -0.14362180 -0.01141736 1.69199646 0.32096806 0.52025752 0.7029083 X16 -0.09332066 -0.05297175 0.32096806 0.21779836 0.17675411 0.1056873 X17 -0.04401368 0.02142245 0.52025752 0.17675411 1.02863233 0.3693946 X18 -0.20503902 0.20643158 0.70290826 0.10568728 0.36939462 8.4907734 X19 0.21803216 -0.13770133 0.25126309 -0.11319404 0.51609127 1.7133521 X20 -0.13288099 -0.14448419 -0.30575093 0.39025679 -0.35944745 -6.5189315 X21 0.11987895 0.07586182 -0.64857504 -0.38269413 -0.52646722 -3.6869334 X22 0.10834603 0.23361478 -3.14523066 -1.08673427 -5.21678265 3.4097756 X23 0.03635360 -0.01412392 0.00659318 -0.06858385 -0.04017227 -0.2118403 X24 0.00218340 0.00325933 0.25430828 0.02288744 -0.07006603 2.4332616 X25 -1.09814009 0.67901476 0.37604041 0.74315024 -0.37538529 9.4971076 X19 X20 X21 X22 X23 X24 X1 0.0852582 -0.36324847 -0.0934214 0.2600705 -1.0634e-02 0.06866746 X2 -0.0684123 0.16457798 -0.0268500 -0.0224258 -2.3502e-02 0.00508904 X3 -0.0024834 0.01291620 -0.0215995 -0.0551143 5.9722e-04 0.00227645 X4 -0.0013360 0.00035649 -0.0010308 0.0028727 -1.4575e-05 -0.00014651 X5 0.6781674 0.02189381 0.1490864 -2.6248074 3.2708e-02 -0.07352365 X6 0.0531067 -0.02559493 0.0314686 0.0305255 4.7120e-03 0.03340318 X7 0.0649890 -0.01935190 -0.0516765 -0.1000276 -1.0828e-02 -0.05116827 X8 0.3328134 0.03831912 -0.4341742 -1.9798844 -4.4939e-02 -0.29807074 X9 0.0258192 0.07247619 -0.0594655 -0.2029397 2.1193e-03 -0.09134914 X10 0.0196003 -0.00465122 -0.0032553 -0.0560061 2.5431e-03 0.00752375 X11 -0.0426508 0.08026811 0.0057380 0.0586147 1.6178e-03 -0.03825213 X12 -22.4041788 16.06729645 -8.3347928 20.4561669 -3.0699e+00 18.33974674 X13 0.2180322 -0.13288099 0.1198789 0.1083460 3.6354e-02 0.00218340 X14 -0.1377013 -0.14448419 0.0758618 0.2336148 -1.4124e-02 0.00325933 X15 0.2512631 -0.30575093 -0.6485750 -3.1452307 6.5932e-03 0.25430828 X16 -0.1131940 0.39025679 -0.3826941 -1.0867343 -6.8584e-02 0.02288744 X17 0.5160913 -0.35944745 -0.5264672 -5.2167826 -4.0172e-02 -0.07006603 X18 1.7133521 -6.51893147 -3.6869334 3.4097756 -2.1184e-01 2.43326162 X19 11.1556891 -8.64959122 -4.2242019 -6.4452276 4.3858e-01 -2.60113574 X20 -8.6495912 15.39607917 -0.2206486 -1.3792663 -6.3755e-01 -2.71395816 X21 -4.2242019 -0.22064859 8.1314122 4.4195292 4.1056e-01 2.88241171 X22 -6.4452276 -1.37926631 4.4195292 76.1419157 1.5632e-01 -9.66199793 X23 0.4385776 -0.63754801 0.4105624 0.1563179 2.8153e-01 -0.03108501 X24 -2.6011357 -2.71395816 2.8824117 -9.6619979 -3.1085e-02 17.29935324 X25 -10.2482366 1.44006845 -0.6829641 3.7677482 -1.7867e+00 7.37053118 X25 X1 0.4064677 X2 -0.0533349 X3 -0.0070022 X4 0.0034926 X5 -0.9479412 X6 -0.0642277 X7 0.0999460 X8 0.2926742 X9 -0.0647053 X10 -0.0072911 X11 -0.1752351 X12 21.9566466 X13 -1.0981401 X14 0.6790148 X15 0.3760404 X16 0.7431502 X17 -0.3753853 X18 9.4971076 X19 -10.2482366 X20 1.4400685 X21 -0.6829641 X22 3.7677482 X23 -1.7866646 X24 7.3705312 X25 58.9835178 Linear Coeficients: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 1 1515.4 3105.1 170261 -757983 -118.08 17863 19830 -9609.6 -173.38 12947 -14834 2 1507.5 3088.1 170294 -758357 -124.37 17881 19807 -9608.9 -196.14 12975 -14852 3 1511.7 3099.7 170320 -758136 -112.61 17883 19827 -9607.6 -182.20 12946 -14813 4 1523.8 3087.4 170210 -757574 -123.78 17877 19799 -9603.5 -180.18 12945 -14804 X12 X13 X14 X15 X16 X17 X18 X19 X20 X21 1 74.898 -10999 -20401 309.54 -3263.7 -1666.4 2807654 2805955 2804668 2808095 2 74.839 -11003 -20405 314.29 -3277.4 -1665.6 2807622 2805923 2804636 2808063 3 74.865 -11011 -20407 308.39 -3271.2 -1664.7 2807685 2805986 2804698 2808125 4 74.876 -10992 -20391 310.95 -3263.1 -1667.1 2807388 2805692 2804404 2807830 X22 X23 X24 X25 1 -711.39 -5316.5 -1443.7 -358.28 2 -711.64 -5321.7 -1443.9 -358.35 3 -711.31 -5319.2 -1443.5 -358.33 4 -711.36 -5318.3 -1442.6 -357.88 Constants: 1 2 3 4 -140244417 -140239143 -140246342 -140217059 Apparent error rate 0.1667 Classification table Predicted Actual 1 2 3 4 1 44 1 2 3 2 2 22 0 1 3 5 2 25 2 4 1 1 0 9 Confusion matrix Predicted Actual 1 2 3 4 1 0.880 0.020 0.040 0.060 2 0.080 0.880 0.000 0.040 3 0.147 0.059 0.735 0.059 4 0.091 0.091 0.000 0.818 =================================================== > dodata(method="mrcd") Call: dodata(method = "mrcd") =================================================== Data: hemophilia Call: Linda(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.34048 -0.055943 normal -0.13566 -0.081191 Within-groups Covariance Matrix: AHFactivity AHFantigen AHFactivity 0.0133676 0.0088055 AHFantigen 0.0088055 0.0221225 Linear Coeficients: AHFactivity AHFantigen carrier -32.264 10.31334 normal -10.478 0.50044 Constants: carrier normal -5.7149 -1.6067 Apparent error rate 0.16 Classification table Predicted Actual carrier normal carrier 38 7 normal 5 25 Confusion matrix Predicted Actual carrier normal carrier 0.844 0.156 normal 0.167 0.833 Data: anorexia Call: Linda(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 83.114 84.009 Cont 80.327 80.125 FT 85.161 94.371 Within-groups Covariance Matrix: Prewt Postwt Prewt 22.498 11.860 Postwt 11.860 20.426 Linear Coeficients: Prewt Postwt CBT 2.1994 2.8357 Cont 2.1653 2.6654 FT 1.9451 3.4907 Constants: CBT Cont FT -211.42 -194.77 -248.97 Apparent error rate 0.3889 Classification table Predicted Actual CBT Cont FT CBT 15 6 8 Cont 6 16 4 FT 0 4 13 Confusion matrix Predicted Actual CBT Cont FT CBT 0.517 0.207 0.276 Cont 0.231 0.615 0.154 FT 0.000 0.235 0.765 Data: Pima Call: Linda(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 1.9925 108.32 66.240 24.856 30.310 0.37382 24.747 Yes 5.8855 145.88 75.715 32.541 33.915 0.39281 38.857 Within-groups Covariance Matrix: npreg glu bp skin bmi ped age npreg 4.090330 7.9547 3.818380 3.35899 2.470242 0.032557 9.5929 glu 7.954730 770.4187 76.377665 53.32216 54.100400 -1.139087 28.5677 bp 3.818380 76.3777 108.201622 42.61184 18.574983 -0.089151 20.3558 skin 3.358992 53.3222 42.611844 146.81170 65.210794 -0.277335 15.0162 bmi 2.470242 54.1004 18.574983 65.21079 52.871847 0.062145 9.0741 ped 0.032557 -1.1391 -0.089151 -0.27733 0.062145 0.063490 0.1762 age 9.592948 28.5677 20.355803 15.01616 9.074109 0.176201 53.5163 Linear Coeficients: npreg glu bp skin bmi ped age No -1.30832 0.065773 0.54772 -0.32738 0.70207 5.2556 0.40900 Yes -0.76566 0.106435 0.55777 -0.28044 0.61709 5.9199 0.54892 Constants: No Yes -33.429 -45.434 Apparent error rate 0.28 Classification table Predicted Actual No Yes No 105 27 Yes 29 39 Confusion matrix Predicted Actual No Yes No 0.795 0.205 Yes 0.426 0.574 Data: Forest soils Call: Linda(F ~ ., data = soil1983, method = method) Prior Probabilities of Groups: 1 2 3 0.18966 0.39655 0.41379 Group means: Al Ca Mg K Na 1 55.889 6.8776 1.4328 3.6186 0.80101 2 113.714 10.4451 2.5170 7.9269 0.99434 3 131.297 17.5642 2.1886 8.0061 1.36351 Within-groups Covariance Matrix: Al Ca Mg K Na Al 2958.984 146.3848 35.67352 97.1776 33.21281 Ca 146.385 40.0363 2.52523 9.2872 1.04648 Mg 35.674 2.5252 0.64662 1.8290 0.46809 K 97.178 9.2872 1.82900 6.7493 1.32264 Na 33.213 1.0465 0.46809 1.3226 0.66313 Linear Coeficients: Al Ca Mg K Na 1 -0.0261119 0.082137 4.56023 -0.44898 0.062663 2 -0.0019118 -0.095129 4.55347 0.63502 -2.735430 3 0.0163719 0.217866 -0.51718 0.89379 -0.525272 Constants: 1 2 3 -3.6951 -7.2068 -6.5243 Apparent error rate 0.3448 Classification table Predicted Actual 1 2 3 1 7 2 2 2 4 14 5 3 3 4 17 Confusion matrix Predicted Actual 1 2 3 1 0.636 0.182 0.182 2 0.174 0.609 0.217 3 0.125 0.167 0.708 Data: Raven and Miller diabetes data Call: Linda(group ~ insulin + glucose + sspg, data = diabetes, method = method) Prior Probabilities of Groups: normal chemical overt 0.52414 0.24828 0.22759 Group means: insulin glucose sspg normal 154.014 346.07 91.606 chemical 248.841 451.10 221.936 overt 89.766 1064.16 335.100 Within-groups Covariance Matrix: insulin glucose sspg insulin 4948.1 1007.61 1471.12 glucose 1007.6 2597.38 358.57 sspg 1471.1 358.57 3180.04 Linear Coeficients: insulin glucose sspg normal 0.00027839 0.13121 0.013882 chemical 0.00148074 0.16615 0.050371 overt -0.10102404 0.43466 0.103100 Constants: normal chemical overt -24.008 -44.642 -245.497 Apparent error rate 0.0966 Classification table Predicted Actual normal chemical overt normal 71 5 0 chemical 2 34 0 overt 0 7 26 Confusion matrix Predicted Actual normal chemical overt normal 0.934 0.066 0.000 chemical 0.056 0.944 0.000 overt 0.000 0.212 0.788 Data: iris Call: Linda(Species ~ ., data = iris, method = method, l1med = TRUE) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 4.9755 3.3826 1.4608 0.22053 versicolor 5.8868 2.7823 4.2339 1.34603 virginica 6.5176 2.9691 5.4560 2.06335 Within-groups Covariance Matrix: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.238417 0.136325 0.086377 0.036955 Sepal.Width 0.136325 0.148452 0.067500 0.034804 Petal.Length 0.086377 0.067500 0.100934 0.035968 Petal.Width 0.036955 0.034804 0.035968 0.023856 Linear Coeficients: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 17.106 15.693 7.8806 -52.031 versicolor 21.744 -15.813 38.0139 -11.505 virginica 23.032 -26.567 43.6391 23.777 Constants: setosa versicolor virginica -70.214 -115.832 -180.294 Apparent error rate 0.02 Classification table Predicted Actual setosa versicolor virginica setosa 50 0 0 versicolor 0 49 1 virginica 0 2 48 Confusion matrix Predicted Actual setosa versicolor virginica setosa 1 0.00 0.00 versicolor 0 0.98 0.02 virginica 0 0.04 0.96 Data: crabs Call: Linda(sp ~ ., data = crabs, method = method) Prior Probabilities of Groups: B O 0.5 0.5 Group means: sexM index FL RW CL CW BD B 0 25.5 13.270 12.138 28.102 32.624 11.816 O 1 25.5 16.626 12.262 33.688 37.188 15.324 Within-groups Covariance Matrix: sexM index FL RW CL CW BD sexM 1.5255e-07 0.000 0.0000 0.0000 0.000 0.000 0.000 index 0.0000e+00 337.501 62.8107 46.5073 137.713 154.451 63.514 FL 0.0000e+00 62.811 15.3164 9.8612 29.911 33.479 13.805 RW 0.0000e+00 46.507 9.8612 8.6949 21.878 24.604 10.092 CL 0.0000e+00 137.713 29.9112 21.8779 73.888 73.891 30.486 CW 0.0000e+00 154.451 33.4788 24.6038 73.891 92.801 34.122 BD 0.0000e+00 63.514 13.8053 10.0923 30.486 34.122 15.854 Linear Coeficients: sexM index FL RW CL CW BD B 0 -0.64890 0.95529 2.7299 0.20747 0.28549 -0.23815 O 6555120 -0.83294 1.67920 1.8896 0.32330 0.23479 0.51136 Constants: B O -2.1491e+01 -3.2776e+06 Apparent error rate 0.5 Classification table Predicted Actual B O B 50 50 O 50 50 Confusion matrix Predicted Actual B O B 0.5 0.5 O 0.5 0.5 Data: fish Call: Linda(Species ~ ., data = fish, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 5 6 7 0.215190 0.037975 0.126582 0.069620 0.088608 0.107595 0.354430 Group means: Weight Length1 Length2 Length3 Height Width 1 591.024 30.005 32.749 37.938 15.1797 5.2172 2 421.653 26.601 29.097 32.004 9.4581 5.2858 3 124.071 19.976 21.557 24.080 6.2996 3.5111 4 122.562 18.889 20.596 23.145 9.2898 3.0958 5 -12.425 10.626 11.187 12.424 1.9996 1.1540 6 487.575 39.404 41.928 44.920 6.6346 4.3744 7 183.595 22.083 24.069 25.528 6.4907 3.9123 Within-groups Covariance Matrix: Weight Length1 Length2 Length3 Height Width Weight 7021.920 177.0032 185.0010 190.9862 58.39791 30.69782 Length1 177.003 8.8556 7.9392 8.2293 2.15028 1.18984 Length2 185.001 7.9392 9.6269 8.5715 2.25648 1.24249 Length3 190.986 8.2293 8.5715 10.4566 2.35952 1.29491 Height 58.398 2.1503 2.2565 2.3595 0.97108 0.34335 Width 30.698 1.1898 1.2425 1.2949 0.34335 0.27910 Linear Coeficients: Weight Length1 Length2 Length3 Height Width 1 -0.110611 -1.28881 -0.31778 1.9242 19.4737 4.8834 2 -0.106313 -0.38220 0.59314 1.4971 6.9843 14.0826 3 -0.137209 0.31728 0.83616 1.6815 4.9135 8.7503 4 -0.156884 -0.22387 0.35526 1.1772 14.0539 4.9689 5 -0.078642 0.87330 0.95699 1.3532 -0.2385 -1.1836 6 -0.086181 2.71710 3.38858 4.0720 -8.0594 -10.4936 7 -0.129742 0.49725 1.24860 1.3288 3.8019 9.7672 Constants: 1 2 3 4 5 6 7 -141.352 -78.607 -56.819 -81.189 -20.389 -147.558 -58.049 Apparent error rate 0.2532 Classification table Predicted Actual 1 2 3 4 5 6 7 1 33 0 0 1 0 0 0 2 0 3 0 0 0 0 3 3 0 2 5 0 0 0 13 4 0 0 0 11 0 0 0 5 0 0 0 0 14 0 0 6 0 0 0 0 0 17 0 7 0 19 0 0 2 0 35 Confusion matrix Predicted Actual 1 2 3 4 5 6 7 1 0.971 0.000 0.00 0.029 0.000 0 0.000 2 0.000 0.500 0.00 0.000 0.000 0 0.500 3 0.000 0.100 0.25 0.000 0.000 0 0.650 4 0.000 0.000 0.00 1.000 0.000 0 0.000 5 0.000 0.000 0.00 0.000 1.000 0 0.000 6 0.000 0.000 0.00 0.000 0.000 1 0.000 7 0.000 0.339 0.00 0.000 0.036 0 0.625 Data: pottery Call: Linda(origin ~ ., data = pottery, method = method) Prior Probabilities of Groups: Attic Eritrean 0.48148 0.51852 Group means: SI AL FE MG CA TI Attic 55.872 13.986 10.113 5.0235 4.7316 0.88531 Eritrean 52.487 16.286 9.499 2.4520 5.3745 0.83959 Within-groups Covariance Matrix: SI AL FE MG CA TI SI 12.795913 3.2987125 -0.35496855 0.9399999 -0.0143514 0.01132392 AL 3.298713 1.0829436 -0.03394751 0.2838724 0.0501000 0.00117721 FE -0.354969 -0.0339475 0.08078156 0.0341568 -0.0457411 0.00043177 MG 0.940000 0.2838724 0.03415675 0.4350013 0.1417876 0.00396576 CA -0.014351 0.0501000 -0.04574114 0.1417876 0.4196628 -0.00104893 TI 0.011324 0.0011772 0.00043177 0.0039658 -0.0010489 0.00026205 Linear Coeficients: SI AL FE MG CA TI Attic 36.451 -63.784 352.90 -124.07 110.08 3826.6 Eritrean 29.763 -41.039 325.12 -128.32 107.36 3938.1 Constants: Attic Eritrean -4000.1 -3776.1 Apparent error rate 0.1111 Classification table Predicted Actual Attic Eritrean Attic 12 1 Eritrean 2 12 Confusion matrix Predicted Actual Attic Eritrean Attic 0.923 0.077 Eritrean 0.143 0.857 Data: olitos Call: Linda(grp ~ ., data = olitos, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 0.416667 0.208333 0.283333 0.091667 Group means: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 0.57848 61.931 0.13613 0.0080943 12.266 0.79998 2.3538 6.4229 0.73425 0.51653 2 0.41271 61.712 0.15321 0.0085444 12.481 0.78179 2.1069 6.1355 0.62067 0.39948 3 0.76587 61.890 0.18058 0.0111634 13.704 1.07124 2.1687 7.1978 0.62366 0.43460 4 1.50953 61.549 0.16553 0.0125930 13.033 0.93800 2.0928 6.8736 0.81927 0.61150 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 0.44425 239.60 3.3012 0.97354 89.669 95.628 2.0787 15.485 26.808 40.526 2 0.35371 258.98 3.3113 0.88000 91.936 95.794 3.4611 10.565 22.829 47.964 3 0.37614 246.55 2.9909 1.04678 89.533 95.893 3.3628 16.463 31.488 37.225 4 0.53457 271.90 3.2722 1.57500 89.531 95.127 1.9444 12.591 24.918 43.417 X21 X22 X23 X24 X25 1 17.049 67.055 0.24789 1.62677 83.307 2 18.598 54.067 0.35896 0.14332 74.757 3 14.776 54.647 0.12642 3.07548 83.215 4 19.034 59.061 0.15475 7.78631 85.475 Within-groups Covariance Matrix: X1 X2 X3 X4 X5 X6 X1 0.07026643 2.9284e-03 1.2919e-03 1.3476e-04 -3.8439e-02 -3.5355e-03 X2 0.00292844 3.6549e-02 6.7508e-04 -6.1733e-05 6.3577e-04 3.0376e-03 X3 0.00129186 6.7508e-04 8.4730e-04 3.7256e-05 -4.4628e-03 4.0193e-05 X4 0.00013476 -6.1733e-05 3.7256e-05 1.4259e-05 -1.2395e-03 2.4965e-05 X5 -0.03843914 6.3577e-04 -4.4628e-03 -1.2395e-03 5.8239e-01 2.5651e-02 X6 -0.00353547 3.0376e-03 4.0193e-05 2.4965e-05 2.5651e-02 1.0992e-02 X7 0.00295072 3.8053e-03 -7.2169e-04 -1.5508e-04 1.6478e-02 -1.5194e-03 X8 0.00283960 8.9169e-03 5.4856e-03 -7.9035e-04 1.4644e-01 -7.4050e-03 X9 0.00244694 -1.8112e-03 -9.4468e-04 -2.4174e-04 2.9039e-02 -3.8780e-03 X10 0.00290299 9.4062e-04 -8.5175e-04 -1.7682e-04 8.4395e-03 -1.6380e-03 X11 -0.00091611 1.1171e-03 -5.7218e-04 -1.2099e-04 -7.7390e-03 -3.3685e-03 X12 0.58429553 -5.4768e-01 2.5298e-01 4.5444e-02 -1.0894e+01 -1.1460e-01 X13 -0.00833286 -9.3956e-04 -5.5959e-04 -2.4798e-04 4.9798e-02 4.0008e-03 X14 0.04805180 6.5173e-03 -7.4565e-05 1.8539e-04 -2.9817e-02 1.3576e-03 X15 0.04572154 -2.8174e-02 -2.9003e-03 -6.2952e-04 1.4268e-01 -3.6566e-02 X16 -0.03658370 -6.1189e-03 -1.9759e-04 -1.7575e-04 2.6851e-02 -7.6461e-03 X17 0.03805157 -7.0554e-03 6.4130e-03 3.4303e-04 5.2033e-02 -1.0451e-02 X18 0.39218833 6.2615e-03 1.6451e-02 1.9191e-03 -9.0412e-01 -6.7846e-02 X19 0.05426436 -3.6340e-03 -6.2620e-03 -4.9357e-03 1.3242e+00 7.6692e-02 X20 -0.30408813 -3.9107e-02 1.3762e-02 4.4475e-03 -5.1457e-01 -7.4021e-02 X21 -0.10811309 2.6891e-02 -2.3111e-02 -1.2136e-03 3.0975e-02 5.2871e-02 X22 0.09001377 1.2997e-01 -4.2299e-02 5.2076e-03 -3.0387e+00 1.0615e-01 X23 -0.00761313 -1.4307e-02 8.3945e-04 -2.3034e-04 2.1582e-02 5.2286e-03 X24 0.13591519 1.3978e-02 5.6393e-03 9.4096e-04 -1.2509e-01 -3.2760e-02 X25 0.31404705 -1.0808e-01 -1.3938e-02 4.8760e-03 -1.3501e+00 -8.5281e-02 X7 X8 X9 X10 X11 X12 X1 0.00295072 0.00283960 0.00244694 0.00290299 -0.00091611 0.584296 X2 0.00380528 0.00891694 -0.00181117 0.00094062 0.00111715 -0.547680 X3 -0.00072169 0.00548559 -0.00094468 -0.00085175 -0.00057218 0.252982 X4 -0.00015508 -0.00079035 -0.00024174 -0.00017682 -0.00012099 0.045444 X5 0.01647814 0.14644485 0.02903909 0.00843948 -0.00773898 -10.893614 X6 -0.00151939 -0.00740505 -0.00387802 -0.00163802 -0.00336853 -0.114599 X7 0.01695204 0.00253165 0.00632792 0.00640651 0.00446549 -1.035402 X8 0.00253165 0.38285298 0.02882781 -0.00030976 -0.00654781 -3.332953 X9 0.00632792 0.02882781 0.02240626 0.00881582 0.00632909 -1.452543 X10 0.00640651 -0.00030976 0.00881582 0.01369050 0.00811528 -0.361155 X11 0.00446549 -0.00654781 0.00632909 0.00811528 0.01456446 -0.167014 X12 -1.03540231 -3.33295326 -1.45254268 -0.36115513 -0.16701360 689.274282 X13 0.00689350 0.00542624 0.00404233 0.00414138 0.00041255 -2.924782 X14 0.00621576 -0.05229536 0.00142731 0.00082734 -0.00452817 0.341211 X15 0.02466410 0.06811830 0.07848539 0.01871338 0.03135574 -5.726635 X16 -0.00801723 0.05383160 0.00733279 0.00047709 0.01068577 1.918601 X17 -0.01502768 0.09494255 -0.01530594 -0.02579079 -0.01787611 1.678793 X18 0.00319394 0.03511581 0.04608812 0.00930804 0.03049907 25.936956 X19 0.06954050 0.66370101 0.10250938 0.04587327 0.02537178 -19.790264 X20 -0.05734134 -0.36252643 -0.05842137 -0.04140852 0.00891549 13.263963 X21 -0.00443007 -0.35306087 -0.07758298 -0.00475145 -0.04847910 -15.502539 X22 -0.09079409 -2.04886495 -0.13676322 0.00408904 0.00333079 21.482628 X23 -0.00546682 0.02999962 -0.00014424 -0.00203100 -0.00358038 -2.076408 X24 0.00915803 -0.04631992 -0.01726963 0.04453148 0.02002928 12.389094 X25 0.06458498 -0.82093402 0.00524037 0.03127067 -0.10902905 28.428140 X13 X14 X15 X16 X17 X18 X1 -0.00833286 4.8052e-02 0.04572154 -0.03658370 0.03805157 0.3921883 X2 -0.00093956 6.5173e-03 -0.02817364 -0.00611893 -0.00705538 0.0062615 X3 -0.00055959 -7.4565e-05 -0.00290027 -0.00019759 0.00641298 0.0164505 X4 -0.00024798 1.8539e-04 -0.00062952 -0.00017575 0.00034303 0.0019191 X5 0.04979790 -2.9817e-02 0.14268105 0.02685101 0.05203277 -0.9041211 X6 0.00400079 1.3576e-03 -0.03656605 -0.00764608 -0.01045057 -0.0678461 X7 0.00689350 6.2158e-03 0.02466410 -0.00801723 -0.01502768 0.0031939 X8 0.00542624 -5.2295e-02 0.06811830 0.05383160 0.09494255 0.0351158 X9 0.00404233 1.4273e-03 0.07848539 0.00733279 -0.01530594 0.0460881 X10 0.00414138 8.2734e-04 0.01871338 0.00047709 -0.02579079 0.0093080 X11 0.00041255 -4.5282e-03 0.03135574 0.01068577 -0.01787611 0.0304991 X12 -2.92478158 3.4121e-01 -5.72663473 1.91860092 1.67879350 25.9369562 X13 0.09908088 -1.8617e-02 -0.13543555 -0.08706918 0.00944870 -0.3892263 X14 -0.01861681 9.4223e-02 0.01207116 -0.05453281 -0.01519205 0.3535993 X15 -0.13543555 1.2071e-02 2.08454277 0.29655848 0.32606490 1.6484168 X16 -0.08706918 -5.4533e-02 0.29655848 0.22083608 0.06069037 0.2261266 X17 0.00944870 -1.5192e-02 0.32606490 0.06069037 0.88775362 0.4522207 X18 -0.38922628 3.5360e-01 1.64841683 0.22612662 0.45222070 10.4713538 X19 0.04326037 -8.2725e-03 0.94607953 0.17250537 0.95458304 2.6822507 X20 0.00272135 -2.9863e-01 -1.16979571 0.20852467 -0.60386264 -6.9263518 X21 0.28093392 -1.3563e-02 -1.04259061 -0.48624333 -0.67626710 -4.4006632 X22 0.04371283 4.5321e-01 -2.16057206 -0.79996996 -3.91936562 4.9565736 X23 0.02760512 -2.3806e-02 0.05880522 -0.01804190 0.05015312 0.0269735 X24 0.05697178 8.1769e-02 0.14261149 -0.22939011 0.03628105 0.7701978 X25 -0.82089435 6.9160e-01 0.07352628 0.13351475 -1.89861638 7.1687089 X19 X20 X21 X22 X23 X24 X1 0.0542644 -0.3040881 -0.1081131 0.0900138 -0.00761313 0.13591519 X2 -0.0036340 -0.0391066 0.0268914 0.1299713 -0.01430732 0.01397844 X3 -0.0062620 0.0137618 -0.0231109 -0.0422988 0.00083945 0.00563934 X4 -0.0049357 0.0044475 -0.0012136 0.0052076 -0.00023034 0.00094096 X5 1.3241996 -0.5145715 0.0309752 -3.0386542 0.02158221 -0.12508773 X6 0.0766920 -0.0740215 0.0528713 0.1061510 0.00522861 -0.03276002 X7 0.0695405 -0.0573413 -0.0044301 -0.0907941 -0.00546682 0.00915803 X8 0.6637010 -0.3625264 -0.3530609 -2.0488649 0.02999962 -0.04631992 X9 0.1025094 -0.0584214 -0.0775830 -0.1367632 -0.00014424 -0.01726963 X10 0.0458733 -0.0414085 -0.0047514 0.0040890 -0.00203100 0.04453148 X11 0.0253718 0.0089155 -0.0484791 0.0033308 -0.00358038 0.02002928 X12 -19.7902637 13.2639629 -15.5025392 21.4826279 -2.07640767 12.38909430 X13 0.0432604 0.0027213 0.2809339 0.0437128 0.02760512 0.05697178 X14 -0.0082725 -0.2986295 -0.0135628 0.4532089 -0.02380556 0.08176911 X15 0.9460795 -1.1697957 -1.0425906 -2.1605721 0.05880522 0.14261149 X16 0.1725054 0.2085247 -0.4862433 -0.7999700 -0.01804190 -0.22939011 X17 0.9545830 -0.6038626 -0.6762671 -3.9193656 0.05015312 0.03628105 X18 2.6822507 -6.9263518 -4.4006632 4.9565736 0.02697346 0.77019784 X19 14.8579414 -11.8541120 -3.6895829 -11.8840576 0.49735330 0.01268716 X20 -11.8541120 20.8729303 -0.7401364 -2.8422653 -0.75267097 -0.64317299 X21 -3.6895829 -0.7401364 8.9371606 9.4530745 0.22554362 -0.00364040 X22 -11.8840576 -2.8422653 9.4530745 86.4457994 0.46878911 -5.55596815 X23 0.4973533 -0.7526710 0.2255436 0.4687891 0.17338427 -0.15581540 X24 0.0126872 -0.6431730 -0.0036404 -5.5559681 -0.15581540 4.81128515 X25 -9.4946373 4.5516053 -2.2135389 14.7807456 -0.99001453 0.37871730 X25 X1 0.3140470 X2 -0.1080785 X3 -0.0139383 X4 0.0048760 X5 -1.3500531 X6 -0.0852815 X7 0.0645850 X8 -0.8209340 X9 0.0052404 X10 0.0312707 X11 -0.1090291 X12 28.4281395 X13 -0.8208944 X14 0.6916019 X15 0.0735263 X16 0.1335148 X17 -1.8986164 X18 7.1687089 X19 -9.4946373 X20 4.5516053 X21 -2.2135389 X22 14.7807456 X23 -0.9900145 X24 0.3787173 X25 50.2533098 Linear Coeficients: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 573.13 2468.2 -3379.4 49561 -45.199 -847.37 -157.11 -34.826 233.53 -576.80 2 571.33 2466.2 -3367.5 49153 -45.272 -848.95 -173.89 -35.290 226.18 -572.51 3 575.18 2462.3 -3340.7 49755 -42.298 -819.14 -165.34 -32.634 231.53 -576.78 4 590.25 2457.2 -3380.4 49895 -42.380 -825.02 -176.70 -30.494 240.59 -582.13 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 -546.64 5.7635 1942.9 896.61 0.95013 1690.3 -174.73 -42.305 24.935 1.4662 2 -548.95 5.8500 1944.7 900.72 3.79510 1686.3 -174.61 -42.693 24.825 1.7814 3 -531.83 5.7329 1937.4 896.08 0.39263 1689.9 -172.75 -42.195 24.887 1.4270 4 -515.52 5.8465 1943.8 903.98 1.18144 1692.2 -174.52 -43.452 25.033 1.7620 X21 X22 X23 X24 X25 1 26.117 -12.001 523.28 9.6027 24.342 2 26.381 -12.216 523.15 8.6470 24.244 3 26.221 -11.937 521.44 10.1353 24.447 4 26.538 -11.913 525.80 10.7363 24.560 Constants: 1 2 3 4 -161427 -161153 -161045 -161095 Apparent error rate 0.125 Classification table Predicted Actual 1 2 3 4 1 44 2 3 1 2 1 23 1 0 3 4 1 27 2 4 0 0 0 11 Confusion matrix Predicted Actual 1 2 3 4 1 0.880 0.040 0.060 0.020 2 0.040 0.920 0.040 0.000 3 0.118 0.029 0.794 0.059 4 0.000 0.000 0.000 1.000 =================================================== > dodata(method="ogk") Call: dodata(method = "ogk") =================================================== Data: hemophilia Call: Linda(as.factor(gr) ~ ., data = hemophilia, method = method) Prior Probabilities of Groups: carrier normal 0.6 0.4 Group means: AHFactivity AHFantigen carrier -0.29043 -0.00052902 normal -0.12463 -0.06715037 Within-groups Covariance Matrix: AHFactivity AHFantigen AHFactivity 0.015688 0.010544 AHFantigen 0.010544 0.016633 Linear Coeficients: AHFactivity AHFantigen carrier -32.2203 20.3935 normal -9.1149 1.7409 Constants: carrier normal -5.1843 -1.4259 Apparent error rate 0.1467 Classification table Predicted Actual carrier normal carrier 38 7 normal 4 26 Confusion matrix Predicted Actual carrier normal carrier 0.844 0.156 normal 0.133 0.867 Data: anorexia Call: Linda(Treat ~ ., data = anorexia, method = method) Prior Probabilities of Groups: CBT Cont FT 0.40278 0.36111 0.23611 Group means: Prewt Postwt CBT 82.634 82.060 Cont 81.605 80.459 FT 85.157 93.822 Within-groups Covariance Matrix: Prewt Postwt Prewt 15.8294 4.4663 Postwt 4.4663 19.6356 Linear Coeficients: Prewt Postwt CBT 4.3183 3.1970 Cont 4.2734 3.1256 FT 4.3080 3.7983 Constants: CBT Cont FT -310.50 -301.12 -363.05 Apparent error rate 0.4583 Classification table Predicted Actual CBT Cont FT CBT 15 5 9 Cont 14 11 1 FT 0 4 13 Confusion matrix Predicted Actual CBT Cont FT CBT 0.517 0.172 0.310 Cont 0.538 0.423 0.038 FT 0.000 0.235 0.765 Data: Pima Call: Linda(type ~ ., data = Pima.tr, method = method) Prior Probabilities of Groups: No Yes 0.66 0.34 Group means: npreg glu bp skin bmi ped age No 2.4175 109.93 67.332 26.324 30.344 0.38740 26.267 Yes 5.1853 142.29 75.194 33.151 34.878 0.47977 37.626 Within-groups Covariance Matrix: npreg glu bp skin bmi ped age npreg 7.218576 7.52457 6.96595 4.86613 0.45567 -0.054245 14.42648 glu 7.524571 517.38370 58.53812 31.57321 22.68396 -0.200222 22.88780 bp 6.965950 58.53812 101.50317 27.86784 10.89215 -0.152784 25.41819 skin 4.866127 31.57321 27.86784 95.16949 37.45066 -0.117375 14.60676 bmi 0.455675 22.68396 10.89215 37.45066 30.89491 0.043400 4.05584 ped -0.054245 -0.20022 -0.15278 -0.11737 0.04340 0.051268 -0.18131 age 14.426479 22.88780 25.41819 14.60676 4.05584 -0.181311 57.89570 Linear Coeficients: npreg glu bp skin bmi ped age No -0.99043 0.12339 0.54101 -0.35335 1.0721 8.4945 0.45482 Yes -1.01369 0.17577 0.53898 -0.35554 1.1563 11.0474 0.63966 Constants: No Yes -43.449 -60.176 Apparent error rate 0.23 Classification table Predicted Actual No Yes No 108 24 Yes 22 46 Confusion matrix Predicted Actual No Yes No 0.818 0.182 Yes 0.324 0.676 Data: Forest soils Call: Linda(F ~ ., data = soil1983, method = method) Prior Probabilities of Groups: 1 2 3 0.18966 0.39655 0.41379 Group means: Al Ca Mg K Na 1 108.44 9.4222 2.0253 4.9449 2.12259 2 116.62 11.6676 2.5472 8.0291 0.90617 3 152.37 21.3165 2.4082 9.1044 1.26106 Within-groups Covariance Matrix: Al Ca Mg K Na Al 3457.444 288.7174 46.58105 143.46734 30.38338 Ca 288.717 49.3144 4.15531 14.27911 1.36330 Mg 46.581 4.1553 0.84148 2.43501 0.42092 K 143.467 14.2791 2.43501 8.46015 0.94133 Na 30.383 1.3633 0.42092 0.94133 0.98376 Linear Coeficients: Al Ca Mg K Na 1 -0.018827 0.085421 3.3014 -0.36380 1.556268 2 -0.034441 -0.015588 2.8924 0.71779 0.082066 3 -0.018761 0.283078 -1.9584 1.36929 0.996724 Constants: 1 2 3 -5.1395 -5.4282 -6.9739 Apparent error rate 0.3621 Classification table Predicted Actual 1 2 3 1 7 3 1 2 4 13 6 3 3 4 17 Confusion matrix Predicted Actual 1 2 3 1 0.636 0.273 0.091 2 0.174 0.565 0.261 3 0.125 0.167 0.708 Data: Raven and Miller diabetes data Call: Linda(group ~ insulin + glucose + sspg, data = diabetes, method = method) Prior Probabilities of Groups: normal chemical overt 0.52414 0.24828 0.22759 Group means: insulin glucose sspg normal 159.540 344.06 99.486 chemical 252.992 478.16 219.442 overt 79.635 1094.96 338.517 Within-groups Covariance Matrix: insulin glucose sspg insulin 3844.877 67.238 1456.55 glucose 67.238 2228.396 324.21 sspg 1456.548 324.205 2181.73 Linear Coeficients: insulin glucose sspg normal 0.040407 0.15379 -0.0042303 chemical 0.047858 0.20764 0.0377766 overt -0.026158 0.47736 0.1016873 Constants: normal chemical overt -30.115 -61.233 -278.996 Apparent error rate 0.0966 Classification table Predicted Actual normal chemical overt normal 71 5 0 chemical 2 34 0 overt 0 7 26 Confusion matrix Predicted Actual normal chemical overt normal 0.934 0.066 0.000 chemical 0.056 0.944 0.000 overt 0.000 0.212 0.788 Data: iris Call: Linda(Species ~ ., data = iris, method = method, l1med = TRUE) Prior Probabilities of Groups: setosa versicolor virginica 0.33333 0.33333 0.33333 Group means: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 4.9654 3.3913 1.4507 0.21639 versicolor 5.8767 2.7909 4.2238 1.34189 virginica 6.5075 2.9777 5.4459 2.05921 Within-groups Covariance Matrix: Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 0.180280 0.068876 0.101512 0.036096 Sepal.Width 0.068876 0.079556 0.047722 0.029409 Petal.Length 0.101512 0.047722 0.111492 0.038658 Petal.Width 0.036096 0.029409 0.038658 0.029965 Linear Coeficients: Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 28.582 46.5236 -13.859 -54.9877 versicolor 19.837 11.9601 20.865 -17.7704 virginica 16.999 1.9046 29.808 7.9189 Constants: setosa versicolor virginica -134.94 -108.22 -148.56 Apparent error rate 0.0133 Classification table Predicted Actual setosa versicolor virginica setosa 50 0 0 versicolor 0 49 1 virginica 0 1 49 Confusion matrix Predicted Actual setosa versicolor virginica setosa 1 0.00 0.00 versicolor 0 0.98 0.02 virginica 0 0.02 0.98 Data: crabs Call: Linda(sp ~ ., data = crabs, method = method) Prior Probabilities of Groups: B O 0.5 0.5 Group means: sexM index FL RW CL CW BD B 0.48948 24.060 13.801 11.738 29.491 34.062 12.329 O 0.56236 24.043 16.825 13.158 33.574 37.418 15.223 Within-groups Covariance Matrix: sexM index FL RW CL CW BD sexM 0.24961 0.50421 0.16645 -0.28574 0.54159 0.48449 0.22563 index 0.50421 186.86616 38.46284 25.26749 82.29121 92.11253 37.67723 FL 0.16645 38.46284 8.58830 5.56769 18.33015 20.58235 8.32030 RW -0.28574 25.26749 5.56769 4.52038 11.70881 13.37643 5.32779 CL 0.54159 82.29121 18.33015 11.70881 39.78186 44.52112 18.01179 CW 0.48449 92.11253 20.58235 13.37643 44.52112 50.06150 20.16852 BD 0.22563 37.67723 8.32030 5.32779 18.01179 20.16852 8.25884 Linear Coeficients: sexM index FL RW CL CW BD B 16.497 -2.5896 8.3966 11.518 1.7536 -2.5325 -0.67361 O 17.010 -4.0452 23.5400 13.702 4.7871 -14.8264 13.04556 Constants: B O -77.695 -147.287 Apparent error rate 0 Classification table Predicted Actual B O B 100 0 O 0 100 Confusion matrix Predicted Actual B O B 1 0 O 0 1 Data: fish Call: Linda(Species ~ ., data = fish, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 5 6 7 0.215190 0.037975 0.126582 0.069620 0.088608 0.107595 0.354430 Group means: Weight Length1 Length2 Length3 Height Width 1 604.09773 30.037 32.797 37.989 15.1981 5.2843 2 434.72736 26.633 29.145 32.055 9.4765 5.3528 3 137.14510 20.008 21.605 24.131 6.3181 3.5781 4 135.63586 18.921 20.644 23.196 9.3083 3.1628 5 0.64897 10.658 11.235 12.475 2.0180 1.2210 6 500.64921 39.436 41.976 44.971 6.6530 4.4415 7 196.66853 22.115 24.117 25.579 6.5092 3.9793 Within-groups Covariance Matrix: Weight Length1 Length2 Length3 Height Width Weight 14221.727 349.8353 371.8026 397.1191 140.25559 71.62696 Length1 349.835 11.1615 11.8294 12.5746 4.02800 2.10646 Length2 371.803 11.8294 12.5752 13.3701 4.30843 2.24877 Length3 397.119 12.5746 13.3701 14.2710 4.61999 2.40091 Height 140.256 4.0280 4.3084 4.6200 1.71309 0.81013 Width 71.627 2.1065 2.2488 2.4009 0.81013 0.46889 Linear Coeficients: Weight Length1 Length2 Length3 Height Width 1 -0.201933 -8.25890 -41.35965 49.9172 20.92722 -14.1765 2 -0.154022 -19.63121 0.30591 22.4222 -0.99062 8.5696 3 -0.173978 -6.36037 -15.28433 25.9220 -0.90874 4.9226 4 -0.228442 0.49431 -15.74204 16.6223 19.91038 -4.5945 5 -0.083215 -1.10063 -10.71731 16.7346 -5.27024 -4.9222 6 -0.068646 -31.04688 13.48390 35.5823 -32.92237 -30.5472 7 -0.164017 -15.98384 17.43554 3.6729 -1.78311 6.0019 Constants: 1 2 3 4 5 6 7 -207.998 -90.447 -80.095 -107.543 -32.384 -278.597 -71.533 Apparent error rate 0.0063 Classification table Predicted Actual 1 2 3 4 5 6 7 1 34 0 0 0 0 0 0 2 0 6 0 0 0 0 0 3 0 0 20 0 0 0 0 4 0 0 0 11 0 0 0 5 0 0 0 0 14 0 0 6 0 0 0 0 0 17 0 7 0 0 0 0 1 0 55 Confusion matrix Predicted Actual 1 2 3 4 5 6 7 1 1 0 0 0 0.000 0 0.000 2 0 1 0 0 0.000 0 0.000 3 0 0 1 0 0.000 0 0.000 4 0 0 0 1 0.000 0 0.000 5 0 0 0 0 1.000 0 0.000 6 0 0 0 0 0.000 1 0.000 7 0 0 0 0 0.018 0 0.982 Data: pottery Call: Linda(origin ~ ., data = pottery, method = method) Prior Probabilities of Groups: Attic Eritrean 0.48148 0.51852 Group means: SI AL FE MG CA TI Attic 55.381 14.088 10.1316 4.9588 4.7684 0.88444 Eritrean 53.559 16.251 9.1145 2.6213 5.8980 0.82501 Within-groups Covariance Matrix: SI AL FE MG CA TI SI 7.878378 1.9064112 -0.545403 0.4167407 -0.11589 0.01850748 AL 1.906411 0.6678763 -0.037744 0.1120891 -0.10733 0.00805556 FE -0.545403 -0.0377438 0.213914 -0.0192356 -0.23121 0.00582800 MG 0.416741 0.1120891 -0.019236 0.2336721 0.17284 -0.00183128 CA -0.115888 -0.1073297 -0.231213 0.1728385 0.71388 -0.01895968 TI 0.018507 0.0080556 0.005828 -0.0018313 -0.01896 0.00081815 Linear Coeficients: SI AL FE MG CA TI Attic 57.784 -107.297 319.31 -152.94 241.66 3813.6 Eritrean 52.523 -86.545 306.58 -165.71 242.36 3734.1 Constants: Attic Eritrean -4346 -4139 Apparent error rate 0.1111 Classification table Predicted Actual Attic Eritrean Attic 12 1 Eritrean 2 12 Confusion matrix Predicted Actual Attic Eritrean Attic 0.923 0.077 Eritrean 0.143 0.857 Data: olitos Call: Linda(grp ~ ., data = olitos, method = method, l1med = TRUE) Prior Probabilities of Groups: 1 2 3 4 0.416667 0.208333 0.283333 0.091667 Group means: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 0.61861 61.922 0.13793 0.0083075 12.253 0.81044 2.3641 6.3750 0.73489 0.52449 2 0.45284 61.703 0.15501 0.0087576 12.468 0.79224 2.1172 6.0876 0.62131 0.40745 3 0.80600 61.881 0.18238 0.0113765 13.691 1.08170 2.1789 7.1500 0.62430 0.44256 4 1.54967 61.540 0.16732 0.0128062 13.020 0.94846 2.1030 6.8258 0.81991 0.61946 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 0.44590 240.69 3.3364 0.95830 89.569 95.571 1.9855 15.559 27.352 39.999 2 0.35536 260.06 3.3465 0.86475 91.836 95.737 3.3679 10.638 23.373 47.437 3 0.37779 247.63 3.0262 1.03154 89.433 95.836 3.2695 16.537 32.031 36.698 4 0.53622 272.98 3.3075 1.55975 89.431 95.070 1.8511 12.665 25.461 42.890 X21 X22 X23 X24 X25 1 16.988 66.652 0.33734 2.20245 82.572 2 18.537 53.664 0.44841 0.71899 74.021 3 14.715 54.244 0.21587 3.65115 82.480 4 18.973 58.658 0.24420 8.36199 84.740 Within-groups Covariance Matrix: X1 X2 X3 X4 X5 X6 X1 0.08518798 -1.1336e-02 1.8674e-03 2.2709e-04 -0.00508315 1.7836e-03 X2 -0.01133553 2.9635e-02 1.8809e-04 -8.2283e-05 -0.01035519 1.4735e-03 X3 0.00186743 1.8809e-04 6.4758e-04 3.3877e-05 -0.00239966 3.8739e-04 X4 0.00022709 -8.2283e-05 3.3877e-05 1.0835e-05 -0.00073837 6.3682e-05 X5 -0.00508315 -1.0355e-02 -2.3997e-03 -7.3837e-04 0.39704593 2.2137e-02 X6 0.00178360 1.4735e-03 3.8739e-04 6.3682e-05 0.02213718 9.9768e-03 X7 0.00645183 2.3590e-03 -3.4285e-04 -1.2447e-04 0.01296102 -5.2697e-04 X8 0.00134749 1.0696e-02 3.7951e-03 -5.0283e-04 0.11513582 -6.6970e-03 X9 0.00102085 -8.8293e-04 -2.8776e-04 -1.2836e-04 0.01691681 -2.4783e-03 X10 0.00419224 -1.1052e-04 -2.4367e-04 -7.0647e-05 0.00124181 -5.6708e-04 X11 0.00056695 2.9419e-04 -1.5733e-04 -6.9493e-05 -0.00646781 -1.8709e-03 X12 0.98807884 -8.2295e-03 2.0612e-01 3.3653e-02 -7.57783847 1.4494e-01 X13 -0.00751626 -6.5848e-04 -3.8564e-04 -1.7521e-04 0.02322166 2.0231e-03 X14 0.04802392 -3.2287e-03 1.0404e-03 2.4042e-04 0.00788301 3.5487e-03 X15 0.03109355 -2.4574e-02 -1.4418e-03 -5.8214e-04 0.10594069 -3.2826e-02 X16 -0.03932736 2.9713e-03 -3.1606e-04 -1.8113e-04 0.00380470 -6.5231e-03 X17 0.03376886 -6.5312e-03 7.0526e-03 4.8600e-04 0.05558135 -6.1967e-03 X18 0.33887744 4.2358e-03 1.2588e-02 1.7861e-03 -0.72572130 -5.9309e-02 X19 0.16316870 -5.3538e-02 -5.7031e-03 -2.4236e-03 0.81149714 5.8455e-02 X20 -0.43482885 2.7970e-02 9.8134e-03 1.6396e-03 -0.22794773 -5.1371e-02 X21 -0.04043629 1.4039e-02 -1.6035e-02 -8.4389e-04 0.10159764 4.5183e-02 X22 0.20048477 -7.2205e-03 -4.7628e-02 1.8697e-03 -1.91088299 1.0407e-01 X23 0.01046549 -2.3270e-02 6.7694e-04 -1.4813e-05 0.01958510 7.3121e-03 X24 -0.00755487 7.9564e-02 8.4759e-03 3.4738e-04 -0.25109569 -1.9427e-02 X25 0.23353447 5.5149e-02 -2.6966e-03 3.5776e-03 -0.86491352 -7.7184e-02 X7 X8 X9 X10 X11 X12 X1 0.00645183 0.00134749 0.00102085 4.1922e-03 5.6695e-04 0.9880788 X2 0.00235903 0.01069573 -0.00088293 -1.1052e-04 2.9419e-04 -0.0082295 X3 -0.00034285 0.00379506 -0.00028776 -2.4367e-04 -1.5733e-04 0.2061199 X4 -0.00012447 -0.00050283 -0.00012836 -7.0647e-05 -6.9493e-05 0.0336530 X5 0.01296102 0.11513582 0.01691681 1.2418e-03 -6.4678e-03 -7.5778385 X6 -0.00052697 -0.00669701 -0.00247827 -5.6708e-04 -1.8709e-03 0.1449407 X7 0.01814906 0.00907264 0.00310316 4.0988e-03 2.4118e-03 -0.9209858 X8 0.00907264 0.31131638 0.02161427 8.4322e-04 -4.1483e-03 -1.6502294 X9 0.00310316 0.02161427 0.01625583 8.3585e-03 4.7558e-03 -0.7464878 X10 0.00409877 0.00084322 0.00835851 1.1715e-02 5.8556e-03 -0.0691263 X11 0.00241178 -0.00414831 0.00475585 5.8556e-03 9.6256e-03 -0.0041453 X12 -0.92098578 -1.65022943 -0.74648785 -6.9126e-02 -4.1453e-03 570.5615105 X13 0.00819946 -0.01310972 -0.00010858 6.4591e-04 -2.8970e-05 -2.3265554 X14 0.00675925 -0.02415322 0.00359022 2.0706e-03 -3.1777e-03 -0.0669957 X15 0.02340544 0.08230609 0.05234856 1.2394e-02 2.2244e-02 -3.6248446 X16 -0.01023067 0.04623564 0.00693304 2.1221e-03 8.3413e-03 1.9642246 X17 0.00406769 0.11928564 0.00248024 -5.4204e-03 -6.5957e-03 0.1671808 X18 0.03486301 -0.03274811 0.03781091 3.1579e-02 2.1337e-02 19.8029175 X19 0.09190512 0.28521726 0.04452677 4.7613e-02 6.8189e-03 -17.2705717 X20 -0.11218479 -0.11319286 -0.00921619 -4.8350e-02 1.4504e-02 9.5705631 X21 -0.00581759 -0.15457742 -0.06484867 -2.4268e-02 -3.2304e-02 -9.5229519 X22 -0.07558756 -1.83978316 -0.22725626 -1.0883e-01 -1.9892e-02 11.7579738 X23 -0.00234028 -0.01278442 -0.00399936 -9.5896e-04 -2.3341e-03 -2.0958393 X24 0.02420392 -0.11698629 0.01408465 4.4690e-02 1.0745e-02 19.4775814 X25 0.10175617 0.09937063 0.06430041 6.3542e-02 -7.3078e-02 23.7635443 X13 X14 X15 X16 X17 X18 X1 -0.00751626 0.04802392 0.03109355 -0.03932736 0.0337689 0.3388774 X2 -0.00065848 -0.00322869 -0.02457409 0.00297128 -0.0065312 0.0042358 X3 -0.00038564 0.00104036 -0.00144177 -0.00031606 0.0070526 0.0125884 X4 -0.00017521 0.00024042 -0.00058214 -0.00018113 0.0004860 0.0017861 X5 0.02322166 0.00788301 0.10594069 0.00380470 0.0555813 -0.7257213 X6 0.00202313 0.00354865 -0.03282645 -0.00652306 -0.0061967 -0.0593089 X7 0.00819946 0.00675925 0.02340544 -0.01023067 0.0040677 0.0348630 X8 -0.01310972 -0.02415322 0.08230609 0.04623564 0.1192856 -0.0327481 X9 -0.00010858 0.00359022 0.05234856 0.00693304 0.0024802 0.0378109 X10 0.00064591 0.00207058 0.01239412 0.00212213 -0.0054204 0.0315791 X11 -0.00002897 -0.00317768 0.02224398 0.00834127 -0.0065957 0.0213373 X12 -2.32655540 -0.06699571 -3.62484459 1.96422459 0.1671808 19.8029175 X13 0.09314139 -0.01371355 -0.13887769 -0.09685275 -0.0251558 -0.2366341 X14 -0.01371355 0.08569274 0.01283184 -0.05366265 0.0319259 0.2587917 X15 -0.13887769 0.01283184 1.52108997 0.28311061 0.3573105 1.0490827 X16 -0.09685275 -0.05366265 0.28311061 0.21816257 0.1218445 0.1481618 X17 -0.02515576 0.03192593 0.35731050 0.12184448 0.9448063 0.5353998 X18 -0.23663407 0.25879166 1.04908269 0.14816176 0.5353998 7.8439689 X19 0.17569895 -0.02016795 0.30797337 -0.09386781 0.6301040 2.4692987 X20 -0.12691476 -0.21229418 -0.39268477 0.35973245 -0.4995288 -6.4558908 X21 0.15130569 -0.00481127 -0.72769612 -0.34443129 -0.5938679 -3.2309755 X22 0.09813539 0.18387313 -1.63040599 -0.81637456 -4.2017148 2.6304812 X23 0.04103544 -0.01460143 -0.00168594 -0.06091978 -0.0388835 0.0045153 X24 -0.01378664 -0.04430127 0.25915406 0.03867848 -0.2721244 0.9671924 X25 -1.04329960 0.61856140 0.45467403 0.66782286 -0.2145114 6.7597399 X19 X20 X21 X22 X23 X24 X1 0.1631687 -0.4348288 -0.04043629 0.2004848 1.0465e-02 -0.00755487 X2 -0.0535377 0.0279702 0.01403923 -0.0072205 -2.3270e-02 0.07956393 X3 -0.0057031 0.0098134 -0.01603514 -0.0476278 6.7694e-04 0.00847590 X4 -0.0024236 0.0016396 -0.00084389 0.0018697 -1.4813e-05 0.00034738 X5 0.8114971 -0.2279477 0.10159764 -1.9108830 1.9585e-02 -0.25109569 X6 0.0584550 -0.0513707 0.04518346 0.1040701 7.3121e-03 -0.01942691 X7 0.0919051 -0.1121848 -0.00581759 -0.0755876 -2.3403e-03 0.02420392 X8 0.2852173 -0.1131929 -0.15457742 -1.8397832 -1.2784e-02 -0.11698629 X9 0.0445268 -0.0092162 -0.06484867 -0.2272563 -3.9994e-03 0.01408465 X10 0.0476128 -0.0483499 -0.02426789 -0.1088311 -9.5896e-04 0.04469024 X11 0.0068189 0.0145040 -0.03230423 -0.0198919 -2.3341e-03 0.01074503 X12 -17.2705717 9.5705631 -9.52295189 11.7579738 -2.0958e+00 19.47758137 X13 0.1756990 -0.1269148 0.15130569 0.0981354 4.1035e-02 -0.01378664 X14 -0.0201679 -0.2122942 -0.00481127 0.1838731 -1.4601e-02 -0.04430127 X15 0.3079734 -0.3926848 -0.72769612 -1.6304060 -1.6859e-03 0.25915406 X16 -0.0938678 0.3597325 -0.34443129 -0.8163746 -6.0920e-02 0.03867848 X17 0.6301040 -0.4995288 -0.59386792 -4.2017148 -3.8884e-02 -0.27212444 X18 2.4692987 -6.4558908 -3.23097548 2.6304812 4.5153e-03 0.96719243 X19 11.3335349 -10.6900683 -2.62969087 -7.1987020 5.8698e-01 -0.71619389 X20 -10.6900683 17.1971342 -0.32452420 -3.1859349 -7.3744e-01 0.51118300 X21 -2.6296909 -0.3245242 5.79856806 7.5319093 1.5327e-01 -0.62724807 X22 -7.1987020 -3.1859349 7.53190932 70.4210395 6.9185e-01 -6.76366912 X23 0.5869839 -0.7374410 0.15327429 0.6918465 1.8584e-01 -0.15067380 X24 -0.7161939 0.5111830 -0.62724807 -6.7636691 -1.5067e-01 8.72169417 X25 -9.1898756 3.5870282 -1.22416518 1.6412777 -1.4256e+00 2.62754282 X25 X1 0.2335345 X2 0.0551491 X3 -0.0026966 X4 0.0035776 X5 -0.8649135 X6 -0.0771842 X7 0.1017562 X8 0.0993706 X9 0.0643004 X10 0.0635419 X11 -0.0730776 X12 23.7635443 X13 -1.0432996 X14 0.6185614 X15 0.4546740 X16 0.6678229 X17 -0.2145114 X18 6.7597399 X19 -9.1898756 X20 3.5870282 X21 -1.2241652 X22 1.6412777 X23 -1.4256286 X24 2.6275428 X25 50.8855054 Linear Coeficients: X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 1498.0 4402.6 -6826.0 127426 -258.07 -3473.5 -417.32 112.62 -327.36 -902.14 2 1497.4 4399.3 -6801.1 126789 -260.43 -3466.3 -431.65 110.50 -337.72 -897.08 3 1495.3 4393.9 -6783.0 127335 -252.66 -3443.6 -431.44 114.83 -341.34 -896.91 4 1510.0 4393.0 -6876.3 127712 -260.25 -3459.7 -447.69 119.28 -333.59 -904.22 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 1 -1141.5 12.148 5241.2 3739.2 18.044 4540.9 -623.42 -277.71 11.665 -78.251 2 -1153.3 12.243 5244.3 3740.1 22.054 4536.6 -623.40 -277.80 12.194 -77.450 3 -1129.8 12.071 5227.7 3728.4 17.679 4530.3 -621.44 -275.33 12.569 -77.085 4 -1112.8 12.185 5252.8 3751.9 19.393 4544.4 -623.75 -279.31 12.583 -77.918 X21 X22 X23 X24 X25 1 -36.679 -25.206 1414.3 -60.244 52.642 2 -35.698 -25.592 1414.6 -60.949 52.684 3 -35.707 -25.128 1408.8 -59.731 52.510 4 -36.436 -25.103 1413.4 -59.126 52.986 Constants: 1 2 3 4 -359903 -359646 -358448 -359870 Apparent error rate 0.1 Classification table Predicted Actual 1 2 3 4 1 45 2 2 1 2 0 25 0 0 3 4 1 27 2 4 0 0 0 11 Confusion matrix Predicted Actual 1 2 3 4 1 0.900 0.040 0.040 0.020 2 0.000 1.000 0.000 0.000 3 0.118 0.029 0.794 0.059 4 0.000 0.000 0.000 1.000 =================================================== > #dodata(method="fsa") > > proc.time() user system elapsed 4.39 0.78 5.38 rrcov/src/0000755000176200001440000000000013607365244012206 5ustar liggesusersrrcov/src/fsada.f0000644000176200001440000003575113373055220013434 0ustar liggesusers SUBROUTINE FSADA(X,NE,NV,NG,IGRP,XM,XC,XND, 1 IHALF,NIT,IDSAV,MRAND,IERR,DETC,ITRACE) IMPLICIT DOUBLEPRECISION (A-H,O-Z) C...Default number of iterations to be performed(if NIT=0) PARAMETER (ITK0=500) DIMENSION X(NV,NE), IGRP(NE) DIMENSION XM(NV,NG), XC(NV,NV), XND(NG) DIMENSION ave(NV,NG),cov(NV,NV), 1 datimg(NV,NE),ustu(NE),ibasis(NE), 3 isin(NE),wtv(NG),cinv(NV,NV), 4 IDSAV(NE) C...Set the default number of iterations if not supplied IF(NIT.EQ.0) NIT=ITK0 if(ITRACE .ge. 2) then CALL INTPR('Entering FSADA - NIT: ',-1,NIT,1) endif C...Set the coverage for max breakdown point, if not supplied IF(IHALF.LE.0) IHALF = (NE+NV+1)/2 call reader(X,NE,NV,NG,ave,cov,cinv,datimg,wtv,ustu,DETC, 2 IGRP,ibasis,isin,IHALF, 3 XC,XM,XND,IDSAV,NIT,MRAND,ITRACE) C...the cross-product matrix is returned - scale it DO I=1,NV DO J=1,NV XC(I,J) = XC(I,J)/(IHALF-NG) ENDDO ENDDO END subroutine reader(data,ncas,nord,npop, 1ave,cov,cinv,datimg,wtv,ustu,deter, 2igp,ibasis,isin,ncover, 3bescov,besave,beswtv,ibsbes,nsim,iseed,ITRACE) implicit doubleprecision (a-h,o-z) dimension data(nord,ncas),ave(nord,npop),cov(nord,nord), 1 datimg(nord,ncas), 2 ustu(ncas),igp(ncas),ibasis(ncas), 3 isin(ncas),wtv(npop),cinv(nord,nord), 4 bescov(nord,nord),besave(nord,npop),ibsbes(ncas), 5 beswtv(npop), 6 index(5000),devi(100), 7 detrtb(100),icount(100),isgntb(100) data xix, xia, xic /.31415925d0,17119.d0,0.1221d0/, 1 one /1.d0/ xix = xix * iseed CCC WRITE(*,*) ncas,' cases' c ncover = cover * ncas + 0.5 if(ITRACE .ge. 2) then CALL INTPR('Entering READER - ncas: ',-1,ncas,1) CALL INTPR('Entering READER - ncover: ',-1,ncover,1) endif do j = 1, ncas index(j) = j enddo do j = 1, npop wtv(j) = 0 do i = 1, nord ave(i,j) = 0 enddo enddo do j = 1, nord do i = 1, nord cov(i,j) = 0 enddo enddo do icas = 1, ncas ngp = igp(icas) wold = wtv(ngp) wnew = wold + one wtv(ngp) = wnew rati = wold / wnew do i = 1, nord devi(i) = data(i,icas) - ave(i,ngp) ave(i,ngp) = ave(i,ngp) + devi(i) / wnew do j = 1, i cov(i,j) = cov(i,j) + devi(i) * devi(j) * rati enddo enddo enddo edf = ncas - npop do i = 1, nord do j = 1, i cov(i,j) = cov(i,j) / edf cov(j,i) = cov(i,j) enddo enddo CCC WRITE(*,'('' Full data set''/'' Grp size averages'')') CCC WRITE(8,'('' Full data set''/'' Grp size averages'')') CCC do j = 1, npop CCC WRITE(*,101) j,int(wtv(j)),(ave(i,j),i=1,nord) CCC WRITE(8,101) j,int(wtv(j)),(ave(i,j),i=1,nord) CCC 101 format(/i4,i5,(t12,6g11.4)) CCC enddo CCC WRITE(*,*) ' Covariance matrix' CCC WRITE(8,'(/'' Covariance matrix'')') CCC do j = 1, nord CCC WRITE(*,102) j,(cov(i,j),i=1,nord) CCC WRITE(8,102) j,(cov(i,j),i=1,nord) CCC 102 format(/i5,(t12,6g11.4)) CCC enddo deter = 1 ixlo = 1 do i = 1, nord CCC WRITE(*,'('' Sweeping pivot, deter'',2g15.7)') cov(i,i),deter call zsweep(cov,nord,i,deter) enddo CCC WRITE(*,'(/'' Log10 determinant of overall covariance matrix'', CCC 1 f10.4)') log10(deter) CCC WRITE(8,'(/'' Log10 determinant of overall covariance matrix'', CCC 1 f10.4)') log10(deter) if(ITRACE .ge. 2) then xdet = log10(deter) CALL DBLEPR('Initialization ready - log det: ',-1,xdet,1) endif verbes = 1.d30 if (ncover .ge. ncas) return cover = 1.0*ncover/ncas CCC WRITE(*,'(//'' Start search for high breakdown estimators'' CCC 1 '' of coverage'',f7.3)') cover CCC WRITE(8,'(//'' Start search for high breakdown estimators'' CCC 1 '' of coverage'',f7.3)') cover edf = ncover - npop corter = nord * log10(edf) nsol = 0 do 80 loopo = 1, nsim do i = ncas, 1, -1 fi = i xix = mod(xix * xia + xic, one) inx = xix * fi + one if(inx .ne. i) then itemp = index (i) index (i) = index (inx) index (inx) = itemp endif ibasis(i) = index(i) enddo if(ITRACE .ge. 2) then CALL INTPR('Entering iteration: ',-1,loopo,1) endif call itera(data,ave,cov,cinv,datimg,wtv,ustu,deter, 1 igp,ibasis,isin,nord,ncas,npop,ncover) isgn = isigna(ibasis,ncover) do i = 1, nsol if(isgn.eq.isgntb(i).and.abs(deter/detrtb(i)-one) 1 .lt. .001) then icount(i) = icount(i) + 1 go to 135 endif enddo do i = 1, ncover do j = 1, i if (ibasis(j) .gt. ibasis(i)) then itemp = ibasis(i) ibasis(i) = ibasis(j) ibasis(j) = itemp endif enddo enddo CCC WRITE(*,'(/''Loop'',i6,'' New feasible solution. Retained '', CCC 1 ''cases''/(20i4))') loopo,(ibasis(i),i=1,ncover) CCC detlog = log10(deter) - corter CCC WRITE(*,'('' log10 determinant'', CCC 1 g15.7/'' Grp size averages'')') detlog CCC do 145 j = 1, npop CCC 145 WRITE(*,'(i4,i5,(t12,6g11.4))') j,int(wtv(j)),(ave(i,j),i=1,nord) CCC WRITE(*,*) ' Covariance matrix' CCC do j = 1, nord CCC WRITE(*,'(t12,6g11.4)') (cov(i,j)/edf,i=1,nord) CCC enddo nsol = nsol + 1 isgntb(nsol) = isgn detrtb(nsol) = deter icount(nsol) = 1 135 continue if (deter .lt. 0.999999d0 * verbes) then CCC WRITE(*,'(//'' New optimum'')') CCC WRITE(8,'(/''Loop'',i6,'' New feasible solution. Retained '', CCC 1 ''cases''/(20i4))') loopo,(ibasis(i),i=1,ncover) CCC WRITE(8,'('' log10 determinant'',g15.7)') detlog verbes = deter do i = 1, nord do j = 1, npop beswtv(j) = wtv(j) besave(i,j) = ave(i,j) enddo do j = 1, nord bescov(i,j) = cov(i,j) enddo enddo do i = 1, ncover ibsbes(i) = ibasis(i) enddo endif 80 continue CCC WRITE(*,'('' Criterion and count of different feasible '', CCC 1 ''solutions'')') CCC WRITE(*,'(5(f7.3,i5))') (log10(detrtb(i))-corter, CCC 1 icount(i), i=1,nsol) CCC WRITE(8,'('' Criterion and count of different feasible '', CCC 1 ''solutions'')') CCC WRITE(8,'(5(f7.3,i5))') (log10(detrtb(i))-corter, CCC 1 icount(i), i=1,nsol) CCC write(*,103) (ibsbes(i),i=1,ncover) CCC write(8,103) (ibsbes(i),i=1,ncover) CCC 103 format(/' Best feasible solution. Cases covered are'/(15i5)) CCC WRITE(*,'(/'' Grp size averages'')') CCC WRITE(8,'(/'' Grp size averages'')') CCC do j = 1, npop CCC WRITE(*,101) j,int(beswtv(j)),(besave(i,j),i=1,nord) CCC WRITE(8,101) j,int(beswtv(j)),(besave(i,j),i=1,nord) CCC enddo CCC WRITE(*,*) ' Covariance matrix' CCC WRITE(8,'(/'' Covariance matrix'')') CCC do j = 1, nord CCC WRITE(*,102) j,(bescov(i,j)/edf,i=1,nord) CCC WRITE(8,102) j,(bescov(i,j)/edf,i=1,nord) CCC enddo end subroutine itera(data,ave,cov,cinv,datimg,wtv,ustu,deter, 1 igp,ibasis,isin,nord,ncas,npop,ncover) implicit double precision (a-h,o-z) dimension data(nord,ncas),ave(nord,npop),cov(nord,nord), 1 cinv(nord,nord),datimg(nord,ncas),ustu(ncas), 2 ibasis(ncover),isin(ncas),igp(ncas),devi(200),devj(200), 3 upfac(100), dnfac(100),wtv(npop) data one /1.d0/, big /1.d10/ C Initialize to avoid warnings iout = 0 icasot = 0 jin = 0 do j = 1, npop wtv(j) = 0 do i = 1, nord ave(i,j) = 0 enddo enddo do j = 1, nord do i = 1, nord cov(i,j) = 0 enddo enddo do i = 1, ncas isin(i) = 0 enddo c Get initial covariance matrix do inx = 1, ncover icas = ibasis(inx) isin(icas) = 1 ngp = igp(icas) wold = wtv(ngp) wnew = wold + one wtv(ngp) = wnew rati = wold / wnew do i = 1, nord devi(i) = data(i,icas) - ave(i,ngp) ave(i,ngp) = ave(i,ngp) + devi(i) / wnew do j = 1, i cov(i,j) = cov(i,j) + devi(i) * devi(j) * rati enddo enddo enddo do i = 1, nord do j = 1, i cov(j,i) = cov(i,j) cinv(i,j) = cov(i,j) cinv(j,i) = cov(i,j) enddo enddo deter = 1 ixlo = 1 do i = 1, nord call zsweep(cinv,nord,i,deter) enddo do i = 1, nord do j = 1, nord cinv(i,j) = -cinv(i,j) enddo enddo call verify1(cov,cinv,nord) c Major loop point 30 continue do i = 1, npop wtvi = wtv(i) upfac(i) = sqrt(wtvi / (wtvi + one)) dnfac(i) = big if (wtvi .gt. one) dnfac(i) = sqrt(wtvi / (wtvi - one)) enddo c Get images of cases do 41 j = 1, ncas ngp = igp(j) ustu(j) = 0 do 40 i = 1, nord sum = 0 do 45 k = 1, nord 45 sum = sum + cinv(i,k) * (data(k,j) - ave(k,ngp)) datimg(i,j) = sum ustu(j) = ustu(j) + sum * (data(i,j) - ave(i,ngp)) 40 continue 41 continue c Consider possible case swaps best = one do 50 i = 1, ncover icas = ibasis(i) ngp = igp(icas) if(wtv(ngp) .eq. one) go to 50 c c dont remove the only case in a group c firfac = one - dnfac(ngp) ** 2 * ustu(icas) if (firfac .gt. best) go to 50 do 55 j = 1, ncas if (isin(j) .eq. 1) go to 55 c c do pretest c jgp = igp(j) if(jgp .ne. ngp) then c c (we need special codes when the two are in the same group) c factor=firfac*(one+upfac(jgp)**2*ustu(j)) if (factor .ge. best) go to 55 c (cannot beat what we have already) c sum = 0 do 60 k = 1, nord 60 sum=sum+(data(k,icas)-ave(k,ngp))*datimg(k,j) factor=factor+(sum*upfac(jgp)*dnfac(ngp))**2 if(factor.lt.0) then CCC WRITE(*,*) 'Impossible factor. dnfac,ustu(icas),firfac', CCC 1 dnfac(ngp),ustu(icas),firfac,' upfac,ustu(j)', CCC 2 upfac(jgp),ustu(j),' sum', sum CCC WRITE(*,*) ' wtv(ngp)', wtv(ngp) do 155 ik = 1, ncover ikk = ibasis(ik) CCC if(igp(ikk).eq.ngp) WRITE(*,*) 'hit',ik,ikk 155 continue endif if(factor .lt. best) then best = factor iout = i icasot = icas jin = j endif else sum1 = 0 sum2 = 0 divis = wtv(ngp) - one do 61 k = 1, nord ui = data(k,icas) - ave(k,ngp) vi = data(k,j) - ave(k,ngp) + ui / divis vimg = datimg(k,j) + datimg(k,icas) / divis sum1 = sum1 + vi * vimg sum2 = sum2 + ui * vimg 61 continue factor = firfac * (one + divis * sum1 / wtv(ngp)) + 1 sum2 ** 2 if (factor .lt. best) then best = factor iout = i icasot = icas jin = j endif endif 55 continue 50 continue if(best .eq. one) go to 90 c c There is a swap that improves things. Make it c isin(icasot) = 0 ibasis(iout) = jin isin(jin) = 1 deter = deter * best c c Do the downdate, removing case icasot c ngp = igp(icasot) jgp = igp(jin) wold = wtv(ngp) wnew = wold - one rati = wold / wnew wtv(ngp) = wnew fact = rati / (one - rati * ustu(icasot)) do 70 i = 1, nord devi(i) = data(i,icasot) - ave(i,ngp) ave(i,ngp) = ave(i,ngp) - devi(i) / wnew devj(i) = data(i,jin) - ave(i,jgp) do 70 j = 1, i cov(i,j) = cov(i,j) - devi(i) * devi(j) * rati cov(j,i) = cov(i,j) cinv(i,j) = cinv(i,j) + datimg(i,icasot) * 1 datimg(j,icasot) * fact cinv(j,i) = cinv(i,j) 70 continue call verify1(cov,cinv,nord) c c Now do the update, adding case jin c wold = wtv(jgp) wnew = wold + one wtv(jgp) = wnew rati = wold / wnew sum2 = 0 do 80 i = 1, nord ave(i,jgp) = ave(i,jgp) + devj(i) / wnew sum = 0 do 81 j = 1, nord cov(i,j) = cov(i,j) + rati * devj(i) * devj(j) 81 sum = sum + cinv(i,j) * devj(j) devi(i) = sum sum2 = sum2 + devi(i) * devj(i) 80 continue factor = rati / (one + rati * sum2) do 85 i = 1, nord do 85 j = 1, nord 85 cinv(i,j) = cinv(i,j) - devi(i) * devi(j) * factor call verify1(cov,cinv,nord) go to 30 90 return end subroutine verify1(cov,cinv,nord) implicit double precision (a-h,o-z) dimension cov(nord,nord),cinv(nord,nord) data one /1.d0/ biger = 0 do 5 i = 1, nord do 10 j = 1, nord sum = 0 do 15 k = 1, nord 15 sum = sum + cov(i,k) * cinv(k,j) if (i .eq. j) then biger = max(biger,abs(sum-one)) else biger = max(biger,abs(sum)) endif 10 continue 5 continue if (biger .gt. 0.001) then CCC WRITE(*,*) 'Inversion error, departure from I is',biger return endif return end SUBROUTINE ZSWEEP (COV,NORD,NEL,DETER) IMPLICIT DOUBLE PRECISION (A-H,O-Z) DIMENSION COV(NORD,NORD) DATA ONE/1.D0/ TEMP=COV(NEL,NEL) DETER=DETER*TEMP IF (NORD.GT.1) GO TO 10 COV(1,1)=ONE/TEMP RETURN 10 DO 30 I=1,NORD IF (I.EQ.NEL) GO TO 30 DO 20 J=1,I IF (J.EQ.NEL) GO TO 20 COV(J,I)=COV(I,J)-COV(I,NEL)*COV(NEL,J)/TEMP COV(I,J)=COV(J,I) 20 CONTINUE 30 CONTINUE COV(NEL,NEL)=ONE DO 40 I=1,NORD COV(NEL,I)=-COV(I,NEL)/TEMP COV(I,NEL)=COV(NEL,I) 40 CONTINUE RETURN END FUNCTION ISIGNA (LIST,NROW) DIMENSION LIST(NROW) DATA NPRIM1/30931/, NPRIM2/59473/ ISIG1 = 43 ISIG2 = 23 DO 10 I=1,NROW ITEMP=LIST(I)+1000 ISIG1 = MOD(ISIG1*ITEMP,NPRIM1) ISIG2 = MOD(ISIG2*ITEMP,NPRIM2) 10 CONTINUE ISIGNA = ISIG1 * ISIG2 RETURN END rrcov/src/ds11.f0000644000176200001440000003413013373055220013114 0ustar liggesusers subroutine rlds(n,np,nresamp,x,tune,wk,locat,cov,maxres, 1 nresper,w,z,icent,iwork) c c c INPUT: 'n' = number observations (integer); c 'np' = number of indepent variables (integer); c 'nresamp' = mumber of resamples required (integer), may not be reached c if too many of the subsamples of size 'np', chosen out of c the observed vectors, are in a hyperplane; c if nresamp=0, ALL subsamples are taken; c 'x' = real (n*np) matrix of observed values; c 'tune' = tuning constant used in calculation of weights; c by default should be equal to the square root of the c 95-percentile of the chi-square distribution with 'np' c degrees of freedom (real). c 'seed' = seed for calculating random numbers (real); c 'wk' = real work vector of length (4*n+np). On output, c wk(1),..,wk(n) contain the weights assigned to c each observation; c 'maxres' = maximum nunber of resamples to be performed (integer), c including those which are discarded due to linearly c dependent subsamples. c 'icent'= if 0 the observations are centered with 0 c c OUTPUT: 'locat' = real vector of location parameters, of length c 'np'; c 'cov' = real (np*np) Donoho-Stahel covariance matrix; c 'nresper' = number of valid resamples performed (integer). c 'w' = weights c 'z' = outlyigness c c NOTE: all real variables are double precision. c implicit double precision (a-h,o-z) double precision locat(np) dimension x(n,np),wk(4*n+np),cov(np,np),w(n),z(n), iwork(4*n+np) nr=1 nind=nr+n naux=nind+np C CALL INTPR('ENTER rlds. nresamp=',-1,nresamp,1) C CALL INTPR('maxres=',-1,maxres,1) C CALL INTPR('icent=',-1,icent,1) call rndstart() call rlweights(n,np,nresamp,x,tune,w,z,locat,wk(nr),iwork(nind), 1 cov,wk(naux),maxres,nresper,icent) call rldonostah(n,np,x,w,locat,cov,icent) call rndend() return end subroutine rlweights(n,np,nresamp,x,c,w,z,a,b,ind,wk, 1 u,maxres,nresper,icent) implicit double precision (a-h,o-z) dimension x(n,np),z(n),a(np),b(n),w(n),ind(np),u(n) dimension wk(np,np) C CALL INTPR('ENTER rlweights',-1,0,0) k1=(np-1)+(n+1)/2 k2=(np-1)+(n+2)/2 z1=dble(k1) zn=dble(n) z3=(1+(z1/zn))/2 call rlquntbi(z3, cc) do i=1,n z(i)=-1. enddo nresper=0 if(np.eq.1) then call rlprocess(n,np,nresper,x,a,b,w,z,ind,wk,u,k1, + k2,cc,icent) elseif (nresamp.eq.0) then call rlall(n,np,nresper,x,a,b,w,z,ind,wk,u,k1,k2,cc,icent) else k=0 do while (k.lt.maxres.and.nresper.lt.nresamp) k=k+1 call rlsubsamp(n,np,ind) call rlprocess(n,np,nresper,x,a,b,w,z,ind,wk,u,k1, + k2,cc,icent) enddo endif C CALL DBLEPR('zi',-1,z,n) do i=1,n call rlrwetml(z(i)/c,w(i)) enddo C CALL DBLEPR('EXIT rlweights: wi=',-1,w,n) return end subroutine rlall(n,np,nresper,x,a,b,w,z,ind,wk,u,k1,k2,cc,icent) implicit double precision (a-h,o-z) dimension x(n,np),z(n),a(np),b(n),w(n),ind(np),u(n) dimension wk(np,np) do j=1,np ind(j)=j enddo call rlprocess(n,np,nresper,x,a,b,w,z,ind,wk,u,k1,k2,cc,icent) j=0 do while (np-j.ge.1) if (ind(np-j).eq.n-j) then j=j+1 else ind(np-j)=ind(np-j)+1 do k=np-j+1,np ind(k)=ind(k-1)+1 enddo call rlprocess(n,np,nresper,x,a,b,w,z,ind, + wk,u,k1,k2,cc,icent) j=0 endif enddo return end subroutine rlprocess(n,np,nresper,x,a,b,w,z,ind,wk, + u,k1,k2,cc,icent) implicit double precision (a-h,o-z) dimension x(n,np),z(n),a(np),b(n),w(n),ind(np),u(n) dimension wk(np,np) data tola,tolr,big1,big2 /1.d-15, 1.d-8,1.d+2,1.d+15/ C CALL INTPR('ENTER rlprocess',-1,0,0) CALL RCHKUSR() ierr=0 if(np.gt.1) then call rlvectora(n,np,x,a,ind,wk,icent,ierr) endif C CALL INTPR('IERR',-1,ierr,1) C CALL DBLEPR('A',-1,a,np) if (ierr.eq.0) then nresper=nresper+1 C VT::19.07.2010 C Handle the univariate case if(np.eq.1) then do i=1,n b(i)=x(i,1) enddo else do i=1,n b(i)=0. do j=1,np b(i)=b(i)+x(i,j)*a(j) enddo enddo endif bmed=0.0d0 if(icent.ne.0) bmed=rlamed(b,n,u) do i=1,n w(i)=abs(b(i)-bmed) enddo ww=0 do i=1,n ww=ww+w(i) enddo ww=ww/n if(ww.ge.tola) then call rlsort(w,n,1) bmad=(w(k1)+w(k2))/2 bmad=bmad/cc if(bmad.ge.tolr *ww) then do i=1,n aux=abs(b(i)-bmed)/bmad if (aux.gt.z(i)) z(i)=aux enddo else do i=1,n if(abs(b(i)-bmed).gt. big1*bmad) z(i)=big2 enddo endif endif endif return end subroutine rlvectora(n,np,x,a,ind,wk,icent,ierr) implicit double precision (a-h,o-z) dimension x(n,np),a(np),ind(np),wk(np,np) do k=1,np do j=1,np wk(j,k)=x(ind(k),j) enddo enddo call rldirec(wk,np,np,icent,ierr,a) return end subroutine rldonostah(n,np,x,w,locat,cov,icent) implicit double precision (a-h,o-z) double precision locat(np) dimension x(n,np),w(n),cov(np,np) sumw=0. sumw2=0. do i=1,n sumw=sumw+w(i) sumw2=sumw2+w(i)*w(i) enddo do j=1,np locat(j)=.0 enddo if(icent.eq.1)then do j=1,np locat(j)=0. do i=1,n locat(j)=locat(j)+w(i)*x(i,j) enddo locat(j)=locat(j)/sumw enddo endif do j=1,np do k=1,np cov(j,k)=0. do i=1,n cov(j,k)=cov(j,k)+w(i)*(x(i,j)-locat(j))* 1 w(i)*(x(i,k)-locat(k)) enddo cov(j,k)=cov(j,k)/sumw2 enddo enddo return end subroutine rlsubsamp(n,np,ind) implicit double precision (a-h,o-z) dimension ind(np) en=dble(n) C call roblibrunif(RND) RND = unifrnd() ind(1)=int(en*RND+1.) if (np.eq.1) return k=2 c 10 call roblibrunif(RND) 10 RND = unifrnd() ind(k)=int(en*RND+1.) do i=1,k-1 if (ind(i).eq.ind(k)) go to 10 enddo if (k.eq.np) return k=k+1 go to 10 end double precision function rlamed(z,n,aux) implicit double precision (a-h,o-z) DIMENSION Z(n),aux(n) DO 100 I=1,N 100 AUX(I)=Z(I) CALL rlSORT (AUX,N,1) I=N/2 K=I*2 rlamed=AUX(I+1) IF (k.GE.N) rlamed=(rlamed+AUX(I))/2. RETURN END SUBROUTINE RLSORT (A,N,SWITCH) implicit double precision (a-h,o-z) DIMENSION A(n) INTEGER SWITCH IF (N.LE.1) GO TO 999 M=1 106 M=M+M IF(M.LE.N) GO TO 106 M=M-1 994 M=M/2 IF (M.EQ.0) GO TO 999 KK=N-M J=1 992 I=J 996 IM=I+M IF(SWITCH) 810,810,800 800 IF (A(I).GT.A(IM)) GO TO 110 GO TO 995 810 IF(A(I).LT.A(IM)) GO TO 110 995 J=J+1 IF(J.GT.KK) GO TO 994 GO TO 992 110 TEMP=A(I) A(I)=A(IM) A(IM)=TEMP I=I-M IF (I.LT.1) GO TO 995 GO TO 996 999 RETURN END double precision function rldprodd(x,y,nn) implicit double precision (a-h,o-z) dimension x(nn), y(nn) rldprodd=0. do i=1,nn rldprodd=rldprodd+x(i)*y(i) enddo return end double precision function rlrobustdnorm(x,nn) implicit double precision (a-h,o-z) dimension x(nn) rlrobustdnorm=rldprodd(x,x,nn) rlrobustdnorm=dsqrt(rlrobustdnorm) return end subroutine rlxnorma(x,nn,ierr,tol) implicit double precision (a-h,o-z) dimension x(nn) ierr=1 dn=rlrobustdnorm(x,nn) if (dn.le.tol) then ierr=1 return else ierr=0 endif do i=1,nn x(i)=x(i)/dn enddo return end subroutine rlorthog(xx,nn,mm,nmain,ierr) implicit double precision (a-h,o-z) dimension xx(nmain,mm) data tola,tolr /1.d-15, 1.d-8/ C In original code tolb was never initialized (was 0 on Solaris, random on HP) tolb = tola do j=1,mm call rlxnorma(xx(1,j),nn,ierr,tola) if (ierr.gt.0) return enddo mm1=mm-1 do j=1,mm1 call rlxnorma(xx(1,j),nn,ierr,tolr) if (ierr.ne.0) return j1=j+1 do k=j1,mm dp=rldprodd(xx(1,j),xx(1,k),nn) do i=1,nn xx(i,k)=xx(i,k)-xx(i,j)*dp enddo enddo enddo call rlxnorma(xx(1,mm),nn,ierr,tolb) C if (ierr .ne. 0) write(*,*) 'rlxnorma(...,tolb) failed!' return end subroutine rlortdir(xx,mm,nmain,dire) implicit double precision (a-h,o-z) dimension xx(nmain,mm), dire(mm) tol=1./dsqrt(dble(mm)) mm1=mm-1 do k=1,mm do i=1,mm dire(i)=0 do j=1,mm1 dire(i)=dire(i)-xx(i,j)*xx(k,j) enddo enddo dire(k)=dire(k)+1 dn=rlrobustdnorm(dire,mm) if (dn.ge.tol) goto 40 enddo 40 do i=1,mm dire(i)=dire(i)/dn enddo return end subroutine rldirec(xx,mm,nmain,icent,ierr,dire) implicit double precision (a-h,o-z) dimension xx(nmain,mm), dire(mm) mm1=mm if (icent.ne.0)then mm1=mm-1 do k=1,mm1 do i=1,mm xx(i,k)=xx(i,k)-xx(i,mm) enddo enddo endif call rlorthog(xx,mm,mm1,nmain,ierr) if (ierr.eq.0) call rlortdir(xx,mm,nmain,dire) return end SUBROUTINE RLRWETML(X,P) C....................................................................... DOUBLE PRECISION X,AX,P,COEF,ZERO DIMENSION COEF(4) DATA ZERO/0.D0/ DATA COEF/-19.7187928669416D0, + 82.3045267489739D0, + -105.4526748971229D0, + 42.8669410150906D0/ C----------------------------------------------------------------------- C CALCULATE WEIGHT FUNCTION FOR REWEIGHTING C NOTE: X >= 0 C----------------------------------------------------------------------- AX = DABS(X) IF (AX .GE. 1.D0) THEN P = ZERO ELSE IF (AX .LE. 0.8D0) THEN P = 1.D0 ELSE P = COEF(1)+COEF(2)*AX**2+COEF(3)*AX**4+COEF(4)*AX**6 ENDIF C CALL DBLEPR('IN RLRWETML',-1,p,1) RETURN END C======================================================================= SUBROUTINE RLQUNTBI(P,X) C....................................................................... DOUBLE PRECISION C(6),P,P1,T,X,XN,XZ DATA C(1),C(2),C(3),C(4),C(5),C(6)/ + 2.515517D0,0.802853D0,0.010328D0, + 1.432788D0,0.189269D0,0.001308D0/ C----------------------------------------------------------------------- C INVERSE OF GAUSSIAN DISTRIBUTION FUNCTION C----------------------------------------------------------------------- C P: I, PROBABILITY, C X: O, QUANTILE. C----------------------------------------------------------------------- P1=P IF (P .GT. 0.5D0) P1=1.D0-P T=DSQRT(-2.D0*DLOG(P1)) XZ=(C(3)*T+C(2))*T+C(1) XN=((C(6)*T+C(5))*T+C(4))*T+1.D0 X=T-XZ/XN IF (P .LT. 0.5D0) X=-X RETURN END rrcov/src/sest.c0000644000176200001440000005515513373055220013331 0ustar liggesusers/* TO DO - FIXME * - Fix the parameters maxit, rtol and converged * - Fix "if(ires > 0) ... else" -there is no need of such distinction * - Use QR to compute the inverse of the cov matrix - see mtxdet(). */ #include #include #include #include /* for the QR routines */ #define MAX_NTRY 1000 /* was 500 */ #define ZERO 1e-10 #define INFI 1e+20 void r_sample(int *x, int *n, int *k); void selectwr(int *array, int size, int nchoices); void reverse(int *a, int n); void resample(int *array, int n, int k); void covp(double **x, int *n, int *p, int *indices, int *nind, double *mean, double **cov, double *det, int *rank); void covpold(double **a, int n, int p, int *id, int np, double *t, double ** cov); void covar(double **a, int n, int p, double *t, double ** cov); void covwt(double **a, int n, int p, double *wts, double *t, double **cov); double mymed(int n, double *x); double mymedabs(int n, double *x); double mad(int n, double *x, double *dwork1, double *dwork2, double *mu); int maxind(double *a, double *maxval, int n); double norm (double *x, int n); double norm1(double *x, int n); double norm_diff (double *x, double *y, int n); double norm1_diff(double *x, double *y, int n); int mtxdet(double **c, int p, double *det); void mtxswp(double **a, int p, int k); void mtxinv(double **a, int p, double *det); void mtxtra(double **a, double **b, int n, int p); void vectra(double *a, double *b, int n); void mtxmsc(double **a, double s, int n, int p); double **mtxalloc(int n, int p); void mtxfree(double **a, int n, int p); void resdis(double **x, int n, int p, double *mu, double **sigma, double *d); double rhobw(double u, double cc); double mean_rhobw(double *u, double scale, int n, double cc); double lossS(double *u, double scale, int n, double cc); double scaleS(double *u, double kp, double cc, double initial_sc, int n); void scaledpsi(double *u, double scale, int n, double cc, double *w); int refine_s(double **x, int n, int p, double *init_mu, double **init_sigma, double init_scale, int k, int conv, double kp, double cc, double *mu, double **sigma, double *scale, double *rdis, double *weights); /* * Compute FAST-S estimates of location and covariance matrix - * similar to the one proposed for regression by * Salibian-Barrera, M. and Yohai, V.J. (2005), * "A fast algorithm for S-regression estimates". * This current C implemention is by Valentin Todorov. * * INPUT: * X - input data matrix - linear (FORTRAN) nn by pp * nsamp - number of initial samples to generate * cc1 - constant for the biweight function * kkp - constant (b) for the S-equation * bbest_r - number of 'best' solution to keep and iterate to convergence later * kstep * maxit * rtol * * OUTPUT: * ctr - location vector * ccov - covariance matrix (linear, p by p) * scale - scale * converged * */ void sest(double *X, int *nn, int *pp, int *nsamp, double *ctr, double *ccov, double *scale, double *cc1, double *kkp, int *bbest_r, int *kstep, int *maxit, double *rtol, int *converged); /* for "tracing" only : */ void disp_mat(double **a, int n, int m); void disp_dble(double *a, int n); void disp_int(int *a, int n); void disp_lmat(double *a, int n, int p); #define _use_blas_ /* ||x||_2 */ double norm(double *x, int n) { #ifdef _use_blas_ int one = 1; return(F77_CALL(dnrm2)(&n, x, &one)); #else int i; double s = 0.; for(i=0; i < n; i++) s += x[i] * x[i]; return(sqrt(s)); #endif } double norm1(double *x, int n) { #ifdef _USE_BLAS_ int one = 1; return(F77_CALL(dasum)(&n, x, &one)); #else int i; double s = 0.; for(i=0; i < n; i++) s += fabs(x[i]); return(s); #endif } /* ||x-y||_2 */ double norm_diff(double *x, double *y, int n) { int i; double s = 0; for(i=0; i < n; i++) s += (x[i]-y[i])*(x[i]-y[i]); return( sqrt(s) ); } /* ||x-y||_1 */ double norm1_diff(double *x, double *y, int n) { int i; double s = 0; for(i=0; i < n; i++) s += fabs(x[i]-y[i]); return(s); } /* * Resample without replacement: * Interface to R - call it from R instead of sample() for tests * when you want to have exactly the same sequence. * */ void r_sample(int *x, int *n, int *k) { int i; resample(x, *n, *k); for(i=0; i<*k; i++) x[i] += 1; } /* * Resample without replacement - k out of n elements of the array 'array' * */ void resample(int *array, int n, int k) { int i; for(i=0; i MAX_NTRY) { REprintf("\nToo many singular resamples\nAborting sest()\n\n"); *sscale = -1.0; goto cleanup_and_return; } resample(b_i, n, p+1); //covp(x, n, p, b_i, p+1, tmp, tmp_mat); //singular = mtxdet(tmp_mat, p, &det); covp(x, &n, &p, b_i, &nind, tmp, tmp_mat, &det, &rank); singular = rank < p; // REprintf("\n%d: Singular=%d, LOGDET= %lf\n", ires, singular, det); } mtxmsc(tmp_mat, pow(exp(det), -1.0/p), p, p); // Perform k steps of iterative reweighting on the elemental set if(*kstep > 0) { // do the refining: no convergence, only several (kstep) iterations refine_s(x, n, p, tmp, tmp_mat, -1, *kstep, conv, kp, c1, mu, sigma, &scale, rdis, weights); } else { // k = 0 means "no refining" vectra(tmp, mu, p); mtxtra(tmp_mat, sigma, p, p); resdis(x, n, p, mu, sigma, rdis); scale = mymedabs(n, rdis)/.6745; } if(ires > 0) { /* * if this isn't the first iteration.... * check whether new mu/sigma belong to the top best results; if so keep * mu and sigma with corresponding scale. */ s_test = lossS(rdis, s_worst, n, c1); if(s_test < kp) { s_best = scaleS(rdis, kp, c1, scale, n); ind = maxind(best_scales, &s_worst, best_r); best_scales[ind] = s_best; for(i=0; i= 0), it's used, o/w the MAD is used * k = number of refining steps * conv = 0 means "do k steps and don't check for convergence" * conv = 1 means "stop when convergence is detected, or the * maximum number of iterations is achieved" * kp and cc = tuning constants of the equation */ int refine_s(double **x, int n, int p, double *init_mu, double **init_sigma, double init_scale, int k, int conv, double kp, double cc, double *mu, double **sigma, double *scale, double *rdis, double *weights) { double convtol = 1e-20; double *mu_1 = (double *)Calloc(p, double); double **sigma_1 = mtxalloc(p,p); double **tmp_mat = mtxalloc(p,p); double sc, det; int i, singular; resdis(x, n, p, init_mu, init_sigma, rdis); if(init_scale < 0.0) init_scale = sc = mymedabs(n, rdis)/.6745; else sc = init_scale; // if conv == 1 then set the max no. of iterations to 50 // magic number alert!!! if(conv == 1) k = 50; // copy the initial estimates mu and sigma to work storage vectra(init_mu, mu, p); mtxtra(init_sigma, sigma, p, p); for(i=0; i= 0) // not singular { for(l=0; l 5 && p < 8) eps = 1.0E-14; else eps = 1.0E-16; *det = 1.0; for(j=0; j c1 */ double rhobw(double u, double cc) { double t2, c2 = cc*cc; double ret = c2/6; if(fabs(u) <= cc) { t2 = u*u; ret = t2*(1.0 - t2/c2 + t2*t2/(3*c2*c2))/2; } return ret; } /* * Return the mean of the rho(u/scale) for the Tukey's * biweight function rho() * 1/n * sum(rho(u/s)) */ double mean_rhobw(double *u, double scale, int n, double cc) { int i; double s = 0; for(i=0; i < n; i++) s += rhobw(u[i]/scale, cc); return (s/n); } /* * The objective function: * we solve loss.S(u, s, cc) = b for "s" */ double lossS(double *u, double scale, int n, double cc) { return mean_rhobw(u, scale, n, cc); } /* * Scaled psi function for Tukey's biweight to comute the weights: * Weight function = psi(u)/u */ void scaledpsi(double *u, double scale, int n, double cc, double *w) { int i=0; double t; // ##ifelse(abs(xx) < c1, xx - 2 * xx^3/c1^2 + xx^5/c1^4, 0) for(i=0; i eps) { sc2 = sqrt(sc*sc * mean_rhobw(u, sc, n, cc) / kp); err = fabs(sc2/sc - 1.0); sc = sc2; } return(sc); } void disp_dble(double *a, int n) { int i; for(i=0; i < n; i++) Rprintf("%lf ",a[i]); Rprintf("\n"); } void disp_int(int *a, int n) { int i; for(i=0; i < n; i++) Rprintf("%d ", a[i]); Rprintf("\n"); } void disp_mat(double **a, int n, int m) { int i,j; for(i=0; i < n; i++) { Rprintf("\n"); for(j=0; j < m; j++) Rprintf("%10.8f ",a[i][j]); } Rprintf("\n"); } /* * Display an nxp matrix stored in linear array in * row major order (C) */ void disp_lmat(double *a, int n, int p) { int i,j; for(i=0; i < n; i++) { Rprintf("\n"); for(j=0; j < p; j++) Rprintf("%10.8f ", a[i*p+j]); } Rprintf("\n"); } /* Compute the determinant and check if the matrix 'c' is singular using QR decomposition */ int mtxdet(double **c, int p, double *det) { int i, j, k; int rank; double sum, tol = 1.0e-7; double *cx = (double *) R_alloc(p*p, sizeof(double)); double *qraux = (double *) R_alloc(p, sizeof(double)); double *work = (double *) R_alloc(2*p, sizeof(double)); int *pivot = (int *) R_alloc(p, sizeof(int)); for(i=0; i void F77_SUB(rndstart)(void){ GetRNGstate(); } void F77_SUB(rndend)(void){ PutRNGstate(); } double F77_SUB(normrnd)(void){ return norm_rand(); } double F77_SUB(unifrnd)(void){ return unif_rand(); } rrcov/src/Makevars0000644000176200001440000000005613373055220013671 0ustar liggesusersPKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) rrcov/src/rrcov_init.c0000644000176200001440000000357713373055220014532 0ustar liggesusers// VT::21.05.2018 - this file was added to fix the warning // "Found no calls to: R_registerRoutines, R_useDynamicSymbols" // // About registration of native symbols see for example: https://www.r-bloggers.com/1-easy-package-registration/ // also here http://r.789695.n4.nabble.com/Registration-of-native-routines-td4728874.html // // There is a new function in 'tools' package: // package_native_routine_registration_skeleton() // // - about Windows - take the 64 bit version of mingw! // #include #include #include // for NULL #include /* FIXME: Check these declarations against the C/Fortran source code. */ /* .C calls */ extern void r_fast_mve(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *); extern void sest(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *); /* .Call calls */ extern SEXP covOPW(SEXP, SEXP, SEXP, SEXP); /* .Fortran calls */ extern void F77_NAME(fsada)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *); extern void F77_NAME(rlds)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *); static const R_CMethodDef CEntries[] = { {"r_fast_mve", (DL_FUNC) &r_fast_mve, 12}, {"sest", (DL_FUNC) &sest, 14}, {NULL, NULL, 0} }; static const R_CallMethodDef CallEntries[] = { {"covOPW", (DL_FUNC) &covOPW, 4}, {NULL, NULL, 0} }; static const R_FortranMethodDef FortranEntries[] = { {"fsada", (DL_FUNC) &F77_NAME(fsada), 15}, {"rlds", (DL_FUNC) &F77_NAME(rlds), 14}, {NULL, NULL, 0} }; void R_init_rrcov(DllInfo *dll) { R_registerRoutines(dll, CEntries, CallEntries, FortranEntries, NULL); R_useDynamicSymbols(dll, FALSE); } rrcov/src/covOPW.c0000644000176200001440000002227713373055220013527 0ustar liggesusers#include "R.h" #include "Rinternals.h" #include "Rmath.h" #include "R_ext/BLAS.h" #include "R_ext/Lapack.h" typedef double (scaleFnPtr)(int, double*, double*, double*, double*); typedef double (rcovFnPtr)(int, double*, double*, scaleFnPtr*, double*, double*, double*); double my_mad(int n, double *x, double *dwork1, double *dwork2, double *mu); double my_median(int n, double *x); double gk(int n, double *x, double *y, scaleFnPtr *scalefn, double *dwork1, double *dwork2, double *dwork3); double qc(int n, double *x, double *y, scaleFnPtr *scalefn, double *dwork1, double *dwork2, double *dwork3); double dsum(int n, double* x, int incx, double* wrkn); double scaleTau2(int n, double *x, double *dwork1, double *dwork2, double *mu); SEXP covOPW(SEXP SX, SEXP Siter, SEXP SscaleFun, SEXP SrcovFun) { char CHARA = 'A', CHARL = 'L', CHARN = 'N', CHART = 'T', CHARV = 'V'; double *X = NULL, *Z = NULL, *ZCOPY = NULL, *U = NULL, **A = NULL, *d = NULL; double *dwork1 = NULL, *dwork2 = NULL, *dwork3 = NULL, *diagT = NULL, *offdiagT = NULL; double *tau = NULL, *gamma = NULL, *cov = NULL, *covcopy = NULL, *center = NULL, *dist = NULL; double mu = 0.0, alpha = 0.0, DZERO = 0.0, DONE = 1.0; int n = 0, p = 0, np = 0, pp = 0, iter = -1, i = 0, j = 0, k = 0, info = 0, lwork = 0; int liwork = 0, IONE = 1; int *isuppz = NULL, *iwork = NULL; SEXP Sans = R_NilValue, Scov = R_NilValue, Scenter = R_NilValue; SEXP Sdist = R_NilValue, Sdim = R_NilValue, Snames = R_NilValue; scaleFnPtr *scalefn = NULL; rcovFnPtr *rcovfn = NULL; if(strncmp(CHAR(asChar(SscaleFun)), "s_mad", 5) == 0) scalefn = &my_mad; else if(strncmp(CHAR(asChar(SscaleFun)), "scaleTau2", 9) == 0) scalefn = &scaleTau2; else error("unable to set scale function pointer in C function covOPW"); if(strncmp(CHAR(asChar(SrcovFun)), "gk", 2) == 0) rcovfn = &gk; else if(strncmp(CHAR(asChar(SrcovFun)), "qc", 2) == 0) rcovfn = &qc; else error("unable to set rcov function pointer in C function covOPW"); if(!isMatrix(SX)) error("first argument to C function covOPW is not a matrix"); PROTECT(Sdim = getAttrib(SX, R_DimSymbol)); n = INTEGER(Sdim)[0]; p = INTEGER(Sdim)[1]; Sdim = R_NilValue; UNPROTECT(1); np = n*p; pp = p*p; lwork = 18*p; liwork = 10*p; iter = INTEGER(Siter)[0]; X = REAL(SX); Z = (double*) R_alloc((size_t) np, sizeof(double)); F77_CALL(dcopy)(&np, X, &IONE, Z, &IONE); ZCOPY = (double*) R_alloc((size_t) np, sizeof(double)); U = (double*) R_alloc((size_t) (p*(p+1))/2, sizeof(double)); covcopy = (double*) R_alloc((size_t) pp, sizeof(double)); A = (double**) R_alloc((size_t) iter, sizeof(double*)); for(k = 0; k < iter; k++) A[k] = (double*) R_alloc((size_t) pp, sizeof(double)); d = (double*) R_alloc((size_t) p, sizeof(double)); dwork1 = (double*) R_alloc((size_t) n, sizeof(double)); dwork2 = (double*) R_alloc((size_t) n, sizeof(double)); dwork3 = (double*) R_alloc((size_t) imax2(n, lwork), sizeof(double)); diagT = (double*) R_alloc((size_t) p, sizeof(double)); offdiagT = (double*) R_alloc((size_t) p, sizeof(double)); tau = (double*) R_alloc((size_t) (p-1), sizeof(double)); gamma = (double*) R_alloc((size_t) p, sizeof(double)); isuppz = (int*) R_alloc((size_t) (2*p), sizeof(int)); iwork = (int*) R_alloc((size_t) liwork, sizeof(int)); for(k = 0; k < iter; k++) { for(j = 0; j < p; j++) { d[j] = scalefn(n, Z+j*n, dwork1, dwork2, &mu); //this can be handled better if(fabs(d[j]) < 1e-12) error("column with zero scale encountered in C function covOPW"); alpha = 1.0 / d[j]; F77_CALL(dscal)(&n, &alpha, Z+j*n, &IONE); } for(i = 0; i < p; i++) U[i+((2*p-i-1)*i)/2] = 1.0; for(i = 1; i < p; i++) for(j = 0; j < i; j++) U[i+((2*p-j-1)*j)/2] = rcovfn(n, Z+i*n, Z+j*n, scalefn, dwork1, dwork2, dwork3); /* Rprintf("\n %d (%d): %d, %d, %d, %d %d %d \n", k, iter, n, p, np, pp, lwork, liwork); */ F77_CALL(dsptrd)(&CHARL, &p, U, diagT, offdiagT, tau, &info); F77_CALL(dstegr)(&CHARV, &CHARA, &p, diagT, offdiagT, &mu, &mu, &i, &i, &DZERO, &j, gamma, A[k], &p, isuppz, dwork3, &lwork, iwork, &liwork, &info); F77_CALL(dopmtr)(&CHARL, &CHARL, &CHARN, &p, &p, U, tau, A[k], &p, dwork2, &info); for(j = 0; j < p/2; j++) F77_CALL(dswap)(&p, A[k]+j*p, &IONE, A[k]+p*(p-j-1), &IONE); F77_CALL(dcopy)(&np, Z, &IONE, ZCOPY, &IONE); F77_CALL(dgemm)(&CHARN, &CHARN, &n, &p, &p, &DONE, ZCOPY, &n, A[k], &p, &DZERO, Z, &n); for(i = 0; i < p; i++) for(j = 0; j < p; j++) A[k][i+j*p] = d[i] * A[k][i+j*p]; } PROTECT(Scov = allocMatrix(REALSXP, p, p)); PROTECT(Scenter = allocVector(REALSXP, p)); PROTECT(Sdist = allocVector(REALSXP, n)); cov = REAL(Scov); center = REAL(Scenter); dist = REAL(Sdist); for(j = 0; j < p; j++) { gamma[j] = scalefn(n, Z+j*n, dwork1, dwork2, &mu); for(i = 0; i < p; i++) cov[i+j*p] = i == j ? gamma[j] * gamma[j] : 0.0; center[j] = mu; } for(i = 0; i < n; i++) { for(j = 0; j < p; j++) Z[i+j*n] = R_pow_di(((Z[i+j*n] - center[j]) / gamma[j]), 2); dist[i] = F77_CALL(dasum)(&p, Z+i, &n); } for(k = iter-1; k >= 0; k--) { F77_CALL(dcopy)(&pp, cov, &IONE, covcopy, &IONE); F77_CALL(dgemm)(&CHARN, &CHARN, &p, &p, &p, &DONE, A[k], &p, covcopy, &p, &DZERO, cov, &p); F77_CALL(dcopy)(&pp, cov, &IONE, covcopy, &IONE); F77_CALL(dgemm)(&CHARN, &CHART, &p, &p, &p, &DONE, covcopy, &p, A[k], &p, &DZERO, cov, &p); F77_CALL(dcopy)(&p, center, &IONE, gamma, &IONE); F77_CALL(dgemv)(&CHARN, &p, &p, &DONE, A[k], &p, gamma, &IONE, &DZERO, center, &IONE); } PROTECT(Sans = allocVector(VECSXP, 3)); SET_VECTOR_ELT(Sans, 0, Scenter); SET_VECTOR_ELT(Sans, 1, Scov); SET_VECTOR_ELT(Sans, 2, Sdist); PROTECT(Snames = allocVector(STRSXP, 3)); SET_STRING_ELT(Snames, 0, mkChar("center")); SET_STRING_ELT(Snames, 1, mkChar("cov")); SET_STRING_ELT(Snames, 2, mkChar("distances")); setAttrib(Sans, R_NamesSymbol, Snames); UNPROTECT(5); return Sans; } double my_median(int n, double *x) { int k = -1; if(n%2) { k = (n-1)/2; rPsort(x, n, k); return(x[k]); } k = n/2; rPsort(x, n, k); rPsort(x, k, k-1); return((x[k-1] + x[k]) / 2.0); } double my_mad(int n, double *x, double *dwork1, double *dwork2, double *mu) { const int IONE = 1; int i = 0; F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); *mu = my_median(n, dwork1); for(i = 0; i < n; i++) dwork1[i] = fabs(dwork1[i] - *mu); return my_median(n, dwork1) * 1.4826; } double gk(int n, double *x, double *y, scaleFnPtr *scalefn, double *dwork1, double *dwork2, double *dwork3) { const int IONE = 1; double plus = 0.0, minus = 0.0, mu = 0.0; const double DONE = 1.0, DNEGONE = -1.0; F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); F77_CALL(daxpy)(&n, &DONE, y, &IONE, dwork1, &IONE); plus = scalefn(n, dwork1, dwork2, dwork3, &mu); F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); F77_CALL(daxpy)(&n, &DNEGONE, y, &IONE, dwork1, &IONE); minus = scalefn(n, dwork1, dwork2, dwork3, &mu); return (R_pow_di(plus, 2) - R_pow_di(minus, 2)) / 4.0; } double scaleTau2(int n, double *x, double *dwork1, double *dwork2, double *mu) { const double C1 = 4.5, C2squared = 9.0; // const double C2 = 3.0; const double Es2c = 0.9247153921761315; double medx = 0.0, sigma0 = 0.0, tmpsum = 0.0; int i = 0, IONE = 1; F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); medx = my_median(n, dwork1); for(i = 0; i < n; i++) dwork1[i] = fabs(dwork1[i] - medx); sigma0 = my_median(n, dwork1); F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); for(i = 0; i < n; i++) { dwork1[i] = fabs(dwork1[i] - medx); dwork1[i] = dwork1[i] / (C1 * sigma0); dwork2[i] = 1.0 - R_pow_di(dwork1[i], 2); dwork2[i] = R_pow_di(((fabs(dwork2[i]) + dwork2[i])/2.0), 2); } tmpsum = dsum(n, dwork2, 1, dwork1); for(i = 0; i < n; i++) dwork1[i] = x[i] * dwork2[i]; *mu = dsum(n, dwork1, 1, dwork2) / tmpsum; F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); for(i = 0; i < n; i++) { dwork2[i] = R_pow_di((dwork1[i] - *mu) / sigma0, 2); dwork2[i] = dwork2[i] > C2squared ? C2squared : dwork2[i]; } return sigma0 * sqrt(dsum(n, dwork2, 1, dwork1) / (n*Es2c)); } double qc(int n, double *x, double *y, scaleFnPtr *scalefn, double *dwork1, double *dwork2, double *dwork3) { double medx = 0.0, medy = 0.0, r = 0.0; int IONE = 1, i = 0, onethree = 0, twofour = 0; F77_CALL(dcopy)(&n, x, &IONE, dwork1, &IONE); medx = my_median(n, dwork1); F77_CALL(dcopy)(&n, y, &IONE, dwork1, &IONE); medy = my_median(n, dwork1); for(i = 0; i < n; i++) { if((x[i] > medx && y[i] > medy) || (x[i] < medx && y[i] < medy)) onethree++; else if((x[i] > medx && y[i] < medy) || (x[i] < medx && y[i] > medy)) twofour++; } r = ((double) (onethree - twofour)) / ((double) (onethree + twofour)); return sin(M_PI_2*r); } double dsum(int n, double* x, int incx, double* wrkn) { int i = 0; if(n == 1) return x[0]; while(i < n/2) { wrkn[i] = x[2*incx*i] + x[(2*i+1)*incx]; i++; } if(2*i < n) wrkn[i-1] = wrkn[i-1] + x[2*incx*i]; return dsum(i, wrkn, 1, wrkn+i); } rrcov/src/fast-mve.c0000644000176200001440000001453313373055220014070 0ustar liggesusers /* FILE: fast-mve.c // */ #include #include #include #include "R.h" #include "R_ext/Linpack.h" #include #define INFI 1e+20 #define EPS_DET 1e-5 void r_fast_mve(double *xx, int *nn, int *pp, int *nnsamp, int *nsingular, double *ctr, double *ccov, double *scale, int *best_ind, int *nnind, int *nn2, double *pchimed) { void r_find_k_smallest(double *a, int n, int k, int *ind, double *tmp); void r_mean_cov_mah_sample(double *x, int *n, int *p, int *indices, int *nind, double *xw, double *mean, double *cov, double *mah_d, double *det, int *pivot, double *qraux, double *work, int *rank, int *compute_cov, int *compute_distances, int *compute_det); double median(double *x, int n, double *aux); void sample_noreplace(int *x, int n, int k, int *all_ind); int *indi, iter, *pivot, rank, *all_ind; int compute_cov, compute_det, compute_distances; register int i, j; int n = *nn, p = *pp, nsamp = *nnsamp, n2 = *nn2, nind = *nnind; double s0 = INFI, s, *best_ctr, det1, det2; double *di, *tmp, *qraux, *tmp2, dn3; double *cov_vec; double xmed, calpha; double chimed = *pchimed; /* qchisq(0.5, p) */ all_ind = (int *) malloc( n * sizeof(int) ); cov_vec = (double*) calloc( p * p, sizeof(double) ); qraux = (double *) malloc( p * sizeof(double) ); tmp2 = (double *) malloc( 2 * p * sizeof(double) ); /* work */ pivot = (int *) malloc( p * sizeof(int) ); indi = (int *) calloc( n , sizeof(int) ); best_ctr = (double *) malloc( p * sizeof(double) ); di = (double *) malloc( n * sizeof(double) ); tmp = (double *) malloc( n * p * sizeof(double) ); GetRNGstate(); /* set the seed from R? */ dn3 = pow( (double) n2 - 1.0, (double) p); for(iter=0; iter < nsamp; iter++) { compute_distances = 1; compute_det = 1; compute_cov = 0; R_CheckUserInterrupt(); rank = 0; sample_noreplace(indi, n, nind, all_ind); r_mean_cov_mah_sample(xx, nn, pp, indi, &nind, tmp, ctr, cov_vec, di, &det1, pivot, qraux, tmp2, &rank, &compute_cov, &compute_distances, &compute_det); if( rank == p ) { r_find_k_smallest(di, n, n2, indi, tmp); compute_distances = 1; compute_det = 1; compute_cov = 1; r_mean_cov_mah_sample(xx, nn, pp, indi, &n2, tmp, ctr, cov_vec, di, &det1, pivot, qraux, tmp2, &rank, &compute_cov, &compute_distances, &compute_det); if( rank == p ) { det1 = det1 * det1 / dn3; /* det1 = |cov matrix| */ det2 = pow(det1, 1.0 / (double) p ); xmed = median(di, n, tmp); s = xmed * det2; calpha = xmed/chimed; /* Rprintf("calpha=%lf, chimed=%lf\n",calpha, chimed); */ if(s < s0){ s0 = s; for(i=0; i ax) j--; if (jnc <= j) { w=a[jnc]; a[jnc]=a[j]; a[j]=w; jnc++; j--; }; }; if (j 0) for(i = 0; i < j; i++) s -= work[i] * xr[i + nnew*j]; work[j] = s / xr[j + nnew*j]; ss += work[j] * work[j]; } return(ss*(nnew-1)); } /* Sampling k from 0:n-1 without replacement. (c) B. Ripley */ void sample_noreplace(int *x, int n, int k, int *ind) { int i, j, nn=n; for (i = 0; i < n; i++) ind[i] = i; for (i = 0; i < k; i++) { j = nn * unif_rand(); x[i] = ind[j]; ind[j] = ind[--nn]; } } rrcov/vignettes/0000755000176200001440000000000013607365240013423 5ustar liggesusersrrcov/vignettes/AModel.pdf0000644000176200001440000002672412763517421015274 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xVYoF ~ׯ["qշ(dW_3Hk^.ߐ\.nH}HZRR mIb!&G.SVF?BͮUF$5'+*M@]v׳WUBپƥ'T>4M{E}o7U9~L|tq.!8Ob{IrEl$P(hٟ sQ0G Und Tj@>ƏgT9.F_*MZ~aʧڬTӧ?F+LC<:^RS*Q.M4 Re"y/.Y_(!59xKvtIRgh1 a :[ 龡$9;ews's~x韢D3Mt=(So{gz}U.̿b@ιRNPIo/^>FւPqNأ%j *UP{Hϖzt5$RҘ !a ݁pG: /_RN)S48Ft>s/B7r_I=)čܑ-<w̗I|\%?Tq)7^GiWO3^C/hcO>s,w$}rȎ2޸0!B־5V\lz/PKk8=]e@kӖ'Zך %77`m] c1VXE0hTUKb5ٺ%M޶#<iwN-)@:rƝ Ξv㮴E:}mnmKS Xk^m=,bFL5۸c-`U*cĚ~`,52R_^_CλZ6k[sL.E)4k,^%XZh;V{a@ptm}w}"co1῞Eeז>ڡx]Ԭ0цLtg@9%xU0kVfzMFKtŔXZlHp3|f2ss?> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 14 0 obj <> endobj 15 0 obj <> endobj 8 0 obj <> endobj 10 0 obj <> endobj 12 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <>stream xSkPTe>˲UmU %E.I({N,"O!"nr4N^J2˴{PqD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k&3xp acP*m/F>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000001508 00000 n 0000011060 00000 n 0000001449 00000 n 0000001298 00000 n 0000000015 00000 n 0000001278 00000 n 0000001573 00000 n 0000001696 00000 n 0000002722 00000 n 0000001985 00000 n 0000004520 00000 n 0000002396 00000 n 0000007605 00000 n 0000001614 00000 n 0000001644 00000 n 0000002962 00000 n 0000004863 00000 n 0000007855 00000 n 0000009699 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 11178 %%EOF rrcov/vignettes/CovModel.pdf0000644000176200001440000003044512763517421015636 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xZKsWm9L~丮M.JahpDͿh3RZA*@`_oe'O] ?ݗBE{d:im'VۭT8P.F2}}}G (4/4>}[HwY Og^ޚrX{}?/Jay 8vƫ>$w=loHXizc.xuO?aXw/xEz!&벚QVET~U1U¶}Z;`owsWІ~w;wo?a~XnVW[kぴ^ﯷWZ]/wWQm [`h^3 y(6T ] ށ9oͨ/N.w1<R\bGC98Z_VWЯ"xMrnrl\T<bZ"߫$/9W"Jg -="'uz`3Cow~~!"ȉ_U9HV.3:r!ePAS&ҏ Ⱘsh/CwaS)V'>e=qA\ Ow#Y kha],e,r Ei!YVHJ!?ȗPPu=UXUj%.VQW窪#ㆁYni"S2, Z I _@uAg֍d-#,5Bq9=Wژ^c cK&` F(MD'B^X\?rΟ AEsDhWJȼ>[ds?GKw7ϻUk2{*HR <Q.'S 6"Y ߜ%1fZ_~Sh/=tdQъ/ iZRFV'Ƴ<)8Ob%>>jUidhuabN&a}aY;ANfVLD<ޢ;,4+{(S?9iuiP G\ylsVL;:HLl}FJVqd(<4oHlpFx*GS%il'[yYB)LBn9m&sg>@B SmPףTCSI*'i Ꚛ>r=ѵ kg(F>COcÇX(#2]\5G =8$G"}LKyƻ&j>ʁcXJ'HT*zIQ ZŪ 9Ȫ8P'r{Ā)poaCgi̅\Rlf_hK@Bz2IFDNr" -EP6ΚmRA>JشXT&r[s^h"PIB͎{+\ɯXU:8Aq}z ҧTٍxc[eT#'Zbi1"AXMWh]>g>BWz環{=Zd2?& Ӓ0·0=*A Ikjwqu_ztW bxK>18ŧ)7D2}CHk2/Z:҈O h4 3x==r<`((_dhGDZ8YWj6ۭ7[(!L.`ldendstream endobj 6 0 obj 2389 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 14 0 obj <> endobj 15 0 obj <> endobj 8 0 obj <> endobj 10 0 obj <> endobj 12 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <>stream xQ]HQiwem5ӈCi"a$b.蒨]/LsC$%TTOf%hQot2>4۹;GQ M,GNW4rDREsrY_}'+BTćKq\OUuuMndMP,A NjPCHՍh-t"tAZ:bmPHCB,!eT u)b]#L@b (##j@f Ԁ $MIHd5N?k Sw8T1P"ؠ("g62>N[ήtƑ<`ہ R endstream endobj 11 0 obj <> endobj 17 0 obj <>stream xUV TSG~ϐPI#$ *qT "" $R+֊ʠVW[*ADX"*?j -RP4Jr&Iܶ99͛ݡ)1M̒,ȕD' V)ѧ㐵Y[T3C-E hzI\r좜wreeesV Poj*W4+ *` X9t*Wt[ytqTPlh÷!ݟ{ї}dCYc04w=nNK4ՆwN]OԱ$Au Lﹶ얺Vy?7l axtS#RRHFx+1Q GB ؍j^9|HAhA,Ne B,~@$ס7hM+|;{8@s<C gKb1^t 8*RykBQZwb-w.zv0wBE{Kx*_s^WHS# q!'lݯzKzn ,w&x:l /cML`bغ$M:Lc!)iǎ ZsIY<#~Bش9 (&:>%R3TڏJ+%le[痐Xg\jYY S=ɢ u5',}ŻvLE2rޟX3$}0,:- 9dEl7B ~s.6%vׁWZl\_Z_ #y +J+se0 l{ W*r|8 ##m=s :nѥb5=Rx$Q5b^6ÌZQ8o#.5&GY(ݜo)C7 PC|&u $+>y20ѡċN'>!+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GG`x>|Ur&{Ƽ њmim}߫TNUݸ7sgƶ"P|B-(;l?^PHL׌mozl+ԃIy+svh$+> ;g`95gIDFs8(sw͛Ҭe۷`sF 7M( ū2ɯHa6eڄu0L"N$fǢI&|&Axg Δ\R P.M;X+LpZ.5>G[!^fNLq]B.[n*^ @.qVх̔NOMǒ= EyVYl[[e5 S E%6yΞ {6'0 ]-:t5aWS _8iI*Bv8`1 u6P6`~lmWNQl(ElO/Ouo>T l\{e6^}*dwD_ϑ99fEiy/ܸɼ'+xzGO?<L?{m_mY_d){PO& T ;oι;fzWbYy9>l$2\} XpwO|9`TD棶T[9Yy%(%*g5VtȅFdܖKLd\sa+ k_+7Zk׿>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000002704 00000 n 0000011909 00000 n 0000002645 00000 n 0000002494 00000 n 0000000015 00000 n 0000002474 00000 n 0000002769 00000 n 0000002892 00000 n 0000003882 00000 n 0000003163 00000 n 0000004876 00000 n 0000003570 00000 n 0000007977 00000 n 0000002810 00000 n 0000002840 00000 n 0000004106 00000 n 0000005193 00000 n 0000008237 00000 n 0000010548 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<8698D7B42896D1E67705F281C74286BB><8698D7B42896D1E67705F281C74286BB>] >> startxref 12027 %%EOF rrcov/vignettes/CovControl.pdf0000644000176200001440000002140412763517421016211 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xXM8WdrIm咭p ŘZjK1c*Fk|'%)|L?gd{N(OMdJ_<)*MIm?.XV;/qO$ϟ;kr%/`yc;<>g]KJ-@))'2Y|cSWכwo_ ;r Wpq|NP4arHjsneјŦh (;;Paisax.F* ;^JS׀1,J>T@5* P ڪP=@E=s:Ceu00/lMr Z`GxKCEx=t̮#6i>&Z;TYChSJÙ(6CVu|1QXP 0Ο0 ag|DܲnebpALִVGzkmR9d^F]Դ>*xg̮K|zc8ߔ\ DS1`b݅)40)JS뢐ܷMTԧ&Awr0**qo,`K@tPG`GPvG7nw36}`&,(%GaVŎOvEBAY]=86KQB7mp%}mqϘ=65U2 xu{ XLdf1?U o<4buXڜf4ͮڌ HKŐE2eRxo S,C;YOx>'4CnF_Y^2?z{OxB''D Dn<"U/a79hƺ;C !" ᝋ!=J?ɂ}}2Д2#endstream endobj 6 0 obj 1147 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 12 0 obj <> endobj 13 0 obj <> endobj 8 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 14 0 obj <>stream xTmPT .7ƽEBQdQM`i]v.|29EI j4%B Ѩ:""8Ŷ8Ilk(wNB3y<粌:aYvZ_z]6C*D)UxMf>S4 6A3WӕS]A /.] EgBe$AtQ)>Q \@%-/磔(_~ Y*\ 6# #ټ(^r$dEOQNH H [$F~GH"csU#ҸFh+W%_Ɉ"ZS3V9+4i*"ld葐,T2E(.m#TH= ow dȭHV2a!sXȁ )d _G4sbr{20:zqwdVSWm]Ӏ(0" \G)rdY{Tz]m]zp7ϙn7>6arُ)wJn_OMdҎe$,&bI<=j>r[qe4&$n",{c-<1jwn`~tMp߉Fᶎ_6ܺ3}7Tf╃B;(P\^%[or$a CТ^sO!>scx`X_G9~k1IN&>jC !s.Szlv]ecGx t{ eQcєoB $4!SgE&◒d5D =5_oF6z>t-6ê8^LG& 7p)wqu{cGŞ"9DqA$Q+Dzs!@Mc`;a!t"Py}}lڝ}E&gDsyxUTؒP\Hz}Fz1mY@%d{<G\pWg ˖sH/*zѧX iH> endobj 15 0 obj <>stream xUU TW*QZpEAqTYҠP!"uBBh#("1ATZn5eFyx2a2qΩsz)E4Hfٹciq8^`l<d-AҲquQ|FR^n3"@v͂8U:n$~5?3) QI&<0@#a*Zx?f>GDt 6`ssnjO/7=B.;-zIC ѫ' ^3uF$,Շ{p KL„[Myg mIڧ kto ޮRF{yo#=p]ن8h Mܘ=eaH ^ψ` 7Q6"Σ{nd 餶 ` Xڀ)%Z:9-Gk/o:L @֝u <LJ9oKѡ?I8 M*ܭ|7(JlU8,3XC0e`U$hA6{u3t= +C; 7#76n1 66x vK'ܶtIuXy#7 Ǭ=;Fu?/jtA>VK"߮ &9Uxip!&Ԋv`Q9촵y+QJ-:[}UܟO-ң'x-'87ְQ <ݗ YT_WaiPц/5&AbVM[#Ղ>液oMR%j8O {]r:)?W TpRUjͲ:9o娨صU(\E!1&-Z~ΰOP7m6^ ]0BA(Zbʘ={ :g#vIUQ)C@gvm:SqYĩmcˆ&`<1 %Zݢ8|Zx{%,?!В^kC9F_-.f&\6bn/xG]K!YE:ĜlͦK7>RG  *$ U-z\߯Y4j宅*btv-8dXi/799 xG!sY_rso,>H{ΏXT6>X)-JeX&oE-^e:өb==x endstream endobj 16 0 obj <>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 17 0000000000 65535 f 0000001463 00000 n 0000008353 00000 n 0000001404 00000 n 0000001252 00000 n 0000000015 00000 n 0000001232 00000 n 0000001528 00000 n 0000001640 00000 n 0000002321 00000 n 0000001930 00000 n 0000004331 00000 n 0000001569 00000 n 0000001599 00000 n 0000002566 00000 n 0000004632 00000 n 0000006992 00000 n trailer << /Size 17 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 8471 %%EOF rrcov/vignettes/mybiblio.bib0000644000176200001440000020363213300117774015712 0ustar liggesusers @STRING(AJS = "Austrian Journal of Statistics") @STRING(JASA = "Journal of the American Statistical Association") @STRING(JCGS = "Journal of Computational and Graphical Statistics") @STRING(JMA = "Journal of Multivariate Analysis") @STRING(CSDA = "Computational Statistics \& Data Analysis") @STRING(SMA-JISS = "Statistical Methods and Applications") @STRING(JSS = "Journal of Statistical Software") @STRING(WRR = "Water Resource Research") @STRING(JRSS-A = "Journal of the Royal Statistical Society: Series A (Statistics in Society)") @STRING(JRSS-B = "Journal of the Royal Statistical Society: Series B (Statistical Methodology)") @STRING(JRSS-C = "Journal of the Royal Statistical Society: Series C (Applied Statistics)") @STRING(JRSS-D = "Journal of the Royal Statistical Society: Series D (The Statistican)") @STRING(WILEY = "{John Wiley \& Sons}") %% The Annals of Mathematical Statistics was published between 1930 and 1972 %% by the Institute of Mathematical Statistics. The journal was superseded in %% 1973 by The Annals of Probability and The Annals of Statistics. @incollection{ agullo:96, author = {J. J. Agull\'o }, title = {Exact Iterative Computation of the Multivariate {M}inimum {V}olume {E}llipsoid Estimator with a Branch and Bound Algorithm}, booktitle = {Proceedings in Computational Statistics, COMPSTAT`96}, publisher = {Physica Verlag}, year = {1996}, address = {Heidelberg}, editor = {A. Prat}, pages = {175--180}, } @book{ alexander, author = {Alexander, Christopher and Ishikawa, Sara and Silverstein, Murray}, title = {A Pattern Language: Towns, Buildings, Construction (Center for Environmental Structure Series)}, year = {1977}, publisher = {Oxford University Press}, month = {August} } @BOOK{ anderson:58, AUTHOR = {T. W. Anderson}, TITLE = {An Introduction to Multivariate Statistical Analysis}, PUBLISHER= WILEY, ADDRESS = {New York}, YEAR = {1958} } @incollection{ atkinson:91, author = {Atkinson, A.C. and Weisberg, S.}, title = {Simulated Annealing for the Detection of Multiple Outliers Using Least Squares and Least Median of Squares Fitting}, booktitle = {Directions in Robust Statistics and Diagnostics, Part 1}, publisher = {Springer-Verlag}, pages = {7--20}, editor = {Stahel, W. and Weisberg, S.}, year = {1991}, } @BOOK{ atkinson:2000, AUTHOR = {Atkinson, A. C. and Riani, M.}, TITLE = {Robust Diagnostic Regression Analysis}, PUBLISHER = {Springer-Verlag}, YEAR = {2000}, ADDRESS = {New York }, } @ARTICLE{ blount:99, author = {Brian Blount and Siddhartha Chatterjee}, title = {An Evaluation of {J}ava for Numerical Computing}, journal = {Scientific Programing}, volume = {7}, number = {2}, year = {1999}, issn = {1058-9244}, pages = {97--110}, publisher = {IOS Press}, address = {Amsterdam, The Netherlands, The Netherlands}, } @incollection{ boisvert:98, author = "Ronald F. Boisvert and Jack J. Dongarra and Roldan Pozo and Karin A. Remington and G. W. Stewart", title = "Developing Numerical Libraries in {Java}", booktitle = "ACM 1998 Workshop on Java for High-Performance Network Computing", publisher = {ACM SIGPLAN}, pages = "??--??", year = "1998", url = "citeseer.ist.psu.edu/article/boisvert98developing.html" } @ARTICLE{ boisvert:2001, author = {Ronald F. Boisvert and Jos\'{e} Moreira and Michael Philippsen and Roldan Pozo}, title = {Java and Numerical Computing}, journal = {Computing in Science and Engineering}, volume = {3}, number = {2}, year = {2001}, pages = {18--24}, doi = {http://doi.ieeecomputersociety.org/10.1109/5992.908997}, url = "citeseer.ist.psu.edu/499657.html" } @ARTICLE{ brien:92, AUTHOR = "Peter C. O'Brien", TITLE = "Robust Procedures for Testing Equality of Covariance Matrices", JOURNAL = "Biometrics", PAGES = "819--827", YEAR = "1992", VOLUME = "48", NUMBER = "3" } @ARTICLE{ butler:1993, AUTHOR = "Butler, R.W. and Davies, P.L. and Jhun, M.", TITLE = "Asympthotic for the Minimum Covariance Determinant Estimator", JOURNAL = "The Annals of Statistics", PAGES = "1385-1401", YEAR = "1993", VOLUME = "21", } @ARTICLE{ campbell:80, AUTHOR = "Campbell, N. A.", TITLE = "Procedures in Multivariate Analysis {I}: Robust Covariance Estimation", JOURNAL = "Applied Statistics", PAGES = "231--237", YEAR = "1980", VOLUME = "29", } @ARTICLE{ campbell:82, AUTHOR = "Campbell, N. A.", TITLE = "Robust Procedures in Multivariate Analysis II: Robust Canonical Variate Analysis", JOURNAL = "Applied Statistics", PAGES = "1--8", YEAR = "1982", VOLUME = "31", NUMBER = "1", } @BOOK{ chambers:98, AUTHOR = {J. M. Chambers}, TITLE = {Programming with Data: A Guide to the S Language}, PUBLISHER= {Springer-Verlag}, YEAR = {1998}, ADDRESS = {New York} } @ARTICLE{ Chakraborty-Chaudhuri, AUTHOR = "Chakraborty, B. and Chaudhuri, P.", TITLE = "On the Use of Genetic Algorithm with Elitism in Robust and Nonparametric Multivariate Estimation", JOURNAL = "Austrian Journal of Statistics", PAGES = "13--27", YEAR = "2003", VOLUME = "30", } @ARTICLE{ chork, AUTHOR = "Chork, C. Y. and Rousseeuw, P. J. ", TITLE = "Integrating a High Beakdown Option into Discriminant Analysis in Exploration Geochemistry", JOURNAL = "Journal of Geochemical Exploration", PAGES = "191--203", YEAR = "1992", VOLUME = "43", } @ARTICLE{ croux-dehon:01, AUTHOR = "C. Croux and C. Dehon", TITLE = "Robust Linear Discriminant Analysis Using {S}-Estimators", JOURNAL = "The Canadian Journal of Statistics", PAGES = "473-492", YEAR = "2001", VOLUME = "29", } @ARTICLE{ croux-haesbroeck:99, AUTHOR = "Croux, C. and Haesbroeck, G.", TITLE = "Influence Function and Efficiency of the Minimum Covariance Determinant Scatter Matrix Estimator", JOURNAL = JMA, PAGES = "161-190", YEAR = "1999", VOLUME = "71", } @ARTICLE{ croux-Haesbroeck:2000, AUTHOR = {Croux, C. and Haesbroeck, G.}, TITLE = {Principal Components Analysis Based on Robust Estimators of the Covariance or Correlation Matrix: Influence Functions and Efficiencies}, JOURNAL = {Biometrika}, PAGES = {603--618}, YEAR = {2000}, VOLUME = {87}, NUMBER = {}, } @incollection{ croux-Ruiz-Gazen:1996, author = {Croux, C. and Ruiz-Gazen, A.}, title = {A Fast Algorithm for Robust Principal Components Based on Projection Pursuit}, booktitle = {Proceedings in Computational Statistics, COMPSTAT`96}, publisher = {Physica Verlag}, year = {1996}, address = {Heidelberg }, editor = {A. Prat}, pages = {211--216}, } @ARTICLE{ croux-Ruiz-Gazen:2005, AUTHOR = {Croux, C. and Ruiz-Gazen, A.}, TITLE = {High Breakdown Estimators for Principal Components: The Projection-pursuit Approach Revisited}, JOURNAL = JMA, PAGES = {206--226}, YEAR = {2005}, VOLUME = {95}, NUMBER = {}, } @ARTICLE{ croux-filzmoser-oliveira-pppca, AUTHOR = {Croux, C. and Filzmoser, P. and Oliveira, M.R.}, TITLE = {Algorithms for Projection-pursuit Robust Principal Component Analysis}, JOURNAL = {Chemometrics and Intelligent Laboratory Systems}, PAGES = {218--225}, YEAR = {2007}, VOLUME = {87}, NUMBER = {218}, } @ARTICLE{ croux-joossens:05, AUTHOR = "Croux, C. and Joossens, K.", TITLE = "Influence of Observations on the Misclassification Probability in Quadratic Discriminant Analysis", JOURNAL = JMA, PAGES = "384--403", YEAR = "2005", VOLUME = "96", } @ARTICLE{ Daigle:1992, AUTHOR = {G. Daigle and L. Rivest}, TITLE = {A Robust Biplot}, JOURNAL = {The Canadian Journal of Statistics}, PAGES = {241--255}, YEAR = {1992}, VOLUME = {20}, NUMBER = {3}, } @ARTICLE{ davidson:1998, author = {Russell Davidson and James G. Mackinnon}, title = {Graphical Methods for Investigating the Size and Power of Hypothesis Tests}, journal = {The Manchester School of Economic \& Social Studies}, year = {1998}, volume = {66}, NUMBER = {1}, pages = {1--26}, MONTH = {January}, NOTE = {available at http://ideas.repec.org/a/bla/manch2/v66y1998i1p1-26.html} } @ARTICLE{ davies:87, AUTHOR = "Davies, P.L.", TITLE = "Asymptotic Behavior of {S}-Estimators of Multivariate Location Parameters and Dispersion Matrices", JOURNAL = "The Annals of Statistics", PAGES = "1269--1292", YEAR = "1987", VOLUME = "15", } @ARTICLE{ dempster:1977, author = {A. P. Dempster and M. N. Laird and D. B. Rubin}, title = {Maximum Likelihood from Incomplete Data via the {EM} Algorithm}, journal = JRSS-B, volume = {39}, number = {}, year = {1977}, pages = {1--22}, } @ARTICLE{ devlin:81, author = {Devlin, S. J. and Gnanadesikan, R. and Kettenring, J. R.}, title = {Robust Estimation of Dispersion Matrices and Principal Components}, journal = JASA, volume = {76}, number = {}, year = {1981}, pages = {354--362}, } @ARTICLE{ filzmoser:2005, author = {Peter Filzmoser and Robert G. Garrett and Clemens Reimann}, title = {Multivariate Outlier Detection in Explortion Geochemistry}, journal = {Computers \& Geosciences}, volume = {31}, number = {}, year = {2005}, pages = {579--587}, } @incollection{ filzmoser:2008, author = {Peter Filzmoser and Sven Serneels and Ricardo Maronna and P. J. van Espen}, title = {Robust Multivariate Methods in Chemometrics}, booktitle = {Comprehensive Chemometrics}, publisher = {}, year = {2008}, address = {}, editor = {B. Walczak and R. T. Ferre and S. Brown}, pages = {}, NOTE = {to appear} } @ARTICLE{ friedman:89, AUTHOR = "Friedman, J. H. ", TITLE = "Regularized Discriminant Analysis", JOURNAL = "Journal of the American Statistical Association", PAGES = "165-175", YEAR = "1989", VOLUME = "84", } @ARTICLE{ gabriel, AUTHOR = {K. R. Gabriel}, TITLE = {The Biplot Graphical Display of Matrices with Application to Principal Component Analysis}, JOURNAL = {Biometrika}, PAGES = {453--467}, YEAR = {1971}, VOLUME = {58}, NUMBER = {}, } @ARTICLE{ Gelper-Croux, AUTHOR = {Sarah Gelper and Christophe Croux}, TITLE = {Multivariate Out-of-sample Tests for {G}ranger Causality}, JOURNAL = CSDA, PAGES = {3319-3329}, YEAR = {2007}, VOLUME = {51}, } @ARTICLE{ Gnanadesikan-Kettenring:1972, AUTHOR = "R. Gnanadesikan and J. R. Kettenring", TITLE = "Robust Estimates, Residuals, and Outlier Detection with Multiresponse Data", JOURNAL = "Biometrics", PAGES = "81--124", YEAR = "1972", VOLUME = "28", NUMBER = {} } %\bibitem[Van Gelder and Neykov (1998)]{GelderNeykov98} %Van Gelder, P. H. A. J. M. and Neykov, N. M. (1998), Regional %Frequency Analysis of Extreme Water Levels Along the Dutch Coast Using %L-moments: Some Preliminary Results. In: \textit{Stochastic Models of %Hydrological Processes and their Applications to Problems of %Environmental Preservation}, NATO Advanced Workshop, Moskow, Russia, %23-27 November 1998, 14--20. %\bibitem[Van Gelder et al. (2000)]{VanGelder00} %Van Gelder, P. H. A. J. M., Neykov, N. M., Neytchev, P. N., Vrijling, %J. K. and Chbab, H. (2000), Probability Distributions of Annual %Maximum River Discharges in North-western and Central Europe. In: %\textit{Foresight and Precaution}, Cottam, M. P., D.V. Harvey, R.P. %Pape and J. Tait (eds.), A. A. Balkema publishing, 899--903. @incollection{ habemma:74, author = {Habemma, J.D.F, Hermans, J. and van den Broek, K.}, title = {Stepwise Discriminant Analysis Program Using Density Estimation}, booktitle = {Proceedings in Computational Statistics, COMPSTAT`1974}, publisher = {Physica Verlag}, year = {1974}, address = {Heidelberg }, editor = {}, pages = {101-110}, } @ARTICLE{ hadi:94, author = {Hadi, A.S. and Simonoff, J.F.}, title = {Procedures for Identification of Multiple Outliers in Linear Models}, journal = JASA, volume = {88}, number = {}, year = {1994}, pages = {1264--1272}, } @BOOK{ hampel:1986, AUTHOR = {Hampel,F.R. and Ronchetti, E.M. and Rousseeuw P. J. and Stahel, W. A.}, TITLE = {Robust Statistics. The Approach Based on Infuence Functions}, PUBLISHER= WILEY, YEAR = 1986 } @ARTICLE{ hardin:2005, AUTHOR = {Hardin, J. and Rocke, D.M.}, TITLE = {The Distribution of Robust Distances}, JOURNAL = JCGS, PAGES = {910--927}, YEAR = {2005}, VOLUME = {14}, } @ARTICLE{ hawkins:94, author = {Douglas M. Hawkins}, title = {The Feasible Solution Algorithm for the Minimum Covariance Determinant Estimator in Multivariate Data}, journal = CSDA, volume = {17}, number = {2}, year = {1994}, issn = {0167-9473}, pages = {197--210}, publisher = {Elsevier Science Publishers B. V.}, address = {Amsterdam, The Netherlands, The Netherlands}, } @ARTICLE{ hawkins:97, AUTHOR = "Hawkins, D. M. and McLachlan, G. J.", TITLE = "High Breakdown Linear Discriminant Analysis", JOURNAL = "Journal of the American Statistical Association", PAGES = "136-143", YEAR = "1997", VOLUME = "92", } @ARTICLE{ hawkins:99, author = {Douglas M. Hawkins and David J. Olive}, title = {Improved Feasible Solution Algorithms for High Breakdown Estimation}, journal = CSDA, volume = {30}, number = {1}, year = {1999}, issn = {0167-9473}, pages = {1--11}, publisher = {Elsevier Science Publishers B. V.}, address = {Amsterdam, The Netherlands, The Netherlands}, } @ARTICLE{ he:2000, AUTHOR = "He, X. and Fung, W.K.", TITLE = "High Breakdown Estimation for Multiple Populations with Applications to Discriminant Analysis", JOURNAL = JMA, PAGES = "151-162", YEAR = "2000", VOLUME = "72", } @ARTICLE{ he:1996, AUTHOR = "Xuming He and Gang Wang", TITLE = "Cross-checking using the Minimum Volume Ellipsoid Estimator", JOURNAL = "Statistica Sinica", PAGES = "367--374", YEAR = "1996", VOLUME = "6", } @ARTICLE{ hubert-ROBPCA:2005, AUTHOR = "M. Hubert and P. J. Rousseeuw and Karlien {Vanden Branden}", TITLE = "ROBPCA: A New Approach to Robust Principal Component Analysis", JOURNAL = "Technometrics", PAGES = "64-79", YEAR = "2005", VOLUME = "47", } @ARTICLE{ hubert:04, AUTHOR = "Hubert, M. and Van Driessen, K.", TITLE = "Fast and Robust Discriminant Analysis", JOURNAL = CSDA, PAGES = "301-320", YEAR = "2004", VOLUME = "45", } @ARTICLE{ hubert:2007-CV, AUTHOR = {Mia Hubert and Sanne Engelen}, TITLE = {Fast Cross-Validation of High Breakdown Resampling Methods for {PCA}}, JOURNAL = CSDA, PAGES = {5013-5024}, YEAR = {2007}, VOLUME = {51}, } @incollection{ hubert-actuar, author = {M. Hubert and P. J. Rousseeuw and S. van Aelst}, title = {Robustness}, booktitle = {Encyclopedia of Actuarial Sciences}, publisher = WILEY, ADDRESS = {New York}, year = {2004}, editor = {J. Teugels and B. Sundt}, pages = {1515--1529} } @incollection{ hubert:2005, author = {M. Hubert and P. J. Rousseeuw and S. van Aelst}, title = {Multivariate Outlier Detection and Robustness}, booktitle = {Data Mining and Data Visualization, Handbook of Statistics, vol. 24}, publisher = {Elsevier, North-Holland}, year = {2005}, editor = {C. R. Rao and E. J. Wegman and J. L. Solka}, pages = {263--302} } @ARTICLE{ hubert:2006, AUTHOR = {Rousseeuw, P. J. and Debruyne, M. and Engelen, S. and Hubert, M}, TITLE = {Robustness and Outlier Detection in Chemometrics}, JOURNAL = {CRITICAL REVIEWS IN ANALYTICAL CHEMISTRY}, PAGES = {221--242}, YEAR = {2006}, VOLUME = {36}, } @TECHREPORT{ hubert:2007TR-PCA, AUTHOR = {M. Hubert and P. J. Rousseeuw and T. Verdonck}, TITLE = {Robust {PCA} for Skewed Data}, INSTITUTION = {Katholieke Universitet Leuven}, TYPE = {Technical Report}, NUMBER = {TR-07-03}, YEAR = {2007}, NOTE = {Department of Mathematics}, } @ARTICLE{ hubert:2008-PCA, AUTHOR = {M. Hubert and P. J. Rousseeuw and T. Verdonck}, TITLE = {Robust {PCA} for Skewed Data and its Outlier Map}, JOURNAL = CSDA, PAGES = {2264--2274}, YEAR = {2009}, VOLUME = {53}, NUMBER = {6}, } @ARTICLE{ hubert:2008-outlier, AUTHOR = {Mia Hubert and Stephan {Van der Veeken}}, TITLE = {Outlier Detection for Skewed Data}, JOURNAL = {Journal of Chemometrics}, PAGES = {235--246}, YEAR = {2008}, VOLUME = {22}, NUMBER = {3--4}, } @ARTICLE{ hubert:2008, AUTHOR = {Mia Hubert and P. J. Rousseeuw and S. van Aelst}, TITLE = {High-Breakdown Robust Multivariate Methods}, JOURNAL = {Statistical Science}, PAGES = {92--119}, YEAR = {2008}, VOLUME = {23}, NOTE = {} } @MISC{ hubert-debruyne:2008, AUTHOR = {M. Debruyne and M. Hubert}, TITLE = {The Influence Function of the {S}tahel-{D}onoho Covariance Estimator of Smallest Outlyingness}, JOURNAL = {Statistics and Probability Letters}, PAGES = {}, YEAR = {}, VOLUME = {}, NOTE = {in press}, doi = {http://dx.doi.org/doi:10.1016/j.spl.2008.08.006} } @ARTICLE{ hubert-engelen:2004, AUTHOR = {S. Engelen and M. Hubert}, TITLE = {Robust {PCA} and Classification in Biosciences}, JOURNAL = {Bioinformatics}, PAGES = {1728--1736}, YEAR = {2004}, VOLUME = {20}, NOTE = {}, } @ARTICLE{ H90, AUTHOR = {Hosking, J. R. M.}, TITLE = {L-moments: Analysis and estimation of distributions using linear combinations of order statistics}, JOURNAL = JRSS-B, PAGES = {105--124}, YEAR = {1990}, VOLUME = {52}, } @ARTICLE{ HW93, AUTHOR = "Hosking, J. R. M. and J. R. Wallis", TITLE = "Some statistics useful in {R}egional {F}requency {A}nalysis", JOURNAL = WRR, PAGES = "271--281", YEAR = "1993", VOLUME = "29", } @BOOK{ HW97, AUTHOR = "Hosking, J. R. M. and J. R. Wallis", TITLE = "Regional Frequency Analysis: An Approach Based on L-moments", PUBLISHER = "Cambridge University Press", YEAR = "1997", } @incollection{ jennrich:77, author = {Jennrich, R. I.}, title = {Stepwise Discriminant Analysis}, booktitle = {Statistical Methods for Digital Computers}, publisher = WILEY, year = {1977}, address = {New York}, editor = {K. Enslein, A. Ralston and H.S.Wilf}, pages = {76--95}, } @BOOK{ johnson-wichern, AUTHOR = "R. A. Johnson and D. W. Wichern", TITLE = "Applied Multivariate Statistical Analysis", PUBLISHER = "Prentice Hall", YEAR = "2002", ADDRESS = "International", NOTE = "fifth edition" } @inproceedings{ karnel:1991, author = {Gerald Karnel}, title = {Robust canonical correlation and correspondence analysis}, booktitle = {ICOSCO-I: conference proceedings on The frontiers of statistical scientific theory \& industrial applications (Vol. II)}, year = {1991}, isbn = {0-935950-28-1}, pages = {335--354}, location = {Cesme, Izmir, Turkey}, publisher = {American Sciences Press}, address = {Syracuse, NY, USA}, } @ARTICLE{ krusinska:88, AUTHOR = "Krusinska, E. and Liebhart, J.", TITLE = "Robust Selection of the most Discriminative Variables in the Dichotomous Problem with Application to some Respiratory Desease Data", JOURNAL = "Biometrical Journal", PAGES = "295--304", YEAR = "1988", VOLUME = "30", } @ARTICLE{ krusinska:88a, AUTHOR = "Krusinska, E.", TITLE = "Robust methods in discriminant analysis", JOURNAL = "Rivista di Statistica Applicada", PAGES = "239--253", YEAR = "1988", VOLUME = "21", NUMBER = "3" } @ARTICLE{ krusinska:89, AUTHOR = "Krusinska, E. and Liebhart, J.", TITLE = "Some Further Remarks on the Robust Selection of Variables in Discriminant Analysis", JOURNAL = "Biometrical Journal", PAGES = "227--233", YEAR = "1989", VOLUME = "31", } @ARTICLE{ kumar:2005, AUTHOR = "Kumar, R. and Chatterjee, C.", TITLE = "Regional flood frequency analysis using L-moments for North Brahmaputra region of India", JOURNAL = "Journal of Hydrologic Engineering, American Society of Civil Engineers", PAGES = "1--7", YEAR = "2005", VOLUME = "10", } @ARTICLE{ lachenbruch-michey:68, AUTHOR = "Lachenbruch, P. A. and Michey, M. R.", TITLE = "Estimation of Error Rates in Discriminant Analysis", JOURNAL = "Technometrics", PAGES = "1--11", YEAR = "1968", VOLUME = "10", } @BOOK{ lachenbruch:1975, AUTHOR = "Lachenbruch, P. A.", TITLE = "Discriminant Analysis", PUBLISHER = "Hafner", YEAR = "1975", ADDRESS = "New York", } @ARTICLE{ li:1985, author = {G. Li and Z. Chen}, title = {Projection-Pursuit Approach to Robust Dispersion Matrices and Principal Components: Primary Theory and {M}onte {C}arlo}, journal = JASA, volume = {80}, number = {}, year = {1985}, pages = {759--766}, } @ARTICLE{ LittleAndSmith:87, AUTHOR = "Little, R. J. A. and Smith, P. J.", TITLE = "Editing and imputation for quantitative data", JOURNAL = "Journal of the American Statistical Association", PAGES = "58--69", YEAR = "1987", VOLUME = "82", } @BOOK{ LittleAndRubin:1987, AUTHOR = {R. J. A. Little and D. B. Rubin}, TITLE = {Statistical Analysis with Missing Data}, publisher = WILEY, YEAR = "1987", ADDRESS = "New York", } @ARTICLE{ Little:88, AUTHOR = "Little, R. J. A.", TITLE = "Robust estimation of the mean and covariance matrix from data with missing values", JOURNAL = "Applied Statistics", PAGES = "23--38", YEAR = "1988", VOLUME = "37", } @ARTICLE{ boente-fraiman:1999, AUTHOR = "Boente, G. and Fraiman, R.", TITLE = "Discussion of 'Robust principal components for functional data' by Locantore et al.", JOURNAL = "Test", PAGES = "1--28", YEAR = "1999", VOLUME = "8", } @ARTICLE{ locantore:1999, AUTHOR = "Locantore, N. and Marron, J.S. and Simpson, D.G. and Tripoli, N. and Zhang, J.T. and Cohen, K.L.", TITLE = "Robust Principal Components for Functional Data", JOURNAL = "Test", PAGES = "1--28", YEAR = "1999", VOLUME = "8", } @ARTICLE{ lopuhaa:1989, AUTHOR = "H. P. {Lopuha\"a}", TITLE = "On the Relation Between {S}-Estimators and {M}-estimators of Multivariate Location and Covariance", JOURNAL = "The Annals of Statistics", PAGES = "1662--1683", YEAR = "1989", VOLUME = "17", } @ARTICLE{ lopuhaa-rousseeuw, AUTHOR = "{Lopuha\"a}, H. P. and Rousseeuw, P. J.", TITLE = "Breakdown Points of Affine Equivariant Estimators of Multivariate Location and Covariance Matrices", JOURNAL = "The Annals of Statistics", PAGES = "229--248", YEAR = "1991", VOLUME = "19", } @BOOK{ Marazzi:1993, AUTHOR = "A. Marazzi", TITLE = "Algorithms, Routines and S Functions for Robust Statistics", PUBLISHER = "Wadsworth and Brooks/Cole", YEAR = "1993", ADDRESS = "", } @ARTICLE{ Marazzi:2006, AUTHOR={ Alfio Marazzi and Voctor Yohai}, TITLE={Robust Box-Cox transformations based on minimum residual autocorrelation}, JOURNAL=CSDA, YEAR=2006, VOLUME={50}, NUMBER={10}, PAGES={2752--2768}, MONTH={June}, NOTE={available at http://ideas.repec.org/a/eee/csdana/v50y2006i10p2752-2768.html} } @BOOK{ mardia, AUTHOR = {K. V. Mardia and J. T. Kent and J. M. Bibby}, TITLE = {Multivariate Analysis}, PUBLISHER= {Academic Press}, ADDRESS = {London}, YEAR = 1979 } @ARTICLE{ maronna:95, AUTHOR = "Maronna, R. A. and Yohai, V. J.", TITLE = "The Behavoiur of the {S}tahel-{D}onoho Robust Multivariate Estimator", JOURNAL = "Journal of the American Statistical Association", PAGES = "330--341", YEAR = "1995", VOLUME = "90", } @incollection{ maronna:98, author = {Maronna, R. A. and Yohai, V. J.}, title = {Robust Estimation of Multivariate Location and Scatter}, booktitle = {Encyclopedia of Statistical Sciences, Updated volume 2}, publisher = WILEY, year = {1998}, address = {New York}, editor = {S. Kotz, C. Read and D. Banks}, pages = {589--596}, } @ARTICLE{ maronna:2002, AUTHOR = "R. A. Maronna and R. H. Zamar", TITLE = "Robust Estimation of Location and Dispersion for High-Dimensional Datasets", JOURNAL = "Technometrics", PAGES = "307--317", YEAR = "2002", VOLUME = "44", } @ARTICLE{ maronna:2005, AUTHOR = "Maronna, R. A.", TITLE = "Principal Components and Orthogonal Regression Based on Robust Scales", JOURNAL = "Technometrics", PAGES = "264--273", YEAR = "2005", VOLUME = "47", } @BOOK{ maronna:2006, AUTHOR = "R. A. Maronna and D. Martin and V. Yohai", TITLE = "Robust Statistics: Theory and Methods", PUBLISHER = WILEY, YEAR = "2006", ADDRESS = "New York", } @BOOK{ mclachlan:1992, AUTHOR = "MacLachlan, Geoffrey J.", TITLE = "Discriminant analysis and statistical pattern recognition", PUBLISHER = WILEY, YEAR = "1992", ADDRESS = "New York", } @ARTICLE{ moller, author = {S. Frosch Moller and J. von Frese and R. Bro}, title = {Robust methods for multivariate data analysis}, journal = {JOURNAL OF CHEMOMETRICS}, volume = {19}, number = {}, year = {2005}, pages = {549--563}, publisher = {}, address = {}, } @article{ morgenthaler:2007, author = {Stephan Morgenthaler}, title = {A Survey of Robust Statistics}, journal = SMA-JISS, month = {February}, number = {3}, pages = {271--293}, publisher = {Springer-Verlag}, volume = {15}, year = {2007} } @ARTICLE{ moreira:2000, author = {J. E. Moreira and S. P. Midkiff and M. Gupta and P. V. Artigas and M. Snir and R. D. Lawrence}, title = {Java programming for high-performance numerical computing}, journal = {IBM Systems Journal}, volume = {39}, number = {1}, year = {2000}, issn = {0018-8670}, pages = {21--56}, publisher = {IBM Corp.}, address = {Riverton, NJ, USA}, } @ARTICLE{ naga:1990, AUTHOR = {R. Naga and G. Antille}, TITLE = {Stability of Robust and Non-robust Principal Component Analysis}, JOURNAL = CSDA, PAGES = {169--174}, YEAR = {1990}, VOLUME = {10}, } @ARTICLE{ Nath-Pavur, AUTHOR = "Nath, R. and Pavur, R.", TITLE = "A new Statistic in the One Way Multivariate Analysis of Variance", JOURNAL = CSDA, PAGES = "297--315", YEAR = "1985", VOLUME = "2", } @ARTICLE{ neyko:2003, AUTHOR = "Mueller, Ch. and Neykov, N.M.", TITLE = "Breakdown Points of the Trimmed Likelihood and Related Estimators in Generalized Linear Models", JOURNAL = "Journal of Statistical Planning and Inference", PAGES = "503--519", YEAR = "2003", VOLUME = "116", } @ARTICLE{ pardoe-yin-cook, AUTHOR = "Iain Pardoe and Xiangrong Yin and Dennis R. Cook", TITLE = "Graphical Tools for Quadratic Discriminant Analysis", JOURNAL = "Technometrics", PAGES = "172--183", YEAR = "2007", VOLUME = "49", } @ARTICLE{ pena:01, AUTHOR = "Pe\~{n}a, D. and Prieto, F.J.", TITLE = "Multivariate Outlier Detection and Robust Covariance Matrix Estimation", JOURNAL = "Technometrics", PAGES = "286--301", YEAR = "2001", VOLUME = "43", } @ARTICLE{ pison:2002, AUTHOR = "Pison, G. and Van Aelst, S. and Willems, G.", TITLE = "Small Sample Corrections for {LTS} and {MCD}", JOURNAL = "Metrika", PAGES = "111--123", YEAR = "2002", VOLUME = "55", } @BOOK{ Puri-Sen, AUTHOR ="Puri, M.L. and Sen, P.K.", TITLE ="Nonparametric Methods in Multivariate Analysis", PUBLISHER=WILEY, YEAR = "1971", PAGES = "184--186", } @ARTICLE { rao:59, author = {Rao, C.R.}, title = {Some Problems Involving Linear Hypotheses in Multivariate Analysis}, year = {1959}, volume = {46}, pages = {49--58}, journal = {Biometrika} } @Book{ Sarkar:2008, title = {\pkg{lattice}: Multivariate Data Visualization with \proglang{R}}, author = {Deepayan Sarkar}, address = {New York}, publisher = {Springer-Verlag}, year = {2008} } @ARTICLE{ reaven-miller, AUTHOR = "Reaven, G. M. and Miller, R. G.", TITLE = "An Attempt to Define the Nature of Chemical Diabetes Using a Multidimensional Analysis", JOURNAL = "Diabetologia", PAGES = "17--24", YEAR = "1979", VOLUME = "16" } @ARTICLE{ reimann:2007, AUTHOR = "Reimann, C. and Arnoldussen, A. and Boyd, R. and Finne, Tor Erik and Koller, F and Nordgullen, O and Englmair, P.", TITLE = "Element contents in leaves of four plant species (birch, mountain ash, fern and spruce) along anthropogenic and geogenic concentration gradients", JOURNAL = "Science of the Total Environment", PAGES = "416--433", YEAR = "2007", VOLUME = "377", } @MISC{ riani:2008, title = {Controlling the Size of Multivariate Outlier Tests with the {MCD} Estimator of Scatter}, author = {Andrea Cerioli and Marco Riani and Anthony C. Atkinson}, abstract = {Abstract\ \ Multivariate outlier detection requires computation of robust distances to be compared with appropriate cut-off points. In this paper we propose a new calibration method for obtaining reliable cut-off points of distances derived from the MCD estimator of scatter. These cut-off points are based on a more accurate estimate of the extreme tail of the distribution of robust distances. We show that our procedure gives reliable tests of outlyingness in almost all situations of practical interest, provided that the sample size is not much smaller than 50. Therefore, it is a considerable improvement over all the available MCD procedures, which are unable to provide good control over the size of multiple outlier tests for the data structures considered in this paper.}, journal = {Statistics and Computing}, volume = {}, number = {}, year = {2008}, pages = {}, doi = {http://dx.doi.org/10.1007/s11222-008-9096-5}, posted-at = {2008-11-21 04:06:43}, url = {http://dx.doi.org/10.1007/s11222-008-9096-5} } @ARTICLE{ ronchetti:85, AUTHOR = "Ronchetti, E.", TITLE = "Robust Model Selection in Regression", JOURNAL = "Statistics and Probability Letters", PAGES = "21--23", YEAR = "1985", VOLUME = "3", } @ARTICLE{ rousseeuw:84, AUTHOR = "Rousseeuw, P. J.", TITLE = "Least Median of Squares Regression", JOURNAL = "Journal of the American Statistical Association", PAGES = "851--857", YEAR = "1984", VOLUME = "79", } @incollection{ rousseeuw:85, author = {Rousseeuw, P. J.}, title = {Multivariate Estimation with High Breakdown Point}, booktitle = {Mathematical Statistics and Applications Vol. B}, publisher = {Reidel Publishing}, year = {1985}, address = {Dordrecht}, editor = {W. Grossmann and G. Pflug and I. Vincze and W. Wertz}, pages = {283--297}, } @BOOK{ rousseeuw-leroy, AUTHOR = "Rousseeuw, P. J. and Leroy, A. M.", TITLE = "Robust Regression and Outlier Detection", PUBLISHER = WILEY, YEAR = "1987", ADDRESS = "New York", } @incollection{ Rousseeuw-van-Zomeren, author = {Rousseeuw, P. J. and van Zomeren, B. C.}, title = {Robust Distances: Simulation and Cutoff Values}, booktitle = {Directions in Robust Statistics and Diagnostics, Part II}, publisher = {Springer-Verlag}, year = {1991}, address = {New York}, editor = {W. Stahel and S. Weisberg}, pages = {}, } @ARTICLE{ rousseeuw-vandriessen, AUTHOR = "Rousseeuw, P. J. and Van Driessen, K", TITLE = "A Fast Algorithm for the Minimum Covariance Determinant Estimator", JOURNAL = "Technometrics", PAGES = "212--223", YEAR = "1999", VOLUME = "41", } @ARTICLE{ rousseeuw-vandriessen:LTS, AUTHOR = {Rousseeuw, P. J. and Van Driessen, K.}, TITLE = {Computing {LTS} Regression for Large Data Sets}, JOURNAL = {Data Mining and Knowledge Discovery}, month = {January}, number = {1}, PAGES = {29--45}, YEAR = {2006}, VOLUME = {12}, publisher = {Springer-Verlag}, } @ARTICLE{ rousseeuw-willems:2002, AUTHOR = "Willems, G. and Pison, G. and Rousseeuw, P. J. and Van Aelst, S.", TITLE = "A Robust {Hotelling} Test", JOURNAL = "Metrika", PAGES = "125--138", YEAR = "2002", VOLUME = "55", } @ARTICLE{ rocke:93, AUTHOR = "Woodruff, D. L. and Rocke, D. M. ", TITLE = "Heuristic Search Algorithms for the Minimum Volume Ellipsoid", JOURNAL = JCGS, PAGES = "69--95", YEAR = "1993", VOLUME = "2", } @ARTICLE{ rocke:94, AUTHOR = "Woodruff, D. L. and Rocke, D. M.", TITLE = "Computable Robust Estimation of Multivariate Location and Shape in High Dimension Using Compound Estimators", JOURNAL = "Journal of the American Statistical Association", PAGES = "888--896", YEAR = "1994", VOLUME = "89", } @ARTICLE{ rocke:96, AUTHOR = "Rocke, D. M. and Woodruff, D. L.", TITLE = "Identification of Outliers in Multivariate Data", JOURNAL = "Journal of the American Statistical Association", PAGES = "1047--1061", YEAR = "1996", VOLUME = "91", } @ARTICLE{ rocke:96a, AUTHOR = "Rocke, D. M.", TITLE = "Robustness Properties of {S}-Estimators of Multivariate Location and Shape in High Dimension", JOURNAL = "The Annals of Statistics", PAGES = "1327--1345", YEAR = "1996", VOLUME = "24", } @ARTICLE{ rocke:97, AUTHOR = "Rocke, D. M. and Woodruff, D. L.", TITLE = "Robust Estimation of Multivariate Location and shape", JOURNAL = "Journal of Statistical Planning and Inference", PAGES = "245--255", YEAR = "1997", VOLUME = "57", } @ARTICLE{ rocke:2005, AUTHOR = "Shagufta Aslam and David M. Rocke", TITLE = "A Robust Testing Procedure for the Equality of Covariance Matrices", JOURNAL = CSDA, PAGES = "863--874", YEAR = "2005", VOLUME = "49", } @article{ rubin:76, author = {Rubin, D. B.}, title = {Inference and Missing Data}, year = {1976}, volume = {63}, pages = {581--592}, journal = {Biometrika} } @ARTICLE{ ruppert:1992, AUTHOR = {D. Ruppert}, TITLE = {Computing {S}-Estimators for Regression and Multivariate Location/Dispersion}, JOURNAL = JCGS, PAGES = {253--270}, YEAR = {1992}, VOLUME = {1}, } @BOOK{ friendly-categorical, AUTHOR = {Michael Friendly}, TITLE = {Visualizing Categorical Data}, YEAR = {2000}, PUBLISHER = {SAS Insitute}, ADDRESS = {Carey, NC} } @MISC{ sas-robcov, AUTHOR = "Michael Friendly", TITLE = "SAS Graphic Programs and Macros", JOURNAL = "", YEAR = "2007", HOWPUBLISHED = "http://www.math.yorku.ca/SCS/sasmac/", } @ARTICLE{ salibian:2005, AUTHOR = "Salibian-Barrera, M. and Yohai, V. J.", TITLE = "A Fast Algorithm for {S}-regression Estimates", JOURNAL = JCGS, PAGES = "414--427", YEAR = "2006", VOLUME = "15", } @ARTICLE{ serneels-pca-missing:2008, author ={Serneels, Sven and Verdonck, Tim}, title ={Principal Component Analysis for Data Containing Outliers and Missing Elements}, journal =CSDA, year =2008, volume ={52}, number ={3}, pages ={1712--1727}, month ={January}, url ={http://ideas.repec.org/a/eee/csdana/v52y2008i3p1712-1727.html} } @ARTICLE{ Siani-Peretti, AUTHOR = "Siani, C. and de Peretti, C.", TITLE = "Analysing the Performance of Bootstrap Neural Tests for Conditional Heteroskedasticity in {ARCH-M} Models", JOURNAL = CSDA, PAGES = "2442--2460", YEAR = "2006", VOLUME = "51", } @ARTICLE{ song:2000, AUTHOR = "Moon Sup Song and Young Joo Yoon and Youngjo Lee", TITLE = "A Study on High Breakdown Discriminant Analysis: A Monte Carlo Simulation", JOURNAL = "The Korean Communications in Statistics", PAGES = "225--232", YEAR = "2000", VOLUME = "7", } @misc{ song-study-discrimination, author = "Moon Sup Song", title = "A Study on Robust Two-Group Discrimination Based on GM-Estimators", url = "citeseer.ist.psu.edu/418237.html" } @article{ jain-statistical-pattern-recognition, author = "Anil K. Jain and Robert P. W. Duin and Jianchang Mao", title = "Statistical Pattern Recognition: A Review", journal = "IEEE Transactions on Pattern Analysis and Machine Intelligence", volume = "22", number = "1", pages = "4--37", year = "2000", url = "citeseer.ist.psu.edu/jain00statistical.html" } @TECHREPORT{ stahel-phd:81, AUTHOR = {Stahel, W. A.}, TITLE = {Robuste Sch\"atzungen: {I}nfinitesimale Optimalit\"at und Sch\"atzungen von Kovarianzmatrizen}, TYPE = {Ph.D. thesis no. 6881}, INSTITUTION = {Swiss Federal Institute of Technology ({ETH})}, ADDRESS = {Z\"urich}, YEAR = {1981}, URL = {http://e-collection.ethbib.ethz.ch/view/eth:21890}, } @TECHREPORT{ stahel:81, AUTHOR = {Stahel, W. A.}, TITLE = {Breakdown of Covariance Estimators}, INSTITUTION = {ETH Zurich}, TYPE = {Research Report}, NUMBER = {31}, YEAR = {1981}, NOTE = {{F}achgruppe f{\"u}r {S}tatistik}, } @TECHREPORT{ donoho:82, AUTHOR = {D. L. Donoho}, TITLE = {Breakdown Properties of Multivariate Location Estimators}, INSTITUTION = {Harvard University}, ADDRESS = {Boston}, NUMBER = {}, YEAR = {1982}, URL = {http://www-stat.stanford.edu/~donoho/Reports/Oldies/BPMLE.pdf}, } @incollection{ donoho-huber, AUTHOR = {D. L. Donoho and P. J. Huber}, TITLE = {The Notion of Breakdown Point}, BOOKTITLE = {A Festschrift for Erich Lehmann}, ADDRESS = {Wadsworth, Belmont, CA}, YEAR = {1983}, EDITOR = {P. Bikel and K. Doksum and J. L. Hodges} } @article{ stromberg:2004, author = {Arnold Stromberg}, title = {Why Write Statistical Software? {T}he Case of Robust Statistical Methods}, journal = JSS, volume = {10}, number = {5}, pages = {1--8}, day = {26}, month = {4}, year = {2004}, URL = {http://www.jstatsoft.org/v10/i05}, } @incollection{ todorov:90, author = {Todorov, V. and Neykov, N.M. and Neytchev, P.N.}, title = {Robust Selection of Variables in the Discriminant Analysis Based on {MVE} and {MCD} Estimators}, booktitle = {Proceedings in Computational Statistics, COMPSTAT 1990}, publisher = {Physica Verlag}, year = {1990}, address = {Heidelberg}, editor = {Konstantin Momirovic and Vesna Mildner}, pages = {193--198}, } @ARTICLE{ todorov:92, AUTHOR = "Todorov, V.", TITLE = "Computing the Minimum Covariance Determinant Estimator ({MCD}) by Simulated Annealing", JOURNAL = CSDA, PAGES = "515--525", YEAR = "1992", VOLUME = "14", } @ARTICLE{ todorov:94, AUTHOR = "Todorov, V. and Neykov, N.M. and Neytchev, P.N.", TITLE = "Robust Two-group Discrimination by Bounded Influence Regression", JOURNAL = CSDA, PAGES = "289--302", YEAR = "1994", VOLUME = "17", } @incollection{ todorov-compstat:94, author = {Todorov, V. and Neykov, N.M. and Neytchev, P.N.}, title = {Stability of (High-breakdown Point) Robust Principal Components Analysis}, booktitle = {Short Communications in Computational Statistics, COMPSTAT 1994}, publisher = {Physica Verlag}, year = {1994}, address = {Heidelberg}, editor = {R. Dutter and W. Grossmann}, pages = {90--92}, } @incollection{ todorov:02, author = {Todorov, Valentin}, title = {Java and Computing for Robust Statistics}, booktitle = {Developments in Robust Statistics}, publisher = {Physica Verlag}, year = {2003}, address = {Heidelberg}, editor = {R. Dutter and P. Filzmoser and U. Gather and P. J. Rousseeuw}, pages = {404--416}, } @ARTICLE{ todorov-ldastp, AUTHOR = {Todorov, Valentin}, TITLE = {Robust Selection of Variables in Linear Discriminant Analysis}, JOURNAL = SMA-JISS, PAGES = {395--407}, YEAR = {2007}, VOLUME = {15}, } @ARTICLE{ todorov-roblda, AUTHOR = "Valentin Todorov and Ana M. Pires", TITLE = "Comparative Performance of Several Robust Linear Discriminant Analysis Methods", JOURNAL = "REVSTAT Statistical Journal", PAGES = "63--83", YEAR = "2007", VOLUME = "5", } @ARTICLE{ todorov-neyko-etal, AUTHOR = "Neykov, N. M. and Neytchev, P. N. and Van Gelder, P. H. A. J. M. and Todorov, V.", TITLE = "Robust Detection of Discordant Sites in Regional Frequency Analysis", JOURNAL = WRR, PAGES = "W06417", YEAR = "2007", VOLUME = "43", } @ARTICLE{ todorov-manova, AUTHOR = {Valentin Todorov and Peter Filzmoser}, TITLE = {Robust Statistic for the One-way {MANOVA}}, JOURNAL = CSDA, PAGES = {37--48}, YEAR = {2010}, VOLUME = {54}, } @MISC{ todorov-cf, AUTHOR = "Valentin Todorov", TITLE = "A Note on the {MCD} Consistency and Small Sample Correction Factors", JOURNAL = "", PAGES = "", YEAR = "2008", VOLUME = "", NOTE = "Unpublished manuscript, in preparation", } @MISC{ todorov-constructors, AUTHOR = "Peter Ruckdeschel and Matthias Kohl and Valentin Todorov", TITLE = "Structured User Interfaces via Generating Functions ", JOURNAL = "", PAGES = "", YEAR = "2009", VOLUME = "", NOTE = "Unpublished manuscript, in preparation", } @MANUAL{ todorov-rrcov, AUTHOR = {Valentin Todorov}, TITLE = {\pkg{rrcov}: {S}calable Robust Estimators with High Breakdown Point}, YEAR = {2009}, NOTE = {\proglang{R}~package version~0.5-03}, URL = {http://CRAN.R-project.org/package=rrcov}, } @ARTICLE{ todorov-oof, AUTHOR = {Valentin Todorov and Peter Filzmoser}, TITLE = {An Object Oriented Framework for Robust Multivariate Analysis}, JOURNAL = JSS, PAGES = {1--47}, YEAR = {2009}, VOLUME = {32}, NUMBER = {3}, URL = {http://www.jstatsoft.org/v32/i03/}, } @MANUAL{ robustbase, title = {\pkg{robustbase}: {B}asic Robust Statistics}, author = {Peter J. Rousseeuw and Christophe Croux and Valentin Todorov and Andreas Ruckstuhl and Matias Salibian-Barrera and Tobias Verbeke and Martin Maechler}, year = {2009}, note = {\proglang{R}~package version~0.4-5}, URL = {http://CRAN.R-project.org/package=robustbase}, } @MANUAL{ filzmoser-mvoutlier, AUTHOR = {Moritz Gschwandtner and Peter Filzmoser}, TITLE = {\pkg{mvoutlier}: {M}ultivariate Outlier Detection Based on Robust Methods}, YEAR = {2007}, NOTE = {\proglang{R}~package version~1.3}, URL = {http://CRAN.R-project.org/package=mvoutlier}, } @MANUAL{ Asquith, AUTHOR = {Asquith, W. H.}, TITLE = {The lmomco Package: Reference manual}, YEAR = {2006}, URL={http://cran.R-project.org/packages=lmomco.pdf}, } @Manual{ RLanguage, title = {\proglang{R}: {A} Language and Environment for Statistical Computing}, author = {{\proglang{R} Development Core Team}}, organization = {\proglang{R} Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2009}, note = {{ISBN} 3-900051-07-0}, url = {http://www.R-project.org/} } @Manual{ filzmoser-pcaPP, title = {\pkg{pcaPP}: {R}obust {PCA} by Projection Pursuit}, author = {Peter Filzmoser and Heinrich Fritz and Klaudius Kalcher}, year = {2009}, note = {\proglang{R}~package version~1.7}, url = {http://CRAN.R-project.org/package=pcaPP}, } @Manual{ konis-robust, title = {\pkg{robust}: {I}nsightful Robust Library}, author = {Jiahui Wang and Ruben Zamar and Alfio Marazzi and Victor Yohai and Matias Salibian-Barrera and Ricardo Maronna and Eric Zivot and David Rocke and Doug Martin and Kjell Konis}, year = {2008}, note = {\proglang{R}~package version~0.3-4}, url = {http://CRAN.R-project.org/package=robust}, } @Manual{ locfit, title = {\pkg{locfit}: {L}ocal Regression, Likelihood and Density Estimation.}, author = {Catherine Loader}, year = {2007}, note = {\proglang{R}~package version~1.5-4}, url = {http://CRAN.R-project.org/package=locfit}, } @Manual{ mclust, title = {\pkg{mclust}: {M}odel-Based Clustering / Normal Mixture Modeling}, author = {Chris Fraley and Adrian Raftery}, year = {2009}, note = {\proglang{R}~package version~3.2}, url = {http://CRAN.R-project.org/package=mclust}, } @Manual{ Rfwdmv, title = {\pkg{Rfwdmv}: {F}orward Search for Multivariate Data}, author = {Anthony Atkinson and Andrea Cerioli and Marco Riani}, year = {2005}, note = {\proglang{R}~package version~0.72-2}, url = {http://CRAN.R-project.org/package=Rfwdmv}, } @incollection{ Tukey:89, author = {Tukey, John}, title = {Robust Statistics: From an Intelectual Game to Every Day Use}, booktitle = {Directions in Robust Statistics and Diagnostics, Part II}, publisher = {Springer-Verlag}, year = {1989}, address = {New York}, editor = {W.Stahel and S.Weisberg}, pages = {}, } @ARTICLE{ tyler:1996, AUTHOR = "J. T. Kent and D. E. Tyler", TITLE = "Constrained {M}~estimation of Multivariate Location and Scatter", JOURNAL = "The Annals of Statistics", PAGES = "1346--1370", YEAR = "1996", VOLUME = "24", } @ARTICLE{ vandev:93, AUTHOR = "Vandev, D.L.", TITLE = "A Note on Breakdown Point of the Least Median Squares and Least Trimmed Squares", JOURNAL = "Statistics and Probability Letters", PAGES = "117--119", YEAR = "1993", VOLUME = "16", } @incollection{ vandev-neykov, author = {Vandev, D. L. and Neykov, N. M.}, title = {Robust maximum likelihood in the Gaussian case, In New Directions in Data Analysis and Robustness}, booktitle = {New Directions in Data Analysis and Robustness}, publisher = {Birkhauser Verlag}, year = {1993}, address = {Basel}, editor = {Morgenthaler, S. and Ronchetti, E. and Stahel, W. A.}, pages = {259--264}, } @ARTICLE{ verboon:1994, AUTHOR={Peter Verboon and Ivo Lans}, TITLE={Robust Canonical Discriminant Analysis}, JOURNAL={Psychometrika}, YEAR=1994, VOLUME={59}, NUMBER={4}, PAGES={485-507}, MONTH={December}, NOTE={available at http://ideas.repec.org/a/spr/psycho/v59y1994i4p485-507.html} } @TECHREPORT{ Victoria-Feser:2003.04, AUTHOR={Samuel Copt and Maria-Pia Victoria-Feser}, TITLE={Variable Fast Algorithms for Computing High Breakdown Covariance Matrices with Missing Data}, YEAR=2003, MONTH=Aug, INSTITUTION={D{\'e}partement d'Econom{\'e}trie, Universit{\'e} de Gen{\'e}ve}, TYPE={Cahiers du D{\'e}partement d'Econom{\'e}trie}, NOTE={available at http://ideas.repec.org/p/gen/geneem/2003.04.html}, NUMBER={2003.04} } @incollection{ Victoria-Feser:2004, AUTHOR = {Samuel Copt and Maria-Pia Victoria-Feser}, TITLE = {Fast Algorithms for Computing High Breakdown Covariance Matrices with Missing Data}, BOOKTITLE = {Theory and Applications of Recent Robust Methods, Statistics for Industry and Technology Series}, YEAR = {2004}, EDITOR = {Hubert, M. and Pison, G. and Struyf, A. and Van Aelst, S.}, PAGES = {}, PUBLISHER = {Birkhauser Verlag}, ADDRESS = {Basel} } @ARTICLE{ Victoria-Feser:2002, AUTHOR = {Cheng, T. C. and Maria-Pia Victoria-Feser}, TITLE = {High Breakdown Estimation of Multivariate Location and Scale With Missing Observations}, JOURNAL = {British Journal of Mathematical and Statistical Psychology }, YEAR = {2002}, VOLUME = {55}, PAGES = {317--335} } @BOOK{ webb, abstract = {{Statistical pattern recognition is a very active area of study and research, which has seen many advances in recent years. New and emerging applications - such as data mining, web searching, multimedia data retrieval, face recognition, and cursive handwriting recognition - require robust and efficient pattern recognition techniques. Statistical decision making and estimation are regarded as fundamental to the study of pattern recognition.


Statistical Pattern Recognition, Second Edition has been fully updated with new methods, applications and references. It provides a comprehensive introduction to this vibrant area - with material drawn from engineering, statistics, computer science and the social sciences - and covers many application areas, such as database design, artificial neural networks, and decision support systems.


* Provides a self-contained introduction to statistical pattern recognition.
* Each technique described is illustrated by real examples.
* Covers Bayesian methods, neural networks, support vector machines, and unsupervised classification.
* Each section concludes with a description of the applications that have been addressed and with further developments of the theory.
* Includes background material on dissimilarity, parameter estimation, data, linear algebra and probability.
* Features a variety of exercises, from 'open-book' questions to more lengthy projects.


The book is aimed primarily at senior undergraduate and graduate students studying statistical pattern recognition, pattern processing, neural networks, and data mining, in both statistics and engineering departments. It is also an excellent source of reference for technical professionals working in advanced information development environments.

For further information on the techniques and applications discussed in this book please visit\&\#160;www.statistical-pattern-recognition.net } {"Statistical pattern recognition is a very active area of study and research, which has seen many advances in recent years. New and emerging applications - such as data mining, web searching, multimedia data retrieval, face recognition, and cursive handwriting recognition - require robust and efficient pattern recognition techniques. Statistical decision making and estimation are regarded as fundamental to the study of pattern recognition. Statistical Pattern Recognition, Second Edition has been fully updated with new methods, applications and references. It provides a comprehensive introduction to this vibrant area - with material drawn from engineering, statistics, computer science and the social sciences - and covers many application areas, such as database design, artificial neural networks, and decision support systems. Provides a self-contained introduction to statistical pattern recognition. Each technique described is illustrated by real examples. Covers Bayesian methods, neural networks, support vector machines, and unsupervised classification. Each section concludes with a description of the applications that have been addressed and with further developments of the theory. Includes background material on dissimilarity, parameter estimation, data, linear algebra and probability. Features a variety of exercises, from 'open-book' questions to more lengthy projects. The book is aimed primarily at senior undergraduate and graduate students studying statistical pattern recognition, pattern processing, neural networks, and data mining, in both statistics and engineering departments. It is also an excellent source of reference for technical professionals working in advanced information development environments."}}, author = {Webb, Andrew R. }, isbn = {0470845147}, keywords = {pattern-recognition}, month = {October}, publisher = WILEY, title = {Statistical Pattern Recognition, 2nd Edition}, url = {http://www.amazon.ca/exec/obidos/redirect?tag=citeulike09-20\&path=ASIN/0470845147}, year = {2002} } %========================================================================== %========================================================================= @BOOK{ cookwisb, AUTHOR = "Cook, R. D. and Weisberg, S.", TITLE = "Residuals and Influence in Regression", PUBLISHER = "Chapman and Hall", YEAR = "1982", } @ARTICLE{ bartlett, AUTHOR = "Bartlett, M.", TITLE = "An inverse matrix adjustment arising in disccriminant analysis", JOURNAL = "Annals of Mathematical Statistics", PAGES = "107-111", YEAR = "1951", VOLUME = "22", } @ARTICLE{ willems-zamar, AUTHOR = "Willems, G. and Joe H. and Zamar R.H.", TITLE = "Diagnosing Multivariate Outliers Detected by Robust Estimators", JOURNAL = "", PAGES = "", YEAR = "2008", VOLUME = "", } @TECHREPORT{ wood, AUTHOR = "Woodbury, M.", TITLE = "Inverting modified matrices", INSTITUTION = "Princeton University", TYPE = "Technical Report", NUMBER = "42", YEAR = "1950", NOTE = "Statistical Techniques Research Group", } @incollection{ acd+j:91, author = {Davison, A. C. and Snell, E. J. }, title = {Residuals and Diagnostics}, booktitle = {Statistical Theory and Modelling }, publisher = {Chapman and Hall }, year = {1991}, address = {London }, editor = {Hinkley, D. V. and Reid, N. and Snell, E. J. }, pages = {83--106}, } @article{ cook:77, author = {Cook, R. D. }, title = {Detection of influential observations in linear regression}, journal = {Technometrics }, year = {1977}, volume = {19}, pages = {15--18} } @article{ aca:82, author = {Atkinson, A. C. }, title = {Optimum biased coin designs for sequential clinical trials with prognostic factors}, year = {1982}, volume = {69}, pages = {61--67}, journal = {Biometrika} } @book{ mcc+n:89, author = {McCullagh, P. and Nelder, J. A. }, title = {Generalized Linear Models (2nd edition)}, publisher = {Chapman and Hall }, year = {1989}, address = {London } } @article{ efr:78, author = {Efron, B. }, title = {Regression and {ANOVA} with Zero--One data: measures of residual variation}, year = {1978}, volume = {73}, pages = {113--121}, journal = {Journal of the American Statistical Association } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Outliers, Sampling Serveys %%% @BOOK{ barnett:1994, AUTHOR = {Barnett, V. and Lewis, T.}, TITLE = {Outliers in Statistical Data}, PUBLISHER = WILEY, YEAR = {1994}, ADDRESS = {}, } @Article{ Beguin:2004, author={C\`{e}dric B\`{e}guin and Beat Hulliger}, title={Multivariate Outlier Detection in Incomplete Survey Data: the Epidemic Algorithm and Transformed Rank Correlations}, journal=JRSS-B, year=2004, volume={127}, number={2}, pages={275-294}, month={}, url={http://ideas.repec.org/a/bla/jorssa/v167y2004i2p275-294.html} } @ARTICLE{ chambers:2004, author={Ray Chambers and Adandatilde;o Hentges and Xinqiang Zhao}, title={Robust Automatic Methods for Outlier and Error Detection}, journal=JRSS-A, year=2004, volume={127}, number={2}, pages={323-339}, month={}, url={http://ideas.repec.org/a/bla/jorssa/v167y2004i2p323-339.html} } @incollection{ franklin:1997, author = {Sarah Franklin and Marie Brodeur}, title = {A Practical Application of A Robust Multivariate Outlier Detection Method}, booktitle = {Proceedings of the Survey Research Methods Section, ASA (1997)}, publisher = {}, pages = {186--197}, editor = {}, year = {1997}, url={http://www.amstat.org/sections/srms/proceedings} } @incollection{ franklin:2000, author = {Sarah Franklin and Marie Brodeur and Steven Thomas}, title = {Robust Multivariate Outlier Detection Using Mahalanobis' Distance and Stahel-Donoho Estimators}, booktitle = {ICES - II, International Conference on Establishment Surveys - II}, publisher = {}, pages = {}, editor = {}, year = {2000}, url={} } @incollection{ hulliger:2007, author = {Beat Hulliger}, title = {Multivariate Outlier Detection and Treatment in Business Surveys}, booktitle = {ICES - III, International Conference on Establishment Surveys - III}, publisher = {}, pages = {}, editor = {}, year = {2007}, url={} } @ARTICLE{ Ghosh-Dastidar:2006, AUTHOR = {Bonnie Ghosh-Dastidar and J. L. Schafer}, TITLE = {Outlier Detection and Editing Procedures for Continuous Multivariate Data}, JOURNAL = {Journal of Official Statistics}, PAGES = {487-506}, YEAR = {2006}, VOLUME = {22}, NUMBER = {3} } @incollection{ santos-pereira-detection:2002, author = {Carla M. Santos-Pereira and Ana M. Pires}, title = {Detection of Outliers in Multivariate Data: A Method Based on Clustering and Robust Estimators}, booktitle = {Proceedings in Computational Statistics, COMPSTAT`2002}, publisher = {Physica Verlag}, year = {2002}, address = {Heidelberg }, editor = {H{\"a}rdle, W. and R{\"o}nz, B.}, pages = {291--296}, url = {citeseer.ist.psu.edu/545222.html} } @BOOK{ Schafer:1997, AUTHOR = {J.L. Schafer}, TITLE = {Analysis of Incomplete Multivariate Data}, PUBLISHER = {Chapman and Hall}, YEAR = {1997}, ADDRESS = {London}, } @ARTICLE{ smith:1987, AUTHOR = {Smith, T.M.F.}, TITLE = {Influential observations in survey sampling}, JOURNAL = {Applied Statistics}, PAGES = {143--152}, YEAR = {1987}, VOLUME = {}, } @ARTICLE{ Ton-de-Waal:2005, author={Ton de Waal and Wieger Coutinho}, title={Automatic Editing for Business Surveys: An Assessment of Selected Algorithms}, journal={International Statistical Review}, year=2005, volume={73}, number={1}, pages={73--102}, month={}, url={} } @ARTICLE{ Zijlstra:2007, AUTHOR = {Wobbe P. Zijlstra and L. Andries van der Ark and Klaas Sijtsma}, TITLE = {Outlier Detection in Test and Questionnaire Data}, JOURNAL = {Multivariate Behavioral Research}, PAGES = {531--555}, YEAR = {2007}, VOLUME = {4}, ISSUE = {3}, } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Software development references %% @BOOK{ gamma, AUTHOR = "Gamma, E. and Helm, R. and Johnson, R. and Vlissides, J.", TITLE = "Design Patterns: Elements of Reusable Object-oriented Software", PUBLISHER = "Addison-Wesley", ADDRESS = "Reading", YEAR = "1995" } @BOOK{ grand, AUTHOR = "Grand, M.", TITLE = "Patterns in Java, Volume 1.", PUBLISHER = WILEY, ADDRESS = "New York", YEAR = "1998" } @misc{ manolescu:why-java, author = "Dragos Manolescu and Adrian Kunzle", title = "Why Java is Not Suitable for Object-Oriented Frameworks", howpublished = {OOPSLA 2001 Proceedings Companion}, month = oct, year = 2001, note = "Available on the Web from \url{http://micro-workflow.com/}", url = {citeseer.ist.psu.edu/465868.html} } @article{ meusel:documentation-oo-framework, author = "Matthias Meusel and Krzysztof Czarnecki and Wolfgang K{\"o}pf", title = "A Model for Structuring User Documentation of Object- Oriented Frameworks Using Patterns and Hypertext", journal = "Lecture Notes in Computer Science", volume = "1241", pages = "496--??", year = "1997", url = "citeseer.ist.psu.edu/meusel97model.html" } @TECHREPORT{ argo:phd, AUTHOR = {Jason Elliot Robbins}, TITLE = {Cognitive Support Features for Software Development Tools}, INSTITUTION = {University of California}, ADDRESS = {Irvine}, TYPE = {Ph.D. thesis}, NUMBER = {}, YEAR = {1999}, NOTE = {}, URL = {http://argouml.tigris.org/docs/robbins_dissertation/}, } @ARTICLE{ argo:2000, AUTHOR = {Jason Elliot Robbins and D. F. Redmiles}, TITLE = {Cognitive Support, {UML} Adherence, and {XMI} Interchange in {A}rgo/{UML}}, JOURNAL = {Information and Software Technology}, VOLUME = {42}, PAGES = {79--89}, YEAR = {2000}, } @ARTICLE{ argo:2006, AUTHOR = {Mei Zhang}, TITLE = {Argo{UML}}, JOURNAL = {Journal of Computing Sciences in Colleges}, VOLUME = {21}, NUMBER = {5}, PAGES = {6--7}, YEAR = {2006}, } @TECHREPORT{ umlInfra, AUTHOR = {OMG}, TITLE = {{OMG} Unified Modeling Language ({OMG UML}), {I}nfrastructure, {V}2.2}, YEAR = {2009}, MONTH = {February}, TYPE = {Current formally adopted specification}, INSTITUTION = {Object Management Group}, URL = {http://www.omg.org/spec/UML/2.2/Infrastructure/PDF}, } @TECHREPORT{ umlSuper, AUTHOR = {OMG}, TITLE = {{OMG} Unified Modeling Language ({OMG UML}), {S}uperstructure, {V}2.2}, YEAR = {2009}, MONTH = {February}, TYPE = {Current formally adopted specification}, INSTITUTION = {Object Management Group}, URL = {http://www.omg.org/spec/UML/2.2/Superstructure/PDF}, } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% DATA SET REFERENCES %% @MISC{ fish-catch-data:2006, AUTHOR = "Juha Puranen", TITLE = "Fish Catch Data Set", JOURNAL = "Journal of Statistical Education", YEAR = "2006", HOWPUBLISHED = "http://www.amstat.org/publications/jse/datasets/fishcatch.txt", } @MISC{ UCI-KDD-1999, AUTHOR = {S. Hettich and S. D. Bay}, TITLE = {The UCI KDD Archive}, JOURNAL = {}, YEAR = {1999}, PUBLISHER = {University of California, Department of Information and Computer Science}, ADDRESS = {Irvine, CA}, HOWPUBLISHED = {http://kdd.ics.uci.edu}, URL = {http://kdd.ics.uci.edu}, } @misc{ UCI:2007, author = "A. Asuncion and D.J. Newman", year = "2007", title = "{UCI} Machine Learning Repository", url = "http://www.ics.uci.edu/$\sim$mlearn/{MLR}epository.html", institution = "University of California, Irvine, School of Information and Computer Sciences" } rrcov/vignettes/rrcov.Rnw0000644000176200001440000033555713565037277015301 0ustar liggesusers% -*- TeX -*- -*- Soft -*- \documentclass[article,shortnames,nojss]{jss} %\VignetteIndexEntry{An Object-Oriented Framework for Robust Multivariate Analysis} %\VignetteKeywords{robustness, multivariate analysis, MCD, R, statistical design patterns} %\VignettePackage{rrcov} \usepackage{amsmath} %% need for subequations \usepackage{amssymb} \usepackage{amsfonts} \usepackage[english]{babel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% declarations for jss.cls %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\vv}[1]{\mbox{\boldmath$#1$}} \newcommand{\xv}{\mbox{\boldmath$x$}} \newcommand{\yv}{\mbox{\boldmath$y$}} \newcommand{\zv}{\mbox{\boldmath$z$}} \newcommand{\mv}{\mbox{\boldmath$m$}} \newcommand{\tv}{\mbox{\boldmath$t$}} \newcommand{\xbarv}{\mbox{\boldmath$\bar x$}} \newcommand{\uv}{\mbox{\boldmath$u$}} \newcommand{\muv}{\mbox{\boldmath$\mu$}} \newcommand{\nuv}{\mbox{\boldmath$\nu$}} \newcommand{\deltav}{\mbox{\boldmath$\delta$}} \newcommand{\chiv}{\mbox{\boldmath$\chi$}} \newcommand{\ov}{\mbox{\boldmath$0$}} \newcommand\MCD{\mathit{MCD}} \newcommand\MVE{\mathit{MVE}} \newcommand\OGK{\mathit{OGK}} \newcommand\diag{\mathrm{diag}} %\newcommand\det{\mathrm{det}} \newcommand{\class}[1]{``\code{#1}''} \newcommand{\fct}[1]{\code{#1()}} %% almost as usual \author{Valentin Todorov\\UNIDO \And Peter Filzmoser\\Vienna University of Technology} \title{An Object Oriented Framework for Robust Multivariate Analysis} %% for pretty printing and a nice hypersummary also set: \Plainauthor{Valentin Todorov, Peter Filzmoser} %% comma-separated \Plaintitle{Object Oriented Framework for Robust Multivariate Analysis} %% without formatting \Shorttitle{OOF for Robust Multivariate Analysis} %% a short title (if necessary) %% an abstract and keywords \Abstract{ \noindent This introduction to the \proglang{R} package \pkg{rrcov} is a (slightly) modified version of \cite{todorov-oof}, published in the \emph{Journal of Statistical Software}. \noindent Taking advantage of the \proglang{S}4 class system of the programming environment \proglang{R}, which facilitates the creation and maintenance of reusable and modular components, an object oriented framework for robust multivariate analysis was developed. The framework resides in the packages \pkg{robustbase} and \pkg{rrcov} and includes an almost complete set of algorithms for computing robust multivariate location and scatter, various robust methods for principal component analysis as well as robust linear and quadratic discriminant analysis. The design of these methods follows common patterns which we call statistical design patterns in analogy to the design patterns widely used in software engineering. The application of the framework to data analysis as well as possible extensions by the development of new methods is demonstrated on examples which themselves are part of the package \pkg{rrcov}. } \Keywords{robustness, multivariate analysis, MCD, \proglang{R}, statistical design patterns} \Plainkeywords{robustness, multivariate analysis, MCD, R, statistical design patterns} %% without formatting %% at least one keyword must be supplied %% publication information %% NOTE: Typically, this can be left commented and will be filled out by the technical editor %% \Volume{13} %% \Issue{9} %% \Month{September} %% \Year{2004} %% \Submitdate{2004-09-29} %% \Acceptdate{2004-09-29} %% The address of (at least) one author should be given %% in the following format: \Address{ Valentin Todorov\\ Research and Statistics Branch\\ United Nations Industrial Development Organization (UNIDO)\\ Vienna International Centre\\ P.O.Box 300, 1400, Vienna, Austria\\ E-mail: \email{valentin.todorov@chello.at}\\ % URL: \url{http://statmath.wu-wien.ac.at/~zeileis/} } %% It is also possible to add a telephone and fax number %% before the e-mail in the following format: %% Telephone: +43/1/31336-5053 %% Fax: +43/1/31336-734 %% for those who use Sweave please include the following line (with % symbols): %% need no \usepackage{Sweave.sty} %% end of declarations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\bi}{\begin{itemize}} \newcommand{\ei}{\end{itemize}} \newcommand{\be}{\begin{enumerate}} \newcommand{\ee}{\end{enumerate}} \renewcommand{\v}[1]{\mathbf{#1}} %% Sweave options for the complete document %%\SweaveOpts{keep.source=TRUE} %%\SweaveOpts{prefix.string=images/oofgen/oof} \SweaveOpts{prefix.string=ooframework} \begin{document} %% include your article here, just as usual %% Note that you should use the \pkg{}, \proglang{} and \code{} commands. %\section[About Java]{About \proglang{Java}} \section[Introduction]{Introduction} %% Note: If there is markup in \(sub)section, then it has to be escape as above. Outliers are present in virtually every data set in any application domain, and the identification of outliers has a hundred years long history. Many researchers in science, industry and economics work with huge amounts of data and this even increases the possibility of anomalous data and makes their (visual) detection more difficult. Taking into account the multivariate aspect of the data, the outlyingness of the observations can be measured by the Mahalanobis distance which is based on location and scatter estimates of the data set. In order to avoid the masking effect, robust estimates of these parameters are called for, even more, they must possess a positive breakdown point. The estimates of the multivariate location vector $\muv$ and the scatter matrix $\v{\Sigma}$ are also a cornerstone in the analysis of multidimensional data, since they form the input to many classical multivariate methods. The most common estimators of multivariate location and scatter are the sample mean $\xbarv$ and the sample covariance matrix $\v{S}$, i.e., the corresponding MLE estimates. These estimates are optimal if the data come from a multivariate normal distribution but are extremely sensitive to the presence of even a few outliers (atypical values, anomalous observations, gross errors) in the data. If outliers are present in the input data they will influence the estimates $\xbarv$ and $\v{S}$ and subsequently worsen the performance of the classical multivariate procedure based on these estimates. Therefore it is important to consider robust alternatives to these estimators and actually in the last two decades much effort was devoted to the development of affine equivariant estimators possessing a high breakdown point. The most widely used estimators of this type are the minimum covariance determinant (MCD) estimator of \citet{rousseeuw:85} for which also a fast computing algorithm was constructed---\citet{rousseeuw-vandriessen}, the S~estimators \citep{davies:87} and the Stahel-Donoho estimator introduced by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} and studied by \citet{maronna:95}. If we give up the requirement for affine equivariance, estimators like the one of \citet{maronna:2002} are available and the reward is an extreme gain in speed. Substituting the classical location and scatter estimates by their robust analogues is the most straightforward method for robustifying many multivariate procedures like principal components, discriminant and cluster analysis, canonical correlation, etc. The reliable identification of multivariate outliers which is an important task in itself, is another approach to robustifying many classical multivariate methods. Some of these estimates and procedures became available in the popular statistical packages like \proglang{S-PLUS}, \proglang{SAS}, \proglang{MATLAB} as well as in \proglang{R} but nevertheless it is recognized that the robust methods have not yet replaced the ordinary least square techniques as it could be expected \citep{morgenthaler:2007, stromberg:2004}. One reason is the lack of easily accessible and easy to use software, that is software which presents the robust procedures as extensions to the classical ones---similar input and output, reasonable defaults for most of the estimation options and visualization tools. As far as the easiness of access is concerned, the robust statistical methods should be implemented in the freely available statistical software package \proglang{R}, \citep{RLanguage}, which provides a powerful platform for the development of statistical software. These requirements have been defined in the project ``Robust Statistics and \proglang{R}'', see \url{http://www.statistik.tuwien.ac.at/rsr/}, and a first step in this direction was the initial development of the collaborative package \pkg{robustbase}, \citep{robustbase}, with the intention that it becomes the \textit{essential robust statistics} \proglang{R} package covering the methods described in the recent book \citet{maronna:2006}. During the last decades the object oriented programming paradigm has revolutionized the style of software system design and development. A further step in the software reuse are the object oriented frameworks \citep[see][]{gamma} which provide technology for reusing both the architecture and the functionality of software components. Taking advantage of the new \proglang{S}4 class system \citep{chambers:98} of \proglang{R} which facilitate the creation of reusable and modular components an object oriented framework for robust multivariate analysis was implemented. The goal of the framework is manyfold: \be \item{to provide the end-user with a flexible and easy access to newly developed robust methods for multivariate data analysis;} \item{to allow the programming statisticians an extension by developing, implementing and testing new methods with minimum effort, and } \item{to guarantee the original developers and maintainer of the packages a high level of maintainability.} \ee The framework includes an almost complete set of algorithms for computing robust multivariate location and scatter, such as minimum covariance determinant, different S~estimators (SURREAL, FAST-S, Bisquare, Rocke-type), orthogonalized Gnanadesikan--Kettenring (OGK) estimator of \citet{maronna:2002}. The next large group of classes are the methods for robust principal component analysis (PCA) including ROBPCA of \citet{hubert-ROBPCA:2005}, spherical principal components (SPC) of \citet{locantore:1999}, the projection pursuit algorithms of \citet{croux-Ruiz-Gazen:2005} and \citet{croux-filzmoser-oliveira-pppca}. Further applications implemented in the framework are linear and quadratic discriminant analysis \citep[see][for a review]{todorov-roblda}, multivariate tests \citep{rousseeuw-willems:2002, todorov-manova} and outlier detection tools. The application of the framework to data analysis as well as the development of new methods is illustrated on examples, which themselves are part of the package. Some issues of the object oriented paradigm as applied to the \proglang{R} object model (naming conventions, access methods, coexistence of \proglang{S}3 and \proglang{S}4 classes, usage of UML, etc.) are discussed. The framework is implemented in the \proglang{R} packages \pkg{robustbase} and \pkg{rrcov}, \citep{todorov-rrcov}, which are available from Comprehensive \proglang{R} Archive Network (CRAN) at \url{http://CRAN.R-project.org} under the GNU General Public License. The rest of the paper is organized as follows. In the next Section~\ref{oof-sec:objmodel} the design principles and the structure of the framework is presented as well as some related object oriented concepts are discussed. As a main tool for modeling of the robust estimation methods a statistical design pattern is proposed. Section~\ref{oof-sec:ex-intro} facilitates the quick start by an example session giving a brief overview of the framework. Section~\ref{oof-sec:multi} describes the robust multivariate methods, their computation and implementation. The Sections~\ref{oof-sec:cov}, \ref{oof-sec:pca} and \ref{oof-sec:lda} are dedicated to the estimation of multivariate location and scatter, principal component analysis and discriminant analysis, respectively. For each domain the object model, the available visualization tools, an example, and other relevant information are presented. We conclude in Section~\ref{oof-sec:conclusions} with discussion and outline of the future work. \section{Design approach and structure of the framework} \label{oof-sec:objmodel} In classical multivariate statistics we rely on parametric models based on assumptions about the structural and the stochastic parts of the model for which optimal procedures are derived, like the least squares estimators and the maximum likelihood estimators. The corresponding robust methods can be seen as extensions to the classical ones which can cope with deviations from the stochastic assumptions thus mitigating the dangers for classical estimators. The developed statistical procedures will remain reliable and reasonably efficient even when such deviations are present. For example in the case of location and covariance estimation the classical theory yields the sample mean $\xbarv$ and the sample covariance matrix $\v{S}$, i.e., the corresponding MLE estimates as an optimal solution. One (out of many) robust alternatives is the minimum covariance determinant estimator. When we consider this situation from an object oriented design point of view we can think of an abstract base class representing the estimation problem, a concrete realization of this object---the classical estimates, and a second concrete derivative of the base class representing the MCD estimates. Since there exist many other robust estimators of multivariate location and covariance which share common characteristics we would prefer to add one more level of abstraction by defining an abstract ``robust'' object from which all other robust estimators are derived. We encounter a similar pattern in most of the other multivariate statistical methods like principal component analysis, linear and quadratic discriminant analysis, etc. and we will call it a \textit{statistical design pattern}. A schematic representation as an \textit{UML diagram} is shown in Figure~\ref{oof-fig:objmodel}. \begin{figure}[h!] \begin{center} \includegraphics[width=1.0\textwidth]{AModel} \label{oof-fig:objmodel} \caption{Class diagram of the statistical design pattern for robust estimation methods.} \end{center} \end{figure} The following simple example demonstrates the functionality. We start with a generic object model of a robust and the corresponding classical multivariate method with all the necessary interfaces and functionalities and then concretize it to represent the desired class hierarchy. The basic idea is to define an abstract \proglang{S}4 class which has as slots the common data elements of the result of the classical method and its robust counterparts (e.g., \code{Pca}). For this abstract class we can implement the standard in \proglang{R} generic functions like \code{print()}, \code{summary()}, \code{plot()} and maybe also \code{predict()}. Now we can derive and implement a concrete class which will represent the classical method, say \code{PcaClassic}. Further we derive another abstract class which represents a potential robust method we are going to implement, e.g., \code{PcaRobust}---it is abstract because we want to have a ``placeholder'' for the robust methods we are going to develop next. The generic functions that we implemented for the class \code{Pca} are still valid for \code{PcaRobust} but whenever necessary we can override them with new functionality. Now we have the necessary platform and of course we have had diligently documented everything we have implemented so far---this is our investment in the future development of robust methods from this family. The framework at its current expansion stage provides such platform for several important families of multivariate methods. It is time to dedicate our effort to the development and implementation of our new robust method/class, say \code{PcaHubert} and only to this---here comes the first obvious benefit from the framework---we do not need to care for the implementation of \code{print()}, \code{summary()}, \code{plot()} and \code{predict()} neither for their documentation or testing. In contrast to the \proglang{S}3 class system the \proglang{S}4 system requires the creation of objects to be done by the \code{new()} function which will perform the necessary validity checks. We go one step further and require that the \code{new()} function is not used directly but only through special functions known in \proglang{R} as \textit{generating functions} or as \textit{constructors} in the conventional object oriented programming languages. A constructor function has the same name as the corresponding class, takes the estimation options as parameters, organizes the necessary computations and returns an object of the class containing the results of the computation. It can take as a parameter also a \textit{control object} which itself is an \proglang{S}4 object and contains the estimation options. More details on the generating functions and their application for structuring the user interface can be found in \citet{todorov-constructors}. The main part of the framework is implemented in the package \pkg{rrcov} but it relies on code in the packages \pkg{robustbase} and \pkg{pcaPP} \citep{filzmoser-pcaPP}. The structure of the framework and its relation to other \proglang{R} packages is shown in Figure~\ref{oof-fig:structure}. \begin{figure}[h!] \begin{center} \includegraphics[width=0.8\textwidth]{Structure} \label{oof-fig:structure} \caption{Class diagram: structure of the framework and relation to other \proglang{R} packages.} \end{center} \end{figure} The framework can be used by other packages, like for example by \pkg{robust} \citep[see][]{konis-robust} or can be further extended. In Figure~\ref{oof-fig:structure} a hypothetical package \pkg{rrcovNA} is shown, which could extend the available robust multivariate methods with options for dealing with missing values. In the rest of this section some object-oriented programming (OOP) concepts will be discussed which are essential for understanding the framework. \newpage \subsection{UML diagrams} \label{oof-sec:UML} Throughout this paper we exploit UML class diagrams to give a clear picture of the framework and its components. UML stands for \textit{Unified Modeling Language}---an object-oriented system of notation which has evolved from previous works of Grady Booch, James Rumbaugh and Ivar Jacobson to become a tool accepted by the Object Management Group (OMG) as the standard for modeling object oriented programs \citep[see][]{umlInfra, umlSuper}. A class diagram models the structure and contents of a system by depicting classes, packages, objects and the relations among them with the aim to increase the ease of understanding the considered application. A class is denoted by a box with three compartments which contain the name, the attributes (slots) and operations (methods) of the class, respectively. The class name in italics indicates that the class is abstract. The bottom two compartments could be omitted or they can contain only the key attributes and operations which are useful for understanding the particular diagram. Each attribute is followed by its type and each operation---by the type of its return value. We use the \proglang{R} types like \code{numeric}, \code{logical}, \code{vector}, \code{matrix}, etc. but the type can be also a name of an \proglang{S}4 class. Relationships between classes are denoted by lines or arrows with different form. The inheritance relationship is depicted by a large empty triangular arrowhead pointing to the base class. Composition means that one class contains another one as a slot (not to be mistaken with the keyword ``contains'' signalling inheritance in \proglang{R}). This relation is represented by an arrow with a solid diamond on the side of the composed class. If a class ``uses'' another one or depends on it, the classes are connected by a dashed arrow (dependence relation). Packages can also be present in a class diagram---in our case they correspond more or less to \proglang{R} packages---and are shown as tabbed boxes with the name of the package written in the tab (see Figure~\ref{oof-fig:structure}). All UML diagrams of the framework were created with the open source UML tool \pkg{ArgoUML} \citep{argo:phd, argo:2000} which is available for download from \url{http://argouml.tigris.org/}. \subsection{Design patterns} \label{oof-sec:patterns} Design patterns are usually defined as general solutions to recurring design problems and refer to both the description of a solution and an instance of that solution solving a particular problem. The current use of the term design patterns originates in the writings of the architect Christopher Alexander devoted to urban planning and building architecture \citep{alexander} but it was brought to the software development community by the seminal book of \citet{gamma}. A design pattern can be seen as a template for how to solve a problem which can be used in many different situations. Object-Oriented design patterns are about classes and the relationships between classes or objects at abstract level, without defining the final classes or objects of the particular application. In order to be usable, design patterns must be defined formally and the documentation, including a preferably evocative name, describes the context in which the pattern is used, the pattern structure, the participants and collaboration, thus presenting the suggested solution. Design patterns are not limited to architecture or software development but can be applied in any domain where solutions are searched for. During the development of the here presented framework several design patterns were identified, which we prefer to call \textit{statistical design patterns}. The first one was already described earlier in this section and captures the relations among a classical and one or more alternative robust multivariate estimators. Another candidate is the control object encapsulating the estimation parameters and a third one is the factory-like construct which suggests selection of a robust estimation method and creation of the corresponding objects based on the data set characteristics (see Section~\ref{oof-sec:cov}). The formal description of these design patterns is beyond the scope of this work and we will limit the discussion to several examples. \subsection{Accessor methods} \label{oof-sec:accessors} One of the major characteristics and advantages of object oriented programming is the encapsulation. Unfortunately real encapsulation (information hiding) is missing in \proglang{R}, but as far as the access to the member variables is concerned this could be mitigated by defining accessor methods (i.e., methods used to examine or modify the slots (member variables) of a class) and ``advising'' the users to use them instead of directly accessing the slots. The usual way of defining accessor functions in \proglang{R} is to use the same name as the name of the corresponding slot. For example for the slot \code{a} these are: \begin{Scode} R> cc <- a(obj) R> a(obj) <- cc \end{Scode} In many cases this is not possible, because of conflicts with other existing functions. For example it is not possible to define an accessor function \code{cov()} for the slot \code{cov} of class \code{Cov}, since the function \code{cov()} already exists in the \code{base} \proglang{R}. Also it is not immediately seen if a slot is ``read only'' or can be modified by the user (unfortunately, as already mentioned, every slot in \proglang{R} can be modified by simply using \code{obj@a <- cc}). In \pkg{rrcov} a notation was adopted, which is usual in \proglang{Java}: the accessors are defined as \code{getXxx()} and \code{setXxx()} (if a \code{setXxx()} method is missing, we are ``not allowed'' to change the slot). The use of accessor methods allows to perform computations on demand (\code{getMah(mcd)} computes the Mahalanobis distances, stores them into the object and returns them) or even have ``virtual'' slots which are not at all stored in the object (e.g., \code{getCorr(mcd)} computes each time and returns the correlation matrix without storing it). \subsection{Naming conventions} \label{oof-sec:naming} %% %From Sun: "Class names should be nouns, in mixed case with the first letter of each %internal word capitalized. Methods should be verbs, in mixed case with the first %letter lowercase, with the first letter of each internal word capitalized." %% %No coding rules in R: the R Internals manual that is shipped with R %also has a section on coding standards: %http://cran.r-project.org/doc/manuals/R-ints.html#R-coding-standards %though this is quite short and does not go much beyond the basic indentation %% There is no agreed naming convention (coding rules) in \proglang{R} but to facilitate the framework usage several simple rules are in order, following the recommended Sun's \proglang{Java} coding style (see \url{http://java.sun.com/docs/codeconv/}): \bi \item{Class, function, method and variable names are alphanumeric, do not contain ``-'' or ``.'' but rather use interchanging lower and upper case.} \item{Class names start with an uppercase letter.} \item{Methods, functions, and variables start with a lowercase letter.} \item{Exceptions are functions returning an object of a given class (i.e., generating functions or constructors)---they have the same name as the class.} \item{Variables and methods which are not intended to be seen by the user---i.e., private members---start with ``.''.} \item{Violate these rules whenever necessary to maintain compatibility.} \ei \section{Example session} \label{oof-sec:ex-intro} In this section we will introduce the base functionalities of the framework by an example session. First of all we have to load the package \pkg{rrcov} which will cause all necessary packages to be loaded too. The framework includes many example data sets but here we will load only those which will be used throughout the following examples. For the rest of the paper it will be assumed that the package has been loaded already. <>= ## set the prompt to "R> " and the continuation to "+ " options(prompt="R> ", continue="+ ") @ <>= ## ## Load the 'rrcov' package and the first two data sets to be ## used throughout the examples ## library("rrcov") data("delivery") delivery.x <- delivery[,1:2] # take only the X part data("hbk") hbk.x <- hbk[,1:3] # take only the X part @ Most of the multivariate statistical methods are based on estimates of multivariate location and covariance, therefore these estimates play a central role in the framework. We will start with computing the robust \textit{minimum covariance determinant} estimate for the data set \code{delivery} from the package \pkg{robustbase}. The data set \citep[see][Table~23, p.~155]{rousseeuw-leroy} contains delivery time data in 25 observations with 3 variables. The aim is to explain the time required to service a vending machine \code{(Y)} by means of the number of products stocked \code{(X1)} and the distance walked by the route driver \code{(X2)}. For this example we will consider only the $\v{X}$ part of the data set. After computing its robust location and covariance matrix using the MCD method implemented in the function \code{CovMcd()} we can print the results by calling the default \code{show()} method on the returned object \code{mcd} as well as summary information by the \code{summary()} method. The standard output contains the robust estimates of location and covariance. The summary output contains additionally the eigenvalues of the covariance matrix and the robust distances of the data items (Mahalanobis type distances computed with the robust location and covariance instead of the sample ones). <>= ## ## Compute MCD estimates for the delivery data set ## - show() and summary() examples ## mcd <- CovMcd(delivery.x) mcd summary(mcd) @ <>= ## ## Example plot of the robust against classical ## distances for the delivery data set ## plot(mcd, which="dd") @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=0.8\textwidth} \includegraphics{ooframework-intro-plot} \caption{Example plot of the robust against classical distances for the \code{delivery} data set.} \label{oof-fig:intro} \end{figure} \end{center} Now we will show one of the available plots by calling the \code{plot()} method---in Figure~\ref{oof-fig:intro} the Distance-Distance plot introduced by \citet{Rousseeuw-van-Zomeren} is presented, which plots the robust distances versus the classical Mahalanobis distances and allows to classify the observations and identify the potential outliers. The description of this plot as well as examples of more graphical displays based on the covariance structure will be shown in Section~\ref{oof-sec:cov}. Apart from the demonstrated MCD method the framework provides many other robust estimators of multivariate location and covariance, actually almost all of the well established estimates in the contemporary robustness literature. The most fascinating feature of the framework is that one will get the output and the graphs in the same format, whatever estimation method was used. For example the following code lines will compute the S~estimates for the same data set and provide the standard and extended output (not shown here). <>= ## ## Compute the S-estimates for the delivery data set ## and provide the standard and extended output ## est <- CovSest(delivery.x, method="bisquare") est summary(est) @ Nevertheless, this variety of methods could pose a serious hurdle for the novice and could be quite tedious even for the experienced user. Therefore a shortcut is provided too---the function \code{CovRobust()} can be called with a parameter set specifying any of the available estimation methods, but if this parameter set is omitted the function will decide on the basis of the data size which method to use. As we see in the example below, in this case it selects the Stahel-Donoho estimates. For details and further examples see Section~\ref{oof-sec:cov}. <>= ## ## Automatically select the appropriate estimator according ## to the problem size - in this example the Stahel-Donoho estimates ## will be selected. ## est <- CovRobust(delivery.x) est @ \section{Robust multivariate methods} \label{oof-sec:multi} \subsection{Multivariate location and scatter} \label{oof-sec:cov} The framework provides an almost complete set of estimators for multivariate location and scatter with high breakdown point. The first such estimator was proposed by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} and it is recommended for small data sets, but the most widely used high breakdown estimator is the minimum covariance determinant estimate \citep{rousseeuw:85}. Several algorithms for computing the S~estimators \citep{davies:87} are provided \citep{ruppert:1992, rocke:94, rocke:96a, salibian:2005}. The minimum volume ellipsoid (MVE) estimator \citep{rousseeuw:85} is also included since it has some desirable properties when used as initial estimator for computing the S~estimates \citep[see][p. 198]{maronna:2006}. In the rest of this section the definitions of the different estimators of location and scatter will be briefly reviewed and the algorithms for their computation will be discussed. Further details can be found in the relevant references. The object model is presented and examples of its usage, as well as further examples of the graphical displays are given. \subsubsection{The Minimum covariance determinant estimator and its computation} \label{oof-sec:cov-mcd} The MCD estimator for a data set $\{\xv_1, \ldots, \xv_n\}$ in $\Re^p$ is defined by that subset $\{\xv_{i_1}, \ldots, \xv_{i_h}\}$ of $h$ observations whose covariance matrix has the smallest determinant among all possible subsets of size $h$. The MCD location and scatter estimate $\v{T}_{\MCD}$ and $\v{C}_{\MCD}$ are then given as the arithmetic mean and a multiple of the sample covariance matrix of that subset \begin{eqnarray} \label{oof-eq:mcd} \v{T}_{\MCD} &=& \frac{1}{h}\sum^{h}_{j=1} \xv_{i_j} \nonumber\\ \v{C}_{MCD} &=& c_{ccf}c_{sscf}\frac{1}{h-1}\sum^{h}_{j=1} (\xv_{i_j}-\v{T}_{\MCD})(\xv_{i_j}-\v{T}_{\MCD})^{\top}. \end{eqnarray} The multiplication factors $c_{ccf}$ (consistency correction factor) and $c_{sscf}$ (small sample correction factor) are selected so that $\v{C}$ is consistent at the multivariate normal model and unbiased at small samples \citep[see][]{butler:1993, croux-haesbroeck:99, pison:2002, todorov-cf}. A recommendable choice for $h$ is $\lfloor(n+p+1)/2\rfloor$ because then the BP of the MCD is maximized, but any integer $h$ within the interval $[(n + p + 1)/2,n]$ can be chosen, see \citet{rousseeuw-leroy}. Here $\lfloor z\rfloor$ denotes the integer part of $z$ which is not less than $z$. If $h = n$ then the MCD location and scatter estimate $\v{T}_{\MCD}$ and $\v{C}_{\MCD}$ reduce to the sample mean and covariance matrix of the full data set. The computation of the MCD estimator is far from being trivial. The naive algorithm would proceed by exhaustively investigating all subsets of size $h$ out of $n$ to find the subset with the smallest determinant of its covariance matrix, but this will be feasible only for very small data sets. Initially MCD was neglected in favor of MVE because the simple resampling algorithm was more efficient for MVE. Meanwhile several heuristic search algorithms \citep[see][]{todorov:92, rocke:94, hawkins:94} and exact algorithms \citep[][]{agullo:96} were proposed but now a very fast algorithm due to \citet{rousseeuw-vandriessen} exists and this algorithm is usually used in practice. The algorithm is based on the C-step which moves from one approximation $(\v{T}_1, \v{C}_1)$ of the MCD estimate of a data set $\v{X}=\{\xv_1, \ldots, \xv_n\}$ to the next one $(\v{T}_2, \v{C}_2)$ with possibly lower determinant $\det(\v{C}_2) \le \det(\v{C}_1)$ by computing the distances $d_1, \ldots, d_n$ relative to $(\v{T}_1, \v{C}_1)$, i.e., \begin{equation} \label{oof-eq:mah} d_i=\sqrt{(\xv_i-\v{T}_1)^{\top}\v{C}_1^{-1}(\xv_i-\v{T}_1)} \end{equation} and then computing $(\v{T}_2, \v{C}_2)$ for those $h$ observations which have smallest distances. ``C'' in C-step stands for ``concentration'' since we are looking for a more ``concentrated'' covariance matrix with lower determinant. \citet{rousseeuw-vandriessen} have proven a theorem stating that the iteration process given by the C-step converges in a finite number of steps to a (local) minimum. Since there is no guarantee that the global minimum of the MCD objective function will be reached, the iteration must be started many times from different initial subsets, to obtain an approximate solution. The procedure is very fast for small data sets but to make it really ``fast'' also for large data sets several computational improvements are used. \bi \item{\textit{initial subsets}: It is possible to restart the iterations from randomly generated subsets of size $h$, but in order to increase the probability of drawing subsets without outliers, $p+1$ points are selected randomly. These $p+1$ points are used to compute ($\v{T}_0,\v{C}_0)$. Then the distances $d_1,\ldots, d_n$ are computed and sorted in increasing order. Finally the first $h$ are selected to form the initial $h-$subset $H_0$.} \item{\textit{reduced number of C-steps}: The C-step involving the computation of the covariance matrix, its determinant and the relative distances, is the most computationally intensive part of the algorithm. Therefore instead of iterating to convergence for each initial subset only two C-steps are performed and the 10 subsets with lowest determinant are kept. Only these subsets are iterated to convergence. } \item{\textit{partitioning}: For large $n$ the computation time of the algorithm increases mainly because all $n$ distances given by Equation~(\ref{oof-eq:mah}) have to be computed at each iteration. An improvement is to partition the data set into a maximum of say five subsets of approximately equal size (but not larger than say 300) and iterate in each subset separately. The ten best solutions for each data set are kept and finally only those are iterated on the complete data set. } \item{\textit{nesting}: Further decrease of the computational time can be achieved for data sets with $n$ larger than say 1500 by drawing 1500 observations without replacement and performing the computations (including the partitioning) on this subset. Only the final iterations are carried out on the complete data set. The number of these iterations depends on the actual size of the data set at hand.} \ei The MCD estimator is not very efficient at normal models, especially if $h$ is selected so that maximal BP is achieved. To overcome the low efficiency of the MCD estimator, a reweighed version can be used. For this purpose a weight $w_i$ is assigned to each observation $\xv_i$, defined as $w_i=1$ if $(\xv_i-\v{T}_{\MCD})^{\top}\v{C}_{\MCD}^{-1}(\xv_i-\v{T}_{\MCD}) \le \chi^2_{p,0.975}$ and $w_i=0$ otherwise, relative to the raw MCD estimates $(\v{T}_{\MCD}, \v{C}_{\MCD})$. Then the reweighted estimates are computed as \begin{eqnarray} \label{oof-eq:mcd-rew} \v{T}_R &=& \frac{1}{\nu}\sum^{n}_{i=1}{w_i\xv_i},\nonumber\\ \v{C}_R &=& c_{r.ccf}c_{r.sscf}\frac{1}{\nu-1}\sum^n_{i=1}{w_i(\xv_i-\v{T}_R)(\xv_i-\v{T}_R)^{\top}}, \end{eqnarray} where $\nu$ is the sum of the weights, $\nu =\sum^n_{i=1}{w_i}$. Again, the multiplication factors $c_{r.ccf}$ and $c_{r.sscf}$ are selected so that $\v{C}_R$ is consistent at the multivariate normal model and unbiased at small samples \citep[see][and the references therein]{pison:2002, todorov-cf}. These reweighted estimates $(\v{T}_R,\v{C}_R)$ which have the same breakdown point as the initial (raw) estimates but better statistical efficiency are computed and used by default. \subsubsection{The Minimum volume ellipsoid estimates} \label{oof-sec:cov-mve} The minimum volume ellipsoid estimator searches for the ellipsoid of minimal volume containing at least half of the points in the data set $\v{X}$. Then the location estimate is defined as the center of this ellipsoid and the covariance estimate is provided by its shape. Formally the estimate is defined as these $\v{T}_{\MVE},\v{C}_{\MVE}$ that minimize $\det(\v{C})$ subject to \begin{equation} \label{oof-eq:mve} \#\{i:(\xv_i - \v{T})^{\top}\v{C}^{-1}(\xv_i - \v{T}) \le c^2\} \ge \left \lfloor \frac{n+p+1}{2} \right \rfloor, \end{equation} where \# denotes the cardinality. The constant $c$ is chosen as $\chi^2_{p,0.5}$. The search for the approximate solution is made over ellipsoids determined by the covariance matrix of $p+1$ of the data points and by applying a simple but effective improvement of the sub-sampling procedure as described in \citet{maronna:2006}, p. 198. Although there exists no formal proof of this improvement (as for MCD and LTS), simulations show that it can be recommended as an approximation of the MVE. The MVE was the first popular high breakdown point estimator of location and scatter but later it was replaced by the MCD, mainly because of the availability of an efficient algorithm for its computation \citep{rousseeuw-vandriessen}. Recently the MVE gained importance as initial estimator for S~estimation because of its small maximum bias \citep[see][Table~6.2, p.~196]{maronna:2006}. \subsubsection{The Stahel-Donoho estimator} \label{oof-sec:cov-sde} The first multivariate equivariant estimator of location and scatter with high breakdown point was proposed by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} but became better known after the analysis of \citet{maronna:95}. For a data set $\v{X}=\{\xv_1,\ldots,\xv_n\}$ in $\Re^p$ it is defined as a weighted mean and covariance matrix of the form given by Equation~(\ref{oof-eq:mcd-rew}) where the weight $w_i$ of each observation is inverse proportional to the ``outlyingness'' of the observation. Let the univariate outlyingness of a point $\xv_i$ with respect to the data set $\v{X}$ along a vector $\v{a} \in \Re^p, ||\v{a}|| \ne \v{0}$ be given by \begin{equation} \label{oof-eq:sde1} r(\xv_i,\v{a}) = \frac{|\xv^{\top}\v{a}-m(\v{a}^{\top}\v{X})|}{s(\v{a}^{\top}\v{X})}~~~i=1,\ldots,n \end{equation} where $(\v{a}^{\top}\v{X})$ is the projection of the data set $\v{X}$ on $\v{a}$ and the functions $m()$ and $s()$ are robust univariate location and scale statistics, for example the median and MAD, respectively. Then the multivariate outlyingness of $\xv_i$ is defined by \begin{equation} \label{oof-eq:sde2} r_i=r(\xv_i) = \max_{\v{a}} r(\xv_i,\v{a}). \end{equation} The weights are computed by $w_i=w(r_i)$ where $w(r)$ is a nonincreasing function of $r$ and $w(r)$ and $w(r)r^2$ are bounded. \citet{maronna:95} use the weights \begin{equation} \label{oof-eq:sde-weight} w(r)=\min \left ( 1,\left (\frac{c}{t} \right )^2 \right ) \end{equation} with $c=\sqrt{\chi^2_{p,\beta}}$ and $\beta=0.95$, that are known in the literature as ``Huber weights''. Exact computation of the estimator is not possible and an approximate solution is found by subsampling a large number of directions $\v{a}$ and computing the outlyingness measures $r_i, i=1,\ldots,n$ for them. For each subsample of $p$ points the vector $\v{a}$ is taken as the norm 1 vector orthogonal to the hyperplane spanned by these points. It has been shown by simulations \citep{maronna:2006} that one step reweighting does not improve the estimator. \subsubsection{Orthogonalized Gnanadesikan/Kettenring} \label{oof-sec:cov-ogk} The MCD estimator and all other known affine equivariant high-breakdown point estimates are solutions to a highly non-convex optimization problem and as such pose a serious computational challenge. Much faster estimates with high breakdown point can be computed if one gives up the requirements of affine equivariance of the covariance matrix. Such an algorithm was proposed by \citet{maronna:2002} which is based on the very simple robust bivariate covariance estimator $s_{jk}$ proposed by \citet{Gnanadesikan-Kettenring:1972} and studied by \citet{devlin:81}. For a pair of random variables $Y_j$ and $Y_k$ and a standard deviation function $\sigma()$, $s_{jk}$ is defined as \begin{equation} \label{oof-eq:GK} s_{jk}=\frac{1}{4}\left(\sigma \left(\frac{Y_j}{\sigma(Y_j)}+\frac{Y_k}{\sigma(Y_k)}\right)^2 - \sigma \left(\frac{Y_j}{\sigma(Y_j)}-\frac{Y_k}{\sigma(Y_k)}\right)^2\right). \end{equation} If a robust function is chosen for $\sigma()$ then $s_{jk}$ is also robust and an estimate of the covariance matrix can be obtained by computing each of its elements $s_{jk}$ for each $j=1,\ldots,p$ and $k=1,\ldots,p$ using Equation~(\ref{oof-eq:GK}). This estimator does not necessarily produce a positive definite matrix (although symmetric) and it is not affine equivariant. \citet{maronna:2002} overcome the lack of positive definiteness by the following steps: \bi \item{Define $\yv_i=\vv{D}^{-1}\xv_i, i=1,\ldots,n$ with $\v{D}=\diag(\sigma(X_1),\ldots,\sigma(X_p))$ where $X_l, l=1,\ldots,p$ are the columns of the data matrix $\vv{X}=\{\xv_1, \ldots, \xv_n\}$. Thus a normalized data matrix $\vv{Y}=\{\yv_1, \ldots, \yv_n\}$ is computed.} \item{Compute the matrix $\vv{U}=(u_{jk})$ as $u_{jk}= s_{jk}=s(Y_j, Y_k)$ if $j \ne k$ or $u_{jk}= 1$ otherwise. Here $Y_l, l=1,\ldots,p$ are the columns of the transformed data matrix $\vv{Y}$ and $s(.,.)$ is a robust estimate of the covariance of two random variables like the one in Equation~(\ref{oof-eq:GK}).} \item{Obtain the ``principal component decomposition'' of $\vv{Y}$ by decomposing $\vv{U}=\vv{E}\vv{\Lambda}\vv{E}^{\top}$ where $\vv{\Lambda}$ is a diagonal matrix $\vv{\Lambda}=\diag(\lambda_1,\ldots,\lambda_p)$ with the eigenvalues $\lambda_j$ of $\vv{U}$ and $\vv{E}$ is a matrix with columns the eigenvalues $\vv{e}_j$ of $\vv{U}$.} \item{Define $\zv_i=\vv{E}^{\top}\yv_i=\vv{E}^{\top}\vv{D}^{-1}\xv_i$ and $\vv{A}=\vv{D}\vv{E}$. Then the estimator of $\vv{\Sigma}$ is $\vv{C}_{\OGK}=\vv{A}\vv{\Gamma}\vv{A}^{\top}$ where $\vv{\Gamma}=\diag(\sigma(Z_j)^2), j=1,\ldots,p$} and the location estimator is $\vv{T}_{\OGK}=\vv{A}\mv$ where $\mv=m(\zv_i) = (m(Z_1),\ldots,m(Z_p))$ is a robust mean function. \ei This can be iterated by computing $\vv{C}_{\OGK}$ and $\vv{T}_{\OGK}$ for $\vv{Z}=\{\zv_1, \ldots, \zv_n\}$ obtained in the last step of the procedure and then transforming back to the original coordinate system. Simulations \citep{maronna:2002} show that iterations beyond the second did not lead to improvement. Similarly as for the MCD estimator a one-step reweighting can be performed using Equations~(\ref{oof-eq:mcd-rew}) but the weights $w_i$ are based on the 0.9 quantile of the $\chi^2_p$ distribution (instead of 0.975) and the correction factors $c_r.ccf$ and $c_r.sscf$ are not used. In order to complete the algorithm we need a robust and efficient location function $m()$ and scale function $\sigma()$, and one proposal is given in \citet{maronna:2002}. Further, the robust estimate of covariance between two random vectors $s()$ given by Equation~(\ref{oof-eq:GK}) can be replaced by another one. In the framework two such functions are predefined but the user can provide as a parameter an own function. \subsubsection{S estimates} \label{oof-sec:cov-s} S~estimators of $\muv$ and $\v{\Sigma}$ were introduced by \citet{davies:87} and further studied by \citet{lopuhaa:1989} \citep[see also][p. 263]{rousseeuw-leroy}. For a data set of $p$-variate observations $\{\xv_1, \ldots, \xv_n\}$ an S~estimate $(\v{T},\v{C})$ is defined as the solution of $\sigma(d_1,\ldots,d_n)= \min$ where $d_i=(\xv-\v{T})^{\top}\v{C}^{-1}(\xv-\v{T})$ and $\det(\v{C})=1$. Here $\sigma=\sigma(\zv)$ is the M-scale estimate of a data set $\zv=\{z_1,\ldots,z_n\}$ defined as the solution of $\frac{1}{n}\Sigma\rho(z/\sigma)=\delta$ where $\rho$ is nondecreasing, $\rho(0)=0$ and $\rho(\infty)=1$ and $\delta \in(0,1)$. An equivalent definition is to find the vector $\v{T}$ and a positive definite symmetric matrix $\v{C}$ that minimize $\det(\v{C})$ subject to \begin{equation} \label{oof-eq:s-def} \frac{1}{n}\sum_{i=1}^{n}\rho(d_i)=b_0 \end{equation} with the above $d_i$ and $\rho$. As shown by \citet{lopuhaa:1989} S~estimators have a close connection to the M~estimators and the solution $(\v{T},\v{C})$ is also a solution to an equation defining an M~estimator as well as a weighted sample mean and covariance matrix: \begin{eqnarray} \label{oof-eq:s-iter} d_i^{j}&=&[(\xv_i-\v{T}^{(j-1)})^{\top}\v{(C}^{(j-1)})^{-1}(\xv-\v{T}^{(j-1)})]^{1/2} \nonumber\\ \v{T}^{(j)} &=& \frac{\Sigma w(d_i^{(j)})\xv_i}{\Sigma w(d_i^{(j)})} \nonumber\\ \v{C}^{(j)} &=& \frac{\Sigma w(d_i^{(j)})(\xv_i-\v{T}^{(j)})(\xv_i-\v{T}^{(j)})^{\top}}{\Sigma w(d_i^{(j)})} \end{eqnarray} The framework implements the S~estimates in the class \code{CovSest} and provides four different algorithms for their computation. \be \item{\emph{SURREAL}: This algorithm was proposed by \citet{ruppert:1992} as an analog to the algorithm proposed by the same author for computing S~estimators of regression.} \item{\emph{Bisquare S~estimation with HBDP start}: S~estimates with the biweight $\rho$ function can be obtained using the Equations~(\ref{oof-eq:s-iter}) by a reweighted sample covariance and reweighted sample mean algorithm as described in \citet{maronna:2006}. The preferred approach is to start the iteration from a bias-robust but possibly inefficient estimate which is computed by some form of sub-sampling. Since \citet{maronna:2006} have shown that the MVE has smallest maximum bias (Table~6.2, p.~196) it is recommended to use it as initial estimate.} \item{\emph{Rocke type S~estimates}: In \citet{rocke:96a} it is shown that S~estimators in high dimensions can be sensitive to outliers even if the breakdown point is set to 50\%. Therefore they propose a modified $\rho$ function called translated biweight (or t-biweight) and replace the standardization step given in Equation~(\ref{oof-eq:s-def}) with a standardization step consisting of equating the median of $\rho(d_i)$ with the median under normality. The estimator is shown to be more outlier resistant in high dimensions than the typical S~estimators. The specifics of the iteration are given in \citet{rocke:96}, see also \citet{maronna:2006}. As starting values for the iteration any of the available methods in the framework can be used. The recommended (and consequently the default) one is the MVE estimator computed by \code{CovMve()}.} \item{\emph{Fast~S~estimates}: \citet{salibian:2005} proposed a fast algorithm for regression S~estimates similar to the FAST-LTS algorithm of \citet{rousseeuw-vandriessen:LTS} and borrowing ideas from the SURREAL algorithm of \citet{ruppert:1992}. Similarly, the FAST-S algorithm for multivariate location and scatter is based on modifying each candidate to improve the S-optimality criterion thus reducing the number of the necessary sub-samples required to achieve desired high breakdown point with high probability.} \ee \subsubsection{Object model for robust location and scatter estimation} \label{oof-sec:cov-objmodel} The object model for the \proglang{S}4 classes and methods implementing the different multivariate location and scatter estimators follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-cov}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{CovModel} \caption{Object model for robust location and scatter estimation.} \label{fig:uml-cov} \end{center} \end{figure} The abstract class \code{Cov} serves as a base class for deriving all classes representing classical and robust location and scatter estimation methods. It defines the common slots and the corresponding accessor methods, provides implementation for the general methods like \code{show()}, \code{plot()} and \code{summary()}. The slots of \code{Cov} hold some input or default parameters as well as the results of the computations: the location, the covariance matrix and the distances. The \code{show()} method presents brief results of the computations and the \code{summary()} method returns an object of class \code{SummaryCov} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new data (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. The classical location and scatter estimates are represented by the class \code{CovClassic} which inherits directly from \code{Cov} (and uses all slots and methods defined there). The function \code{CovClassic()} serves as a constructor (generating function) of the class. It can be called by providing a data frame or matrix. As already demonstrated in Section~\ref{oof-sec:ex-intro} the methods \code{show()} and \code{summary()} present the results of the computations. The \code{plot()} method draws different diagnostic plots which are shown in one of the next sections. The accessor functions like \code{getCenter()}, \code{getCov()}, etc. are used to access the corresponding slots. Another abstract class, \code{CovRobust} is derived from \code{Cov}, which serves as a base class for all robust location and scatter estimators. The classes representing robust estimators like \code{CovMcd}, \code{CovMve}, etc. are derived from \code{CovRobust} and provide implementation for the corresponding methods. Each of the constructor functions \code{CovMcd()}, \code{CovMve()},\code{CovOgk()}, \code{CovMest()} and \code{CovSest()} performs the necessary computations and returns an object of the class containing the results. Similarly as the \code{CovClassic()} function, these functions can be called either with a data frame or a numeric matrix. \subsubsection{Controlling the estimation options} \label{oof-sec:cov-control} Although the different robust estimators of multivariate location and scatter have some controlling options in common, like the tracing flag \code{trace} or the numeric tolerance \code{tolSolve} to be used for inversion (\code{solve}) of the covariance matrix in \code{mahalanobis()}, each of them has more specific options. For example, the MCD and MVE estimators (\code{CovMcd()} and \code{CovMve()}) can specify \code{alpha} which controls the size of the subsets over which the determinant (the volume of the ellipsoid) is minimized. The allowed values are between 0.5 and 1 and the default is 0.5. Similarly, these estimators have parameters \code{nsamp} for the number of subsets used for initial estimates and \code{seed} for the initial seed for \proglang{R}'s random number generator while the M and S~estimators (\code{CovMest} and \code{CovSest}) have to specify the required breakdown point (allowed values between $(n - p)/(2*n)$ and 1 with default 0.5) as well as the asymptotic rejection point, i.e., the fraction of points receiving zero weight \citep{rocke:96}. These parameters can be passed directly to the corresponding constructor function but additionally there exists the possibility to use a control object serving as a container for the parameters. The object model for the control objects shown in Figure~\ref{oof-fig:cov-control} follows the proposed class hierarchy---there is a base class \code{CovControl} which holds the common parameters and from this class all control classes holding the specific parameters of their estimators are derived. These classes have only a constructor function for creating new objects and a method \code{restimate()} which takes a data frame or a matrix, calls the corresponding estimator to perform the calculations and returns the created class with the results. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{CovControl} \caption{Object model of the control classes for robust location and scatter estimation.} \label{oof-fig:cov-control} \end{center} \end{figure} Apart from providing a structured container for the estimation parameters this class hierarchy has the following additional benefits: \bi \item{the parameters can be passed easily to another multivariate method, for example the principal components analysis based on a covariance matrix \code{PcaCov()} (see Section~\ref{oof-sec:pca}) can take a control object which will be used to estimate the desired covariance (or correlation) matrix. In the following example a control object holding the parameters for S~estimation will be created and then \code{PcaCov()} will be called with this object.} <>= set.seed(1234) @ <>= ## ## Controlling the estimation options with a control object ## control <- CovControlSest(method="biweight") PcaCov(hbk.x, cov.control=control) @ \item{the class hierarchy of the control objects allows to handle different estimator objects using a uniform interface thus leveraging one of the most important features of the object oriented programming, the polymorphism. In the following example we create a list containing different control objects and then via \code{sapply} we call the generic function \code{restimate()} on each of the objects in the list. The outcome will be a list containing the objects resulting from these calls (all are derived from \code{CovRobust}). This looping over the different estimation methods is very useful for implementing simulation studies.} <>= ## ## Controlling the estimation options: example ## of looping through several estimators ## cc <- list(CovControlMcd(), CovControlMest(), CovControlOgk(), CovControlSest(), CovControlSest(method="rocke")) clist <- sapply(cc, restimate, x=delivery.x) sapply(clist, data.class) sapply(clist, getMeth) @ \ei \subsubsection[A generalized function for robust location and covariance estimation: CovRobust()]{A generalized function for robust location and covariance estimation: \code{CovRobust()}} \label{oof-sec:cov-covrobust} The provided variety of estimation methods, each of them with different parameters as well as the object models described in the previous sections can be overwhelming for the user, especially for the novice who does not care much about the technical implementation of the framework. Therefore a function is provided which gives a quick access to the robust estimates of location and covariance matrix. This function is loosely modeled around the \textit{abstract factory design pattern} \citep[see][page 87]{gamma} in the sense that it creates concrete objects of derived classes and returns the result over a base class interface. The class \code{CovRobust} is abstract (defined as \textit{VIRTUAL}) and no objects of it can be created but any of the classes derived from \code{CovRobust}, such as \code{CovMcd} or \code{CovOgk}, can act as an object of class \code{CovRobust}. The function \code{CovRobust()} which is technically not a constructor function can return an object of any of the classes derived from \code{CovRobust} according to the user request. This request can be specified in one of three forms: \bi \item{If only a data frame or matrix is provided and the control parameter is omitted, the function decides which estimate to apply according to the size of the problem at hand. If there are less than 1000 observations and less than 10 variables or less than 5000 observations and less than 5 variables, Stahel-Donoho estimator will be used. Otherwise, if there are less than 50000 observations, either bisquare S~estimates (in case of less than 10 variables) or Rocke type S~estimates (for 10 to 20 variables) will be used. In both cases the S iteration starts at the initial MVE estimate. And finally, if there are more than 50000 observations and/or more than 20 variables the Orthogonalized Quadrant Correlation estimator (\code{CovOgk} with the corresponding parameters) is used. This is illustrated by the following example.} <>= ## ## Automatically select the appropriate estimator according ## to the problem size. ## getMeth(CovRobust(matrix(rnorm(40), ncol=2))) # 20x2 - SDE getMeth(CovRobust(matrix(rnorm(16000), ncol=8))) # 2000x8 - bisquare S getMeth(CovRobust(matrix(rnorm(20000), ncol=10))) # 2000x10 - Rocke S getMeth(CovRobust(matrix(rnorm(200000), ncol=2))) # 100000x2 - OGK @ \item{The simplest way to choose an estimator is to provide a character string with the name of the estimator---one of \code{"mcd"}, \code{"ogk"}, \code{"m"}, \code{"s-fast"}, \code{"s-rocke"}, etc.} <>= ## ## Rocke-type S-estimates ## getMeth(CovRobust(matrix(rnorm(40), ncol=2), control="rocke")) @ \item{If it is necessary to specify also some estimation parameters, the user can create a control object (derived from \code{CovControl}) and pass it to the function together with the data. For example to compute the OGK estimator using the median absolute deviation (MAD) as a scale estimate and the quadrant correlation (QC) as a pairwise correlation estimate we create a control object \code{ctrl} passing the parameters \code{s_mad} and \code{s_qc} to the constructor function and then call \code{CovRobust} with this object. The last command line illustrates the accessor method for getting the correlation matrix of the estimate as well as a nice formatting method for covariance matrices.} <>= ## ## Specify some estimation parameters through a control object. ## The last command line illustrates the accessor method ## for getting the correlation matrix of the estimate ## as well as a nice formatting method for covariance ## matrices. ## data("toxicity") ctrl <- CovControlOgk(smrob = "s_mad", svrob = "qc") est <- CovRobust(toxicity, ctrl) round(getCenter(est),2) as.dist(round(getCorr(est), 2)) @ \ei \subsubsection{Visualization of the results} \label{oof-sec:cov-vis} The default plot accessed through the method \code{plot()} of class \code{CovRobust} is the Distance-Distance plot introduced by \citet{Rousseeuw-van-Zomeren}. An example of this graph, which plots the robust distances versus the classical Mahalanobis distances is shown in Figure~\ref{oof-fig:intro}. The dashed line represents the points for which the robust and classical distances are equal. The horizontal and vertical lines are drawn at values $x=y=\sqrt{\chi_{p,0.975}^2}$. Points beyond these lines can be considered as outliers and are identified by their labels. The other available plots are accessible either interactively or through the \code{which} parameter of the \code{plot()} method. The left panel of Figure~\ref{oof-fig:cov-lattice} shows an example of the distance plot in which robust and classical Mahalanobis distances are shown in parallel panels. The outliers have large robust distances and are identified by their labels. The right panel of Figure~\ref{oof-fig:cov-lattice} shows a Quantile-Quantile comparison plot of the robust and the classical Mahalanobis distances versus the square root of the quantiles of the chi-squared distribution. <>= ## ## Distance plot and Chi-square Q-Q plot of the robust and classical distances ## Lattice plots (currently not available in rrcov) ## library("lattice") library("grid") library("rrcov") data("delivery") X <- delivery[,1:2] myPanel.dd <- function(x, y, subscripts, cutoff, ...) { panel.xyplot(x, y, ...) panel.abline(h=cutoff,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] xrange<-range(y) adj <- (xrange[2]-xrange[1])/20 ltext(x[ind] + adj, y[ind] + adj, ind, cex=1.0) } } myPanel.qchi <- function(x, y, subscripts, cutoff, ...) { y <- sort(y, index.return=TRUE) iy <- y$ix y <- y$x panel.xyplot(x, y, ...) panel.abline(0,1,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- (n-id.n+1):n xrange<-range(y) adj <- (xrange[2]-xrange[1])/50 ltext(x[ind] + adj, y[ind] + adj, iy[ind], cex=1.0) } } n<-nrow(X) p <- ncol(X) cutoff <- sqrt(qchisq(0.975, p)) mm <- covMcd(X) dd1 <- sqrt(mm$mah) # robust distances vv<-cov.wt(X) dd2 <- sqrt(mahalanobis(X,vv$center,vv$cov)) # classical distances dd<-c(dd1,dd2) # both robust and classical distances gr <- as.factor(c(rep(1,n), rep(2,n))) levels(gr)[1] <- "Robust" levels(gr)[2] <- "Classical" qq <- sqrt(qchisq(((1:n)-1/3)/(n+1/3), p)) ind.dd <- c(1:n, 1:n) ind.qchi <- c(qq, qq) dplot <- xyplot(dd~ind.dd|gr, cutoff=cutoff, panel = myPanel.dd, xlab="Index", ylab="Mahalanobis distance", main="Distance Plot", col = "darkred", scales=list(cex=1.0)) qplot <- xyplot(dd~ind.qchi|gr, cutoff=cutoff, panel = myPanel.qchi, xlab="Quantiles of the chi-squared distribution", ylab="Mahalanobis distance", main="Chi-Square QQ-Plot", col = "darkred", scales=list(cex=1.0)) plot(dplot, split = c(1, 1, 2, 1), more = TRUE) plot(qplot, split = c(2, 1, 2, 1), more = FALSE) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-cov-plot-lattice} \caption{Distance plot and Chi-square Q-Q plot of the robust and classical distances.} \label{oof-fig:cov-lattice} \end{figure} \end{center} The next plot shown in Figure~\ref{oof-fig:cov-ellipse} presents a scatter plot of the data on which the 97.5\% robust and classical confidence ellipses are superimposed. Currently this plot is available only for bivariate data. The observations with distances larger than $\sqrt{\chi_{p,0.975}^2}$ are identified by their subscript. In the right panel of Figure~\ref{oof-fig:cov-ellipse} a \code{screeplot} of the \code{milk} data set is shown, presenting the robust and classical eigenvalues. <>= ## ## a) scatter plot of the data with robust and classical confidence ellipses. ## b) screeplot presenting the robust and classical eigenvalues ## data("milk") usr<-par(mfrow=c(1,2)) plot(CovMcd(delivery[,1:2]), which="tolEllipsePlot", classic=TRUE) plot(CovMcd(milk), which="screeplot", classic=TRUE) par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-cov-plot-ellipse} \caption{Robust and classical tolerance ellipse for the \code{delivery} data and robust and classical screeplot for the \code{milk} data.} \label{oof-fig:cov-ellipse} \end{figure} \end{center} \subsection{Principal component analysis} \label{oof-sec:pca} Principal component analysis is a widely used technique for dimension reduction achieved by finding a smaller number $q$ of linear combinations of the originally observed $p$ variables and retaining most of the variability of the data. Thus PCA is usually aiming at a graphical representation of the data in a lower dimensional space. The classical approach to PCA measures the variability through the empirical variance and is essentially based on computation of eigenvalues and eigenvectors of the sample covariance or correlation matrix. Therefore the results may be extremely sensitive to the presence of even a few atypical observations in the data. These discrepancies will carry over to any subsequent analysis and to any graphical display related to the principal components such as the biplot. %%% Example - hbk data The following example in Figure~\ref{oof-fig:pca-hbk} illustrates the effect of outliers on the classical PCA. The data set \code{hbk} from the package \pkg{robustbase} consists of 75 observations in 4 dimensions (one response and three explanatory variables) and was constructed by Hawkins, Bradu and Kass in 1984 for illustrating some of the merits of a robust technique \citep[see][]{rousseeuw-leroy}. The first 10 observations are bad leverage points, and the next four points are good leverage points (i.e., their $\xv$ are outlying, but the corresponding $y$ fit the model quite well). We will consider only the X-part of the data. The left panel shows the plot of the scores on the first two classical principal components (the first two components account for more than 98\% of the total variation). The outliers are identified as separate groups, but the regular points are far from the origin (where the mean of the scores should be located). Furthermore, the ten bad leverage points 1--10 lie within the 97.5\% tolerance ellipse and influence the classical estimates of location and scatter. The right panel shows the same plot based on robust estimates. We see that the estimate of the center is not shifted by the outliers and these outliers are clearly separated by the 97.5\% tolerance ellipse. \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} <>= ## ## Principal Component Analysis example: ## Plot of the first two principal components of the ## Hawkins, Bradu and Kass data set: classical and robust ## par(mfrow=c(1,2)) pca <- PcaClassic(hbk.x, k=2) cpca <- list(center=c(0,0), cov=diag(pca@eigenvalues), n.obs=pca@n.obs) rrcov:::.myellipse(pca@scores, xcov=cpca, main="Classical", xlab="PC1", ylab="PC2", ylim=c(-30,30), id.n=0) abline(v=0) abline(h=0) text(-29,6,labels="1-10", cex=0.8) text(-37,-13,labels="14", cex=0.8) text(-31,-5,labels="11-13", cex=0.8) hub <- PcaHubert(hbk.x, k=2, mcd=TRUE) chub <- list(center=c(0,0), cov=diag(hub@eigenvalues), n.obs=hub@n.obs) rrcov:::.myellipse(hub@scores, xcov=chub, main="Robust (MCD)", xlab="PC1", ylab="PC2", xlim=c(-10,45), ylim=c(-25,15), id.n=0) abline(v=0) abline(h=0) text(30,-9,labels="1-10", cex=0.8) text(36,-11,labels="11", cex=0.8) text(42,-4,labels="12", cex=0.8) text(41,-11,labels="13", cex=0.8) text(44,-15,labels="14", cex=0.8) @ \caption{Plot of the first two principal components of the Hawkins, Bradu and Kass data set: classical and robust.} \label{oof-fig:pca-hbk} \end{figure} \end{center} PCA was probably the first multivariate technique subjected to robustification, either by simply computing the eigenvalues and eigenvectors of a robust estimate of the covariance matrix or directly by estimating each principal component in a robust manner. Different approaches to robust PCA are briefly presented in the next subsections with the emphasis on those methods which are available in the framework. Details about the methods and algorithms can be found in the corresponding references. The object model is described and examples are given. \subsubsection{PCA based on robust covariance matrix (MCD, OGK, MVE, etc.)} The most straightforward and intuitive method to obtain robust PCA is to replace the classical estimates of location and covariance by their robust analogues. In the earlier works M~estimators of location and scatter were used for this purpose \citep[see][]{devlin:81, campbell:80} but these estimators have the disadvantage of low breakdown point in high dimensions. To cope with this problem \citet{naga:1990} used the MVE estimator and \citet{todorov-compstat:94} used the MCD estimator. \citet{croux-Haesbroeck:2000} investigated the properties of the MCD estimator and computed its influence function and efficiency. The package \pkg{stats} in base \proglang{R} contains the function \code{princomp()} which performs a principal components analysis on a given numeric data matrix and returns the results as an object of \proglang{S}3 class \code{princomp}. This function has a parameter \code{covmat} which can take a covariance matrix, or a covariance list as returned by \code{cov.wt}, and if supplied, it is used rather than the covariance matrix of the input data. This allows to obtain robust principal components by supplying the covariance matrix computed by \code{cov.mve} or \code{cov.mcd} from the package \pkg{MASS}. One could ask why is it then necessary to include such type of function in the framework (since it already exists in the base package). The essential value added of the framework, apart from implementing many new robust multivariate methods is the unification of the interfaces by leveraging the object orientation provided by the \proglang{S}4 classes and methods. The function \code{PcaCov()} computes robust PCA by replacing the classical covariance matrix with one of the robust covariance estimators available in the framework---MCD, OGK, MVE, M, S or Stahel-Donoho, i.e., the parameter \code{cov.control} can be any object of a class derived from the base class \code{CovControl}. This control class will be used to compute a robust estimate of the covariance matrix. If this parameter is omitted, MCD will be used by default. Of course any newly developed estimator following the concepts of the framework can be used as input to the function \code{PcaCov()}. \subsubsection{Projection pursuit methods} The second approach to robust PCA uses \textit{projection pursuit} (PP) and calculates directly the robust estimates of the eigenvalues and eigenvectors. Directions are seeked for, which maximize the variance (classical PCA) of the data projected onto them. Replacing the variance with a robust measure of spread yields robust PCA. Such a method was first introduced by \citet{li:1985} using an M~estimator of scale $S_n$ as a \textit{projection index (PI)}. They showed that the PCA estimates inherit the robustness properties of the scale estimator $S_n$. Unfortunately, in spite of the good statistical properties of the method, the algorithm they proposed was too complicated to be used in practice. A more tractable algorithm in these lines was first proposed by \citet{croux-Ruiz-Gazen:1996} and later improved by \citet{croux-Ruiz-Gazen:2005}. To improve the performance of the algorithm for high dimensional data a new improved version was proposed by \citet{croux-filzmoser-oliveira-pppca}. The latter two algorithms are available in the package \pkg{pcaPP} \citep[see][]{filzmoser-pcaPP} as functions \code{PCAproj()} and \code{PCAgrid()}. In the framework these methods are represented by the classes \code{PcaProj} and \code{PcaGrid}. Their generating functions provide simple wrappers around the original functions from \pkg{pcaPP} and return objects of the corresponding class, derived from \code{PcaRobust}. A major advantage of the PP-approach is that it searches for the eigenvectors consecutively and in case of high dimensional data when we are interested in only the first one or two principal components this results in reduced computational time. Even more, the PP-estimates cope with the main drawback of the covariance-based estimates---they can be computed for data matrices with more variables than observations. \subsubsection{Hubert method (ROBPCA)} The PCA method proposed by \citet{hubert-ROBPCA:2005} tries to combine the advantages of both approaches---the PCA based on a robust covariance matrix and PCA based on projection pursuit. A brief description of the algorithm follows, for details see the relevant references \citep{hubert:2008}. Let $n$ denote the number of observations, and $p$ the number of original variables in the input data matrix $\v{X}$. The ROBPCA algorithm finds a robust center $\mv$ of the data and a loading matrix $\v{P}$ of dimension $p \times k$. Its columns are orthogonal and define a new coordinate system. The scores $\v{T}$, an $n \times k$ matrix, are the coordinates of the centered observations with respect to the loadings: \begin{equation} \label{oof-eq:pca-scores} \v{T}=(\v{X}-\v{1}\mv^{\top})\v{P} \end{equation} where $\v{1}$ is a column vector with all $n$ components equal to 1. The ROBPCA algorithm yields also a robust covariance matrix (often singular) which can be computed as \begin{equation} \label{oof-eq:pca-S} \v{S}=\v{PLP}^{\top} \end{equation} where $\v{L}$ is the diagonal matrix with the eigenvalues $l_1, \dots, l_k$. This is done in the following three main steps: \paragraph{Step 1:} The data are preprocessed by reducing their data space to the subspace spanned by the $n$ observations. This is done by singular value decomposition of the input data matrix. As a result the data are represented in a space whose dimension is $rank(\v{X})$, being at most $n-1$ without loss of information. \paragraph{Step 2:} In this step a measure of outlyingness is computed for each data point. For this purpose the data points are projected on the $n(n-1)/2$ univariate directions through each two points. If $n$ is too large, \code{maxdir} directions are chosen at random (\code{maxdir} defaults to 250 but can be changed by the user). On every direction the univariate MCD estimator of location and scale is computed and the standardized distance to the center is measured. The largest of these distances (over all considered directions) is the outlyingness measure of the data point. The $h$ data points with smallest outlyingness measure are used to compute the covariance matrix $\v{\Sigma}_h$ and to select the number $k$ of principal components to retain. This is done by finding $k$ such that $l_k/l_1 \ge 10^{-3}$ and $\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j \ge 0.8$. Alternatively the number of principal components $k$ can be specified by the user after inspecting the scree plot. \paragraph{Step 3:} The data points are projected on the $k$-dimensional subspace spanned by the $k$ eigenvectors corresponding to the largest $k$ eigenvalues of the matrix $\v{\Sigma}_h$. The location and scatter of the projected data are computed using the reweighted MCD estimator, and the eigenvectors of this scatter matrix yield the robust principal components. \subsubsection{Spherical principal components (SPC)} The spherical principal components procedure was first proposed by \cite{locantore:1999} as a method for functional data analysis. The idea is to perform classical PCA on the data, projected onto a unit sphere. The estimates of the eigenvectors are consistent if the data are elliptically distributed \cite[see][]{boente-fraiman:1999} and the procedure is extremely fast. Although not much is known about the efficiency of this method, the simulations of \cite{maronna:2005} show that it has very good performance. If each coordinate of the data is normalized using some kind of robust scale, like for example the MAD, and then SPC is applied, we obtain ``elliptical PCA'', but unfortunately this procedure is not consistent. \subsubsection{Object model for robust PCA and examples} \label{oof-sec:pca-objmodel} The object model for the \proglang{S}4 classes and methods implementing the principal component analysis methods follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-pca}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{PcaModel} \caption{Object model for robust Principal Component Analysis.} \label{fig:uml-pca} \end{center} \end{figure} The abstract class \code{Pca} serves as a base class for deriving all classes representing classical and robust principal components analysis methods. It defines the common slots and the corresponding accessor methods, provides implementation for the general methods like \code{show()}, \code{plot()}, \code{summary()} and \code{predict()}. The slots of \code{Pca} hold some input or default parameters like the requested number of components as well as the results of the computations: the eigenvalues, the loadings and the scores. The \code{show()} method presents brief results of the computations, and the \code{predict()} method projects the original or new data to the space spanned by the principal components. It can be used either with new observations or with the scores (if no new data are provided). The \code{summary()} method returns an object of class \code{SummaryPca} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new information (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. Classical principal component analysis is represented by the class \code{PcaClassic} which inherits directly from \code{Pca} (and uses all slots and methods defined there). The function \code{PcaClassic()} serves as a constructor (generating function) of the class. It can be called either by providing a data frame or matrix or a formula with no response variable, referring only to numeric variables. Let us consider the following simple example with the data set \code{hbk} from the package \pkg{robustbase}. The code line \begin{Scode} R> PcaClassic(hbk.x) \end{Scode} can be rewritten as (and is equivalent to) the following code line using the formula interface \begin{Scode} R> PcaClassic(~ ., data = hbk.x) \end{Scode} The function \code{PcaClassic()} performs the standard principal components analysis and returns an object of the class \code{PcaClassic}. <>= ## ## Classical PCA ## pca <- PcaClassic(~., data=hbk.x) pca summary(pca) plot(pca) getLoadings(pca) @ The \code{show()} method displays the standard deviations of the resulting principal components, the loadings and the original call. The \code{summary()} method presents the importance of the calculated components. The \code{plot()} draws a PCA diagnostic plot which is shown and described later. The accessor functions like \code{getLoadings()}, \code{getEigenvalues()}, etc. are used to access the corresponding slots, and \code{predict()} is used to rotate the original or new data to the space of the principle components. Another abstract class, \code{PcaRobust} is derived from \code{Pca}, which serves as a base class for all robust principal components methods. The classes representing robust PCA methods like \code{PcaHubert}, \code{PcaLocantore}, etc. are derived from \code{PcaRobust} and provide implementation for the corresponding methods. Each of the constructor functions \code{PcaCov()}, \code{PcaHubert()}, \code{PcaLocantore()}, \code{PcaGrid()} and \code{PcaProj()} performs the necessary computations and returns an object of the class containing the results. In the following example the same data are analyzed using the projection pursuit method \code{PcaGrid()}. <>= ## ## Robust PCA ## rpca <- PcaGrid(~., data=hbk.x) rpca summary(rpca) @ Similar to the function \code{PcaClassic()}, these functions can be called either with a data frame or matrix or by a formula interface. \subsubsection{Visualization of PCA results} \label{oof-sec:pca-vis} One of the most important applications of PCA, besides dimensionality reduction is data visualization. In the framework several plots for visualizing the results of the analysis are available. The \code{plot()} methods are implemented in the base class \code{Pca} and thus they are available for all objects derived from the class \code{Pca} no matter if classical and robust. The most straightforward plot is the \textit{screeplot} which plots the variances against the number of principal components (similar to the screeplot for the standard \code{prcomp()} and \code{princomp()} functions). It is a useful tool for determining the number of relevant principal components. An example of the classical and robust screeplot for the \code{milk} data from \pkg{robustbase} is shown in Figure~\ref{oof-fig:pca-screeplot}. <>= ## ## Screeplot for classical and robust PCA of the milk data set. ## usr <- par(mfrow=c(1,2)) screeplot(PcaClassic(milk), type="lines", main="Screeplot: classical PCA", sub="milk data") screeplot(PcaHubert(milk), type="lines", main="Screeplot: robust PCA", sub="milk data") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-screeplot} \caption{Screeplot for classical and robust PCA of the \code{milk} data set.} \label{oof-fig:pca-screeplot} \end{figure} \end{center} Another plot borrowed from standard \proglang{R} is the \textit{biplot}. The biplot \citep{gabriel} represents both the observations and variables in the plane of (the first) two principal components allowing the visualization of the magnitude and sign of each variable's contribution to these principal components. Each observation (row of scores) is represented as a point in the biplot and each variable is represented as an arrow. The arrows graphically indicate the proportion of the original variance explained by the (first) two principal components and their direction indicates the relative loadings on these components. Figure~\ref{oof-fig:pca-biplot} shows an example of the robust biplot of the \code{un86} data set which contains seven socioeconomic variables observed for 73 countries. The data set is from World Statistics in Brief, Number 10, a 1986 UN publication. It was used in \citet{Daigle:1992} to illustrate a robust biplot method. <>= ## ## Robust biplot for the UN86 data ## data("un86") set.seed(9) usr<-par(mfrow=c(1,2)) biplot(PcaCov(un86, corr=TRUE, cov.control=NULL), main="Classical biplot", col=c("gray55", "red")) biplot(PcaCov(un86, corr=TRUE), main="Robust biplot", col=c("gray55", "red")) par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-biplot} \caption{Classical (left panel) and robust (right panel) biplot for the \code{UN86} data.} \label{oof-fig:pca-biplot} \end{figure} \end{center} %% diagnostic plot (outlier map) In the context of PCA \citet{hubert-ROBPCA:2005} defined a \textit{diagnostic plot} or \textit{outlier map} which helps to distinguish between the regular observations and the different types of outliers. This plot is based on the \textit{score distances} and \textit{orthogonal distances} computed for each observation. The score distances are given by \begin{equation} \label{oof-eq:pca-SD} SD_i=\sqrt{\sum_{j=1}^k{\frac{t_{ij}^2}{l_j}}},~~~~ i=1,\ldots,n \end{equation} where $t_{ij}$ are the elements of the scores from (\ref{oof-eq:pca-scores}) and $l_j$ are the eignevalues (the diagonal elements of the matrix $\v{L}$ in (\ref{oof-eq:pca-S})). The orthogonal distances $OD_i$ of each observation to the subspace spanned by the first $k$ ($1\le k \le r$, $r$ is the rank of the data) principal components are defined by \begin{equation} \label{oof-eq:pca-OD} OD_i=||\xv_i - \hat{\muv} - \v{P}^{(k)}\tv_i^{(k)}||,~~~~ i=1,\ldots,n \end{equation} where $\xv_i$ denotes the $i$th observation, $\hat{\muv}$ is the estimated center of the data, $\tv_i^{(k)}$ is the $i$th score vector in the space of the first $k$ principal components and the matrix $\v{P}^{(k)}$ contains the first $k$ estimated eigenvectors in its columns. The diagnostic plot is constructed by plotting the score distances on the horizontal axis, the orthogonal distances on the vertical axis and drawing two cutoff lines which will help to classify the observations. The cutoff value on the horizontal axis (for the score distances) is taken as the 97.5\% quantile of $\chi_k^2$ distribution, i.e., $c_h=\sqrt{\chi^2_{k,0.975}}$. For the cutoff value on the vertical axis (for the orthogonal distances) the Wilson-Hilferty transformation for a $\chi^2$ distribution is used (which assumes that the $OD_i$ to the power of 2/3 are approximately normally distributed). The parameters $\mu$ and $\sigma$ of the normal distribution can be estimated by the median and MAD of the values $OD_i^{2/3}$, and the critical value can be taken as $c_v=(\hat{\mu} + \hat{\sigma}z_{0.975})^{3/2}$ where $z_{0.975}$ is the the 97.5\% quantile of the standard normal distribution. An example of the classical and robust diagnostic plot for the \code{hbk} data set from \pkg{robustbase} is shown in Figure~\ref{oof-fig:pca-diagplot}. <>= ## ## An example of the classical and robust diagnostic ## plot for the hbk data set ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=2), sub="data set: hbk, k=2") plot(PcaHubert(hbk.x, k=2), sub="data set: hbk, k=2") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-diagplot} \caption{Classical and robust diagnostic plot for the \code{hbk} data with $k=2$.} \label{oof-fig:pca-diagplot} \end{figure} \end{center} If $k=p$ the orthogonal distances are not meaningful and the diagnostic plot shows a simple distance plot of the score distances (distances vs index). An example is shown in Figure~\ref{oof-fig:pca-distplot}. <>= ## ## If k=p the orthogonal distances are not meaningful and ## simple distance plot of the score distances will be shown ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=3), sub="data set: hbk.x, k=3") plot(PcaHubert(hbk.x, k=3), sub="data set: hbk.x, k=3") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-distplot} \caption{Classical and robust diagnostic plot for the x-part of the \code{hbk} data set with $k=3=p$.} \label{oof-fig:pca-distplot} \end{figure} \end{center} \subsection{Linear and quadratic discriminant analysis} \label{oof-sec:lda} The problem of discriminant analysis arises when one wants to assign an individual to one of $g$ populations at the basis of a $p$-dimensional feature vector $\xv$. Let the $p$-dimensional random variable $\xv_k$ come from a population $\pi_k$ with underlying density $\v{f}_k$. Further let the prior probability of group $k$, i.e., the probability that an individual comes from population $\pi_k$ be $\alpha_k$, $\Sigma_{k=1}^g \alpha_k = 1$. The prior probabilities $\alpha_k$ are usually estimated by the empirical frequencies $n_k$ in the $k$-th group of the training set, i.e., $\hat{\alpha}_k=n_k/\Sigma_{j=1}^gn_j$. Then the Bayesian discriminant rule assigns an observation $\xv$ to that population $\pi_k$ for which the expression $\ln(\alpha_k \v{f}_k(\xv))$ is maximal over all groups $k=1,\ldots,g$. Usually it is assumed that the $k$ populations $\pi_k$ are $p$-dimensional normally distributed, \begin{equation} \label{oof-eq:discrim-distr} \pi_k \sim N({\muv}_k,\v{\Sigma}_k)~~~~~k=1,\ldots,g. \end{equation} With this assumption the discriminant rule is equivalent to maximizing the discriminant scores $D_k(\xv)$ given by \begin{equation} \label{oof-eq:QDA} D_k(\xv) = -\frac{1}{2}\ln|\v{\Sigma}_k| - \frac{1}{2}(\xv-\muv_k)^{\top}\v{\Sigma}_k^{-1}(\xv-\muv_k) + \ln(\alpha_k)~~~~~(k=1,\ldots,g), \end{equation} and individual $\xv$ is assigned to $\pi_k$ if \begin{equation} \label{oof-eq:QDA-rule} D_k(\xv)=\arg\max_j D_j(\xv). \end{equation} The application of the discrimination rule given by Equations~(\ref{oof-eq:QDA}) and (\ref{oof-eq:QDA-rule}) is referred to as quadratic discriminant analysis (QDA), since the groups are separated by quadratic boundaries. If it is further assumed that all group covariance matrices are equal $(\v{\Sigma}_{1}= \ldots= \v{\Sigma}_g=\v{\Sigma})$, then the overall probability of misclassification is minimized by assigning a new observation $\xv$ to population $\pi_k$ which maximizes \begin{equation} \label{oof-eq:LDA} %%%%%%%%d_k(\xv)=\frac{1}{2}(\xv-\muv_k)^{\top}\v{\Sigma}^{-1}(\xv-\muv_k) + \ln(\alpha_k)~~~~~(k=1,\ldots,g). d_k(\xv)=\xv^{\top}\v{\Sigma}^{-1}\muv_k - \frac{1}{2}\muv_k^{\top}\v{\Sigma}^{-1}\muv_k + \ln(\alpha_k)~~~~~(k=1,\ldots,g). \end{equation} The application of the discriminant rule given by Equation~(\ref{oof-eq:LDA}) is referred to as linear discriminant analysis (LDA), since the scores $d_k(\xv)$ are linear in $\xv$. If the means $\muv_k, k=1,\ldots,g$, and the common covariance matrix $\v{\Sigma}$ are unknown, which is usually the case, a training set consisting of samples drawn from each of the populations is required. In classical QDA and LDA the sample group means and sample covariance matrices are used to estimate $\muv_k$, $\v{\Sigma}_k$ and $\v{\Sigma}$. The prior probabilities can be estimated by the relative frequencies of observations in each particular group. Both QDA and LDA using the classical estimates in (\ref{oof-eq:QDA}) and (\ref{oof-eq:LDA}) are vulnerable to the presence of outliers. The problem of the non-robustness of the classical estimates in the setting of the quadratic and linear discriminant analysis has been addressed by many authors: \citet*{todorov:90, todorov:94} replaced the classical estimates by MCD estimates; \citet*{chork} used MVE instead; \citet*{hawkins:97} defined the minimum within-group covariance determinant estimator (MWCD) especially for the case of linear discriminant analysis; \citet*{he:2000} and \citet*{croux-dehon:01} used S~estimates; \citet*{hubert:04} applied the MCD estimates computed by the FAST-MCD algorithm. For a recent review and comparison of these methods see \citet{todorov-roblda}. A robust version of quadratic discriminant analysis can be obtained by substituting the parameters $\muv_k$, $\v{\Sigma}_k$ by their robust estimates. For this purpose the reweighted MCD estimates, S~estimates or OGK can be used. In the case of linear discriminant analysis a robust version of the common covariance matrix $\v{\Sigma}$ is necessary. There are several methods for estimating the common covariance matrix based on a high breakdown point estimator which are considered in one of the next subsections. \subsubsection{Object model for robust LDA and QDA} The object model for the \proglang{S}4 classes and methods implementing the linear and quadratic discriminant analysis methods follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-lda-qda}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{DAModel} \caption{Object models for robust linear discriminant analysis and quadratic discriminant analysis.} \label{fig:uml-lda-qda} \end{center} \end{figure} The abstract classes \code{Lda} and \code{Qda} serve as base classes for deriving all classes representing classical and robust methods for linear and quadratic discriminant analysis methods. They define the common slots and the corresponding accessor methods, provide implementation for the general methods like \code{show()}, \code{plot()}, \code{summary()} and \code{predict()}. This base classes also host several utility functions which are not directly exported but are documented and can be used by quoting the namespace. The slots of \code{Lda} hold some input or default parameters like the prior probabilities, the original data matrix and the grouping variable as well as the results of the computations: the group means and the common covariance matrix, the linear discriminant functions and the corresponding constants. The \code{show()} method presents brief results of the computations, and \code{predict()} can be used either for classifying new observations or for the evaluation of the discriminant rules on the basis of the training sample. The method \code{predict()} returns an object of class \code{PredictLda} which has its own \code{show()} method to print the results of the classification or evaluation. The \code{summary()} method returns an object of class \code{SummaryLda} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new data (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. Classical linear discriminant analysis is represented by the class \code{LdaClassic} which inherits directly from \code{Lda} (and uses all slots and methods defined there). The function \code{LdaClassic()} serves as a constructor (generating function) of the class. It can be called either by providing a data frame or matrix and a grouping variable (factor) or a formula specifying the model to be used. Let us consider the following simple example with the data set \code{diabetes}: the grouping variable is \code{diabetes$group} and the three explanatory variables are \code{glucose}, \code{insulin} and \code{sspg}. The code \begin{Scode} R> x <- diabetes[, c("glucose", "insulin", "sspg")] R> grpvar <- diabetes$group R> LdaClassic(x, grpvar) \end{Scode} can be rewritten as (and is equivalent to) the following code using the formula interface: \begin{Scode} R> LdaClassic(group ~ ., data = diabetes) \end{Scode} The function \code{LdaClassic()} performs standard linear discriminant analysis and returns an object of class \code{LdaClassic}. Another abstract class, \code{LdaRobust} is derived from \code{Lda}, which serves as a base class for all robust linear discriminant analysis methods. The only slot added in this class is a character variable specifying the robust method to be used. The class \code{Linda} is derived from \code{LdaRobust} and provides implementation for all methods for robust LDA currently available in the framework. If we wanted to be precisely object oriented, we should define a separate class for each robust method---for example \code{LdaRobustMcd}, \code{LdaRobustFsa}, etc. but this would lead to explosion of the necessary code and documentation. The constructor function \code{Linda()} takes a character parameter \code{method} specifying which robust location and scatter estimator to use and how to compute the common covariance matrix and returns an object of class \code{Linda}. Similarly as the function \code{LdaClassic()}, \code{Linda()} can be called either with a data matrix and grouping variable or by a formula interface. \subsubsection{Computing the common covariance matrix} \label{oof-sec:common-cov} The easiest way to estimate the common covariance matrix $\v{\Sigma}$ is to obtain the estimates of the group means $\muv_k$ and group covariance matrices $\v{\Sigma}_k$ from the individual groups as $(\mv_k,\v{C}_k), k=1,\ldots,g$, and then pool the estimates $\v{C}_k, k=1,\ldots,g$ to yield the common covariance matrix \begin{equation} \v{C} = {\sum_{k=1}^g{n_k\v{C}_k} \over \sum_{k=1}^g{n_k-g}}. \end{equation} This method, using MVE and MCD estimates, was proposed by \citet{todorov:90, todorov:94} and was also used, based on the MVE estimator by \citet*{chork}. \newline \citet*{croux-dehon:01} applied this procedure for robustifying linear discriminant analysis based on S~estimates. A drawback of this method is that the same trimming proportions are applied to all groups which could lead to a loss of efficiency if some groups are outlier free. We will denote this method as ``$A$'' and the corresponding estimator as XXX-A. For example, in the case of the MCD estimator this will be MCD-A. Another method was proposed by \citet*{he:2000} for the S~estimates and was later adapted by \citet*{hubert:04} for the MCD estimates. Instead of pooling the group covariance matrices, the observations are centered and pooled to obtain a single sample for which the covariance matrix is estimated. It starts by obtaining the individual group location estimates $\tv_k, k=1,\ldots,g$, as the reweighted MCD location estimates of each group. These group means are swept from the original observations $\xv_{ik}~(i=1,\ldots,n_k;~k=1,\ldots,g)$ to obtain the centered observations \begin{eqnarray} \v{Z} = \{\zv_{ik}\}, ~~~~~\zv_{ik} = \xv_{ik} - \tv_k. \end{eqnarray} The common covariance matrix $\v{C}$ is estimated as the reweighted MCD covariance matrix of the centered observations $\v{Z}$. The location estimate $\deltav$ of $\v{Z}$ is used to adjust the group means $\mv_k$ and thus the final group means are \begin{equation} \mv_k = {\tv_k + \deltav}. \end{equation} This process could be iterated until convergence, but since the improvements from such iterations are negligible \citep[see][]{ he:2000, hubert:04} we are not going to use it. This method will be denoted by ``$B$'' and as already mentioned, the corresponding estimator as XXX-B, for example MCD-B. The third approach is to modify the algorithm for high breakdown point estimation itself in order to accommodate the pooled sample. \citet*{he:2000} modified Ruperts's SURREAL algorithm for S~estimation in case of two groups. \citet*{hawkins:97} defined the minimum within-group covariance determinant estimator which does not apply the same trimming proportion to each group but minimizes directly the determinant of the common within groups covariance matrix by pairwise swaps of observations. Unfortunately their estimator is based on the Feasible Solution Algorithm \citep[see][and the references therein]{hawkins:97}, which is extremely time consuming as compared to the FAST-MCD algorithm. \citet*{hubert:04} proposed a modification of this algorithm taking advantage of the FAST-MCD, but it is still necessary to compute the MCD for each individual group. This method will be denoted by MCD-C. Using the estimates $\mv^0_k$ and $\v{C}_0$ obtained by one of the methods, we can calculate the initial robust distances \citep{Rousseeuw-van-Zomeren} \begin{equation} RD^0_{ik}= \sqrt{(\xv_{ik}-\mv^0_k)^{\top}\v{C}_0^{-1}(\xv_{ik}-\mv^0_k)}. \end{equation} With these initial robust distances we can define a weight for each observation $\xv_{ik}, ~ i=1, \ldots , n_k$ and $k=1, \ldots, g$, by setting the weight to $1$ if the corresponding robust distance is less or equal to a suitable cut-off, usually $\sqrt{\chi^2_{p,0.975}}$, and to 0 otherwise, i.e., \begin{equation} \label{oof-eq:mdiv} w_{ik} = \begin{cases} 1&RD^0_{ik} \leq \sqrt{\chi^2_{p,0.975}} \\ 0&\text{otherwise}.\\ \end{cases} \end{equation} With these weights we can calculate the final reweighted estimates of the group means, $\mv_k$, and the common within-groups covariance matrix, $\v{C}$, which are necessary for constructing the robust classification rules, \begin{eqnarray} \mv_k &=& (\sum^{n_k}_{i=1}{w_{ik}\xv_{ik}})/\nu_k, \nonumber\\ \v{C} &=& \frac{1}{\nu-g}\sum^g_{k=1}\sum^{n_k}_{i=1}{w_{ik}(\xv_{ik}-\mv_k)(\xv_{ik}-\mv_k)^{\top}}, \end{eqnarray} where $\nu_k$ are the sums of the weights within group $k$, for $k=1,\ldots,g$, and $\nu$ is the total sum of weights, \begin{equation} \nu_k =\sum^{n_k}_{i=1}{w_{ik}}, ~~~~\nu = \sum^{g}_{k=1}{\nu_k}. \nonumber \end{equation} \subsubsection{Evaluation of the discriminant rules} In order to evaluate and compare different discriminant rules, their discriminating power has to be determined in the classification of future observations, i.e., we need an estimate of the overall probability of misclassification. A number of methods to estimate this probability exists in the literature---see for example \citet{lachenbruch:1975}. The \textit{apparent error rate} (known also as resubstitution error rate or reclassification error rate) is the most straightforward estimator of the actual error rate in discriminant analysis and is calculated by applying the classification criterion to the same data set from which it was derived. The number of misclassified observations for each group is divided by the group sample size. An estimate of the apparent error rate is calculated by the method \code{predict()} of the class \code{Lda}. Examples are given in the next section. It is well known that this method is too optimistic (the true error is likely to be higher). If there are plenty of observations in each class, the error rate can be estimated by splitting the data into training and validation set. The first one is used to estimate the discriminant rules and the second to estimate the misclassification error. This method is fast and easy to apply but it is wasteful of data. Another method is the \textit{leave-one-out} \textit{cross-validation} \citep{lachenbruch-michey:68} which proceeds by removing one observation from the data set, estimating the discriminant rule, using the remaining $n-1$ observations and then classifying this observation with the estimated discriminant rule. For the classical discriminant analysis there exist updating formulas which avoid the re-computation of the discriminant rule at each step, but no such formulas are available for the robust methods. Thus the estimation of the error rate by this method can be very time consuming depending on the size of the data set. Nevertheless, \pkg{rrcov} provides an (internal, not exported) function \code{rrcov:::.CV()} which calculates the leave-one-out cross-validation error rate by ``brute force'', but the user should be aware that its usage is appropriate only for moderate data sets. An improvement will be the implementation of a cross-validation technique similar to the one proposed by \citet{hubert:2007-CV}. \subsubsection{Example: Diabetes data} \label{oof:sec-diabetes} As an example for demonstrating the usage of the robust discriminant analysis classes and methods we use the \code{diabetes} data set, which was analyzed by \citet*{reaven-miller} in an attempt to examine the relationship between chemical diabetes and overt diabetes in 145 nonobese adult subjects. Their analysis was focused on three primary variables and the 145 individuals were classified initially on the basis of their plasma glucose levels into three groups: normal subjects, chemical diabetes and overt diabetes. This data set was also analyzed by \citet*{hawkins:97} in the context of robust linear discriminant analysis. The data set is available in several \proglang{R} packages: \code{diabetes} in package \pkg{mclust} \citep{mclust}, \code{chemdiab} in package \pkg{locfit} \citep{locfit} and \code{diabetes.dat} in \pkg{Rfwdmv} \citep{Rfwdmv}. We are going to use the one from \pkg{mclust} in which the value of the second variable, $insulin$, on the 104th observation, is 45 while for the other data sets this value is 455 (note that 45 is more likely to be an outlier in this variable than 455). We start with bringing the data set \code{diabetes} from package \pkg{mclust} into the workspace by typing <>= data("diabetes") @ Using the package \pkg{lattice} \citep{Sarkar:2008} we produce a three dimensional cloud plot of the data (Figure~\ref{lda-cloud}). << lda-cloud, fig=FALSE>>= library("lattice") # load the graphical library ## set different plot symbols - important for black-and-white print sup.sym <- trellis.par.get("superpose.symbol") sup.sym$pch <- c(1,2,3,4,5) trellis.par.set("superpose.symbol", sup.sym) cloud.plt <- cloud(insulin ~ glucose + sspg, groups = group, data = diabetes, auto.key=TRUE) @ \begin{center} \begin{figure}[h!] << lda-cloud-fig, fig=TRUE>>= print(cloud.plt) @ \caption{Three dimensional scatter plot of the \code{diabetes} data.} \label{lda-cloud} \end{figure} \end{center} We will first apply the classical linear discriminant analysis as implemented in \code{LdaClassic()} by the formula interface of the function---the grouping variable is \code{class} and all the remaining variables in \code{diabetes} are used as predictor variables. The \code{show()} method will present the results of the computations: the group means, the (common) within group covariance matrix, the linear discriminant functions together with the corresponding constants. The prior probabilities (either provided by the user or estimated as a proportion of the groups) are also presented. << lda-classic>>= lda <- LdaClassic(group~glucose+insulin+sspg, data=diabetes) lda @ Now the \code{predict()} method can be used on the \code{Lda} object (\code{Lda} is the base class for both \code{LdaClassic} and \code{LdaRobust}) in order to classify new observations. The method returns an object of class \code{PredictLda} which has its own \code{show()} method. If no new data are supplied, the training sample will be reclassified and a classification table will be produced to estimate the apparent error rate of the classification rules. << lda-classic-predict>>= predict(lda) @ Robust linear discriminant analysis can be performed in a similar way but using the function \code{Linda} (which will create an object of class \code{Linda}). As before the \code{predict()} method called without new data returns a classification table of the training subsample. Using the internal convenience function \code{rrcov:::.AER()} we can calculate and print the apparent error rate (which now is equal to 0.1103 and is lower than the obtained with the classical LDA 0.1310). << lda-robust>>= rlda <- Linda(group~glucose+insulin+sspg, data=diabetes) rlda rlda.predict <- predict(rlda) cat("\nApparent error rate: ", round(rrcov:::.AER(rlda.predict@ct),4)) @ In the above example we did not specify which method for computing the common covariance matrix should be used (thus using the default method ``MCD-B'' described above). We could choose the method by providing the \code{method} parameter to the function \code{Linda()}. For example the following call \begin{Scode} R> rlda <- Linda(group~glucose+insulin+sspg, data = diabetes, method = "fsa") \end{Scode} will use the \citet*{hawkins:97} \textit{feasible solution algorithm} method. The variance-covariance structures of the three classes in the \code{diabetes} data set differ substantially and we can expect improved results if quadratic discriminant analysis is used. Robust quadratic discriminant analysis is performed by the function \code{QdaCov()} which will return an object of class \code{QdaCov}. << qda-robust>>= rqda <- QdaCov(group~glucose+insulin+sspg, data=diabetes) rqda rqda.predict <- predict(rqda) cat("\nApparent error rate: ", round(rrcov:::.AER(rqda.predict@ct),4)) @ The accuracy of the prediction improves compared to the linear discriminant analysis. \section{Conclusions} \label{oof-sec:conclusions} In this paper we presented an object oriented framework for robust multivariate analysis developed in the \proglang{S}4 class system of the programming environment \proglang{R}. The main goal of the framework is to support the usage, experimentation, development and testing of robust multivariate methods as well as simplifying comparisons with related methods. It minimizes the effort for performing any of the following tasks: \bi \item{application of the already existing robust multivariate methods for practical data analysis;} \item{implementation of new robust multivariate methods or variants of the existing ones;} \item{evaluation of existing and new methods by carrying out comparison studies.} \ei A major design goal was the openness to extensions by the development of new robust methods in the package \pkg{rrcov} or in other packages depending on \pkg{rrcov}. Further classes implementing robust multivariate methods like principal component regression and partial least squares will follow but the user is encouraged to develop own methods using the proposed reusable statistical design patterns. \section*{Acknowledgements} We wish to express our thanks to the organizers of and participants in the ``Robust Statistics and \proglang{R}'' workshops for the valuable comments and suggestions which were a major input for the development of this framework. We are also grateful to many people, notably Matias Salibian-Barrera, Victor Yohai, Kjell Konis, and Christophe Croux for the provided code. The careful review and constructive comments of the editor and the anonymous reviewers helped us to substantially improve the manuscript. The views expressed herein are those of the authors and do not necessarily reflect the views of the United Nations Industrial Development Organization (UNIDO). \bibliography{mybiblio} \end{document} rrcov/vignettes/PcaModel.pdf0000644000176200001440000003022512763517421015606 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xYKs6WVx챙NzHgķf,Pbqjґ^ S^">__!9|L9]"_f~&՚-b{so_HFYAoX+[K9>o<: |uis+e~eWMcMj6r)m2#Tw*w7Q) ?z,-췷 ̮85uTuxzoL s6"FI%s6iv9ͱ&svwjw= ̼00GaV{ \Yqd(%Ē^^Z|/W^Mփ-gf3$rSY(Ǭ ?k %8p'8儀Xh.X&PFK֠9vX0@W.T)U4nzdBRNS4P'j1oXFp9ImP}ɲWiUPq%E4f@BIʀJUd ǶlxS%ix]B.ѵM5zO_9(n'Dy'q];Z.z|%|pMp='؆E>:o BoeF$lŠJA.`ZɈ5͟aPL'VYGjp@XPJl ~y]<ǡ-dafq+A}m ~Q{m$0Mq+ B;m=J,U4%nVS?+76 @u=%`2qjxI`HOh0Ai3Ǿ^A^Hbr|MKvR!-(?A)8"Oi];K>#8+W[T(lO1l߫ѣc-˩"96x)Hz7Z $>H*GG ۄbac7oڠpx,f6a[>ϑ. 3ˢ0p6Cߞ_ HS(wdtFvv|%#lPeI)%?s? v(>Y@romPN G2DUFw#1\_%-3GB[Ni#Q˧ixJpv: SX-ԇ3MʯXv,p|u%tkDZ̅[ɑec? 75ݱSuL> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 14 0 obj <> endobj 15 0 obj <> endobj 8 0 obj <> endobj 10 0 obj <> endobj 12 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <>stream xSkPWٮQHBnVQA]D[5$XdCvDy+>DʳZ!iS:v2Μet#ؿw9s  * eX}l:d[iwt8M!N=0>bTю&A^W|:Q|8i]ѡU1'1>9x޼pl0 [x1JAL )rh3ih 420,cRD9Q1(6-r:hO#gA8ćU<"Ldef7̴|F 2,Z@!Ƥcz77p&-eD.0fɌqkF{2gdqYj^`1H7O: of6W.e0[)c=Y EnWTkf<{?#4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ɚqĺ.GHhA,Mx;CxSn+%+ QtF )Bwn@MFpcg)`}0z__eK֪siťvl>%0RPP{d5EWVui>D|Ikzy`f`A"jB~Am,dӮNYc34c^ͫ7qI#5S'|x-r4,HMK;#41Jmu"`5XA1{C0=0 B?p_z^gZhz\Cqگ-F^7bA x g1=6R|C]r!>np6L6 }!` 4׋\l;c9Qn>aЉ0֝Y>;&61ͿPK_FSŗ>$GZ{6yO.gi)\(6|ԜupoL >@AZXpRyKI}ޝFhDc8Һ?:onh>n^#GwP/aMV׵CV:u Y";pW1%!ħ5[&77iM[ܩ8n!aѥJT 肬|ĐEʮ^׀UȨ{3R endstream endobj 19 0 obj <>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000001937 00000 n 0000011765 00000 n 0000001878 00000 n 0000001726 00000 n 0000000015 00000 n 0000001706 00000 n 0000002002 00000 n 0000002125 00000 n 0000003097 00000 n 0000002380 00000 n 0000004895 00000 n 0000002783 00000 n 0000007890 00000 n 0000002043 00000 n 0000002073 00000 n 0000003333 00000 n 0000005203 00000 n 0000008152 00000 n 0000010404 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<826AC04CA3F96390DE3A0845DCD8C470><826AC04CA3F96390DE3A0845DCD8C470>] >> startxref 11883 %%EOF rrcov/vignettes/Structure.pdf0000644000176200001440000001141612763517421016123 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xRN0W8N&7ġ m%DT}֎ؽDdv3-p+mw +-HF` _)KC{ݭ>4d 6; A#?lz^72vT2,J'CihFs vXVs"9 ma6f̷o?_/E%^o o@g.< }x^`MNdB%y!M)fHk/TxSg|3DMu;_mspyY"/ɡ:edYUpCQ3"Q6g|ŤN1_&X~P;g)'(H* oendstream endobj 6 0 obj 365 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 10 0 obj <> endobj 11 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 12 0 obj <>stream xSPTU~o} b<5݋%""d(DHf]^-f(z D ?Y1d?&2j&rO؉:a`aqM2VMLW]ԴǗ_gkȀ!è׎!?1Dn!C('4X3ijg)( =tk;ql ]6oO\R , p?ma_yދn~uB9_]_5G{K53đ 'ɈOsEsQtd[5B1t6ۢgxz8rr@QUY >$i$HF+Lj>V/>7ncdž(\ gU @K'*:9n,lx~~kUscokg"5oh7&4o!?O>0>s"7?/B'mSyy 2([ Oy@>=|m> u$JLԺđ l @ endstream endobj 13 0 obj <>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000000679 00000 n 0000004327 00000 n 0000000620 00000 n 0000000469 00000 n 0000000015 00000 n 0000000450 00000 n 0000000744 00000 n 0000000845 00000 n 0000001135 00000 n 0000000785 00000 n 0000000815 00000 n 0000001376 00000 n 0000002966 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4445 %%EOF rrcov/vignettes/DAModel.pdf0000644000176200001440000003005212763517421015365 0ustar liggesusers%PDF-1.4 %쏢 5 0 obj <> stream xYv7N2>9i\DnC6E.$Bfǝ߫7{/նw2^u*n^Vk RQz}Y/uo8:<.6]ѽܖl2]~o twv֚n5ŋ7˗,~^\(-J2NtFzж c7ay$J^&v_޽x!Qe~xa;?ħvZvi ڇ~'̫L56%Y=Y_CvχnOڭW~j8jpXӉ7m>7t=<{fyXvM;w,`(>4!XK K0բQ'C|'G a!Ӑ%onnԱl팕6# EJR$Rjz (鉡RH4Tch T# WB\$Q7IzYo8ibtN0]R^qGbI Z8(,ǐ /@|+=l3JĠLn1ې#n̞ >Xڙ<2QfLzϚ)7K BYtiUL69`u5\ke8F5ܮw yu#-Uբ(59vLp": ℟L0p8&HaF<*/a\ JE۹[a-kH8)F{!a<]jd4• lRgJ!K7xMԎ `S1$iN)EtRȃۺ%p3p:N͑VzX'IbHqP-Cp8 IךZ(|>X)A!Q^mZuK0Fl1E),ڪ^z*#X*kٖ v6m0UDmpc z$! B$#AiCL@ǤI( j2SLh9&7sejJ7d.bԩiC|^r#fO9(Sq]̓C=a}jɳ?(=E߫&- F)=iN5:C[lj\&:J_}pb<߻3|F8SfT<}o.,6('k7u`R-^֛0ELJTGr5 ^(J=I!u,(s>ϩBoQb?8\4tvd%Iv8tn䒲]1RV[-ĎegU*9*aMJ18M q\=)2C-CjJ28JM" SMUŘWeB2H yJC8_AOy}vTx$5|pb%=5^<l6=7 `^7vt.PJ\A&C8٠p\ .Oh; k[XĖyVxr , rvg@vN^?AlCfB^F"?;b#6772Z)Y!o31z!iO -&,Qi?|C vSO%,$c U1!,M,Ҋ9DREA,E!R &z.$buq^D!$]-endstream endobj 6 0 obj 2025 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 14 0 obj <> endobj 15 0 obj <> endobj 8 0 obj <> endobj 10 0 obj <> endobj 12 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <>stream xS}Pem3Dԣ{H #ALDQ=Xٻ=v+>DKtm25-Lˏa(-5:=DhAnZIx`@l8ZF-ʚ*>%.r10V#O өNΡJW¸=hjlo'K,'0N# G99aⶳMjIk>W^5}>]헺Le{N _4ʚkm5Bh}_Nv$=,*j[OJ C 6?8T endstream endobj 11 0 obj <> endobj 17 0 obj <>stream xUU TGfAP&#( "|/(("*?a'1~htŰ DQ FYJ(ѐ#Y̾Ը5lNN9uUu()iˑiFa|5(9q̡r2ę$J@ˣ6zgg$%g#W9̙glCd> Y)I*Lb&g(T) 9YxUL! OHI("_qu&̤씈ܭiyJټ5B(ʍ |);*ZAQ ʟrVRT$HPQ*j5DyQT0ESf5N) @Ps hV0M/2m7=[e50 v5{hΚ[!7Q(|T)NGa=cU}i~*_)3/Љ_}uļdd1*(?-cwBHձcP0j:@͇?LVwz~ 7dCWhdEqBXm`L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oHv] ?hÕ"yYŠ8&!J$iaQǚ ubƭC~]͆:܂WںGx$qx_oyE5]䵋'_:4@nѓ':s 9C/uT 4_pᓿ"#8d0ݾNz2$g>֧/}{[]3_{z*gJYEQSGc K2a  7 wqTlAƬ _7X "5ڒ7Ger =G x_%Ƨ[:$X >;e3~)#caۮ\E2 V`mJV۱'#,E\BqH2u=<ծJ}=^ћdx |mV}!UꡌX*ܹʣ|O0!zw$BؽGM<1hW,` ^VJڽp7[}B߼+\^"} "ث6+haĭo!b]' r#] C' ^ 1;tÏ̞ɇG8yi)(4osx^>|V>lf\Kt2EB?uI qdBNE~|[!mT6)AzN!ci]xmwnՇ+`z𖊚 \_j]jcx{;;9Hok΅iT͹gpRr2dTn{􇚽 7a>n^kL!N=iWSm{?_Vh}iD};%QZ]M!"芶UPP$NRlpv9ΎM&1Dsn>I$W4qk'\k&&Ol\P}CEFv㎨N\ÒBx3Dۺ?M9O p ՑK&VCf`xДyY يOCⴄ Xü>?oQG"s%΁hR_ǹСYgI,9D2Hmن{sسꭷW+*#O|MN.ѾX\-=$h s)Eo8[1UT-*aOhrf |"[ݗv:\l }'+u3?!i;lc{A:"'ŖEݺpAyawaaTW¨a ? endstream endobj 19 0 obj <>stream UnknownApplication Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000002341 00000 n 0000011658 00000 n 0000002282 00000 n 0000002130 00000 n 0000000015 00000 n 0000002110 00000 n 0000002406 00000 n 0000002529 00000 n 0000003495 00000 n 0000002794 00000 n 0000005340 00000 n 0000003189 00000 n 0000008024 00000 n 0000002447 00000 n 0000002477 00000 n 0000003733 00000 n 0000005643 00000 n 0000008278 00000 n 0000010297 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<5F375D9D567AAD1A41382AB0E466AC53><5F375D9D567AAD1A41382AB0E466AC53>] >> startxref 11776 %%EOF rrcov/R/0000755000176200001440000000000013607356435011622 5ustar liggesusersrrcov/R/CovOgk.R0000644000176200001440000001213112763517421013127 0ustar liggesusersCovOgk <- function(x, niter = 2, beta = 0.9, control) { metodo2 <- function(XX) { n <- nrow(XX) p <- ncol(XX) sigma <- apply(XX, 2, mrob)[2,] Y <- XX %*% diag(1/sigma) U <- matrix(1, p, p) for(i in 1:p) for(j in i:p) { U[j, i] <- U[i, j] <- vrob(Y[,i], Y[,j]) } diag(U) <- 1 E <- eigen(U)$vectors A <- diag(sigma) %*% E Z <- Y %*% E restau <- apply(Z, 2, mrob) sigma <- as.vector(restau[2,]) cov <- A %*% diag(sigma^2) %*% t(A) loc <- A %*% restau[1,] list(cov = cov, center = loc, AA = A, ZZ = Z) } ## Analize and validate the input parameters ... ## If a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. ## The functions 'mrob()' and 'vrob()' can be supplied only via the control ## object. If no control object is passed these function will be taken ## from the default one defcontrol <- CovControlOgk() # default control mrob <- defcontrol@mrob vrob <- defcontrol@vrob smrob <- defcontrol@smrob svrob <- defcontrol@svrob if(!missing(control)){ # a control object was supplied if(niter == defcontrol@niter) niter <- control@niter if(beta == defcontrol@beta) beta <- control@beta mrob <- control@mrob vrob <- control@vrob smrob <- control@smrob svrob <- control@svrob } if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] if(p < 2) stop("Need at least 2 columns ") if(n <= 0) stop("All observations have missing values!") call <- match.call() ## If the user has supplied own mrob and vrob use the pure R version ## with this functions. Otherwise call the C implementation if(!is.null(mrob)){ ## iterate two times to obtain OGK2 first <- metodo2(x) cov <- first$cov center <- as.vector(first$center) ZZ <- first$ZZ if(niter >= 2){ second <- metodo2(first$ZZ) cov <- first$AA %*% second$cov %*% t(first$AA) center <- as.vector(first$AA %*% as.vector(second$center)) ZZ <- second$ZZ } dimnames(cov) <- list(dimn[[2]], dimn[[2]]) names(center) <- dimn[[2]] ## compute distances and weights ## do not invert cov to compute the distances, use the transformed data ## ## dist2 <- mahalanobis(X, center, cov) ## musigma <- apply(ZZ,2,mrob) ZZ <- sweep(ZZ, 2, musigma[1,]) ZZ <- sweep(ZZ, 2, musigma[2,], '/') dist2 <- rowSums(ZZ^2) cdelta <- median(dist2)/qchisq(0.5, p) cov <- cdelta * cov quantiel <- qchisq(beta, p) qq <- (quantiel * median(dist2))/qchisq(0.5, p) wt <- ifelse(dist2 < qq, 1, 0) sum.wt <- sum(wt) } else { if(!(smrob %in% c("scaleTau2", "s_mad"))) stop(paste("Scale function not defined: ", smrob)) if(!(svrob %in% c("gk", "qc"))) stop(paste("Bivariate covariance function not defined: ", svrob)) storage.mode(x) <- "double" opw <- .Call("covOPW", x, as.integer(niter), smrob, svrob) dimnames(opw$cov) <- list(dimn[[2]], dimn[[2]]) names(opw$center) <- dimn[[2]] dist2 <- opw$distances cdelta <- median(dist2)/qchisq(0.5, p) cov <- opw$cov <- cdelta * opw$cov center <- opw$center quantiel <- qchisq(beta, p) qq <- (quantiel * median(dist2))/qchisq(0.5, p) wt <- ifelse(dist2 < qq, 1, 0) sum.wt <- sum(wt) } ## compute the reweighted estimates: OGK2(0.9) wcenter <- colSums(x*wt)/sum.wt X <- sqrt(wt) * sweep(x, 2, wcenter) wcov <- (t(X) %*% X)/sum.wt ## Compute consistency correction factor for the reweighted cov qdelta.rew <- qchisq(sum(wt)/n, p) cdeltainvers.rew <- pgamma(qdelta.rew/2, p/2 + 1)/(sum(wt)/n) cnp2 <- 1/cdeltainvers.rew ## wcov <- cnp2 * wcov method="Orthogonalized Gnanadesikan-Kettenring Estimator" ans <- new("CovOgk", call = call, iter=niter, crit=1, cov=wcov, center=wcenter, n.obs=n, raw.cov=cov, raw.center=center, raw.mah = dist2, raw.wt = wt, X = x, method=method) ans } rrcov/R/AllGenerics.R0000644000176200001440000000622512763517421014136 0ustar liggesuserssetGeneric("plot") setGeneric("summary") setGeneric("psi", function(obj, x) standardGeneric("psi")) setGeneric("wt", function(obj, x) standardGeneric("wt")) setGeneric("vt", function(obj, x) standardGeneric("vt")) setGeneric("erho", function(obj) standardGeneric("erho")) setGeneric("erhoLim", function(obj) standardGeneric("erhoLim")) setGeneric("erhoLimD", function(obj) standardGeneric("erhoLimD")) setGeneric("arpLim", function(obj) standardGeneric("arpLim")) setGeneric("csolve", function(obj) standardGeneric("csolve")) setGeneric("iterM", function(obj, x, t1, s, eps, maxiter) standardGeneric("iterM")) setGeneric("isClassic", function(obj) standardGeneric("isClassic")) setGeneric("isSingular", function(obj) standardGeneric("isSingular")) setGeneric("getMeth", function(obj) standardGeneric("getMeth")) if(!isGeneric("getCenter")) setGeneric("getCenter", function(obj) standardGeneric("getCenter")) if(!isGeneric("getScale")) setGeneric("getScale", function(obj) standardGeneric("getScale")) setGeneric("getCov", function(obj) standardGeneric("getCov")) setGeneric("getCorr", function(obj) standardGeneric("getCorr")) setGeneric("getData", function(obj) standardGeneric("getData")) setGeneric("getDistance", function(obj) standardGeneric("getDistance")) setGeneric("getEvals", function(obj) standardGeneric("getEvals")) setGeneric("getDet", function(obj) standardGeneric("getDet")) setGeneric("getShape", function(obj) standardGeneric("getShape")) setGeneric("getFlag", function(obj, prob=0.975) standardGeneric("getFlag")) setGeneric("getRaw", function(obj) standardGeneric("getRaw")) setGeneric("restimate", function(obj, x, ...) standardGeneric("restimate")) if(!isGeneric("predict")) setGeneric("predict", function(object, ...) standardGeneric("predict")) if(!isGeneric("screeplot")) setGeneric("screeplot", function(x, ...) standardGeneric("screeplot")) if(!isGeneric("biplot")) setGeneric("biplot", function(x, ...) standardGeneric("biplot")) if(!isGeneric("scorePlot")) setGeneric("scorePlot", function(x, ...) standardGeneric("scorePlot")) if(!isGeneric("getQuan")) setGeneric("getQuan", function(obj) standardGeneric("getQuan")) # returns the number of observations used # in the computation of the PCA (n for classic) if(!isGeneric("getLoadings")) setGeneric("getLoadings", function(obj) standardGeneric("getLoadings")) if(!isGeneric("getEigenvalues")) setGeneric("getEigenvalues", function(obj) standardGeneric("getEigenvalues")) if(!isGeneric("getSdev")) setGeneric("getSdev", function(obj) standardGeneric("getSdev")) if(!isGeneric("getScores")) setGeneric("getScores", function(obj) standardGeneric("getScores")) if(!isGeneric("getPrcomp")) setGeneric("getPrcomp", function(obj) standardGeneric("getPrcomp")) # return a prcomp() compatible object to use the # available standard plots (i.e. a list with # with sdev, scale, scores, rotation) rrcov/R/CovMrcd.R0000644000176200001440000000464313575230611013300 0ustar liggesusersCovMrcd <- function(x, alpha=control@alpha, h=control@h, maxcsteps=control@maxcsteps, initHsets=NULL, save.hsets=FALSE, rho=control@rho, target=control@target, maxcond=control@maxcond, trace=control@trace, control=CovControlMrcd()) { if(is.data.frame(x)) x <- data.matrix(x, rownames.force=FALSE) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : ok <- is.finite(x %*% rep.int(1, ncol(x))) x <- x[ok, , drop = FALSE] if(!length(dx <- dim(x))) stop("All observations have missing values!") n <- dx[1]; p <- dx[2] dimn <- dimnames(x) mcd <- .detmrcd (x, alpha=alpha, h=h, hsets.init = initHsets, save.hsets=save.hsets, # full.h=full.h, rho=rho, target=if(target=="identity") 0 else 1, maxcsteps=maxcsteps, trace=as.integer(trace)) alpha <- mcd$alpha h <- mcd$h ans <- list(call = match.call(), method = sprintf("MRCD(alpha=%g ==> h=%d)", alpha, h)) ans$method <- paste("Minimum Regularized Covariance Determinant", ans$method) ans$cov <- mcd$initcovariance ans$center <- as.vector(mcd$initmean) ans$n.obs <- n ans$best <- sort(as.vector(mcd$best)) ans$alpha <- alpha ans$quan <- h ans$crit <- mcd$mcdestimate ans$mah <- mahalanobis(x, mcd$initmean, mcd$icov, inverted=TRUE) if(length(dimn[[1]])) dimnames(x)[[1]] <- dimn[[1]][ok] else dimnames(x) <- list(seq(along = ok)[ok], NULL) ans$X <- x if(trace) cat(ans$method, "\n") ans <- c(ans, mcd[c("calpha", "iBest","n.csteps", if(save.hsets) "initHsets", "icov","rho", "target")]) class(ans) <- "mcd" if(!is.null(nms <- dimn[[2]])) { dimnames(ans$cov) <- list(nms, nms) dimnames(ans$icov) <- list(nms, nms) names(ans$center) <- nms } new("CovMrcd", call= ans$call, crit=ans$crit, cov=ans$cov, icov=ans$icov, rho=ans$rho, target=ans$target, center=ans$center, n.obs=ans$n.obs, mah = ans$mah, X = ans$X, method=ans$method, best=ans$best, alpha=ans$alpha, quan=ans$quan, cnp2 = ans$calpha) } rrcov/R/PcaClassic.R0000644000176200001440000001145412763517421013753 0ustar liggesusers##setGeneric("PcaClassic", function(x, ...) standardGeneric("PcaClassic")) ##setMethod("PcaClassic", "formula", PcaClassic.formula) ##setMethod("PcaClassic", "ANY", PcaClassic.default) setMethod("getQuan", "PcaClassic", function(obj) obj@n.obs) ## The S3 version PcaClassic <- function (x, ...) UseMethod("PcaClassic") PcaClassic.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a `standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaClassic.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaClassic") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaClassic.default <- function(x, k=ncol(x), kmax=ncol(x), scale=FALSE, signflip=TRUE, crit.pca.distances=0.975, trace=FALSE, ...) { cl <- match.call() if(missing(x)){ stop("You have to provide at least some data") } data <- as.matrix(x) n <- nrow(data) p <- ncol(data) Xsvd <- .classPC(data, scale=scale, signflip=signflip, scores=TRUE) if(Xsvd$rank == 0) { stop("All data points collapse!") } if(is.logical(scale) && !scale) # no scaling, the defult Xsvd$scale <- vector('numeric', p) + 1 if(trace) { cat("\nDimension of the input matrix x:\n", dim(x)) cat("\nInput parameters [k, kmax, rank(x)]: ", k, kmax, Xsvd$rank, "\n") } ## ## verify and set the input parameters: k and kmax ## kmax <- max(min(kmax, Xsvd$rank),1) if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } if(k != 0) k <- min(k, ncol(data)) else { ## k <- min(kmax, ncol(data)) ## if(trace) ## cat("The number of principal components is set to ", k, ".\n", sep="") ## Find the number of PC 'k' ## Use the test l_k/l_1 >= 10.E-3, i.e. the ratio of ## the k-th eigenvalue to the first eigenvalue (sorted decreasingly) is larger than ## 10.E/3 and the fraction of the cumulative dispersion is larger or equal 80% ## test <- which(Xsvd$eigenvalues/Xsvd$eigenvalues[1] <= 1.E-3) k <- if(length(test) != 0) min(min(Xsvd$rank, test[1]), kmax) else min(Xsvd$rank, kmax) cumulative <- cumsum(Xsvd$eigenvalues[1:k])/sum(Xsvd$eigenvalues) if(cumulative[k] > 0.8) { k <- which(cumulative >= 0.8)[1] } if(trace) cat("\n k, kmax, rank, p: ", k, kmax, Xsvd$rank, ncol(data), "\n") if(trace) cat("The number of principal components is defined by the algorithm. It is set to ", k,".\n", sep="") } if(trace) cat("\nTo be used [k, kmax, ncol(data), rank(data)]=",k, kmax, ncol(data), Xsvd$rank, "\n") loadings <- Xsvd$loadings[, 1:k, drop=FALSE] eigenvalues <- as.vector(Xsvd$eigenvalues[1:k]) center <- as.vector(Xsvd$center) scores <- Xsvd$scores[, 1:k, drop=FALSE] scale <- Xsvd$scale if(is.list(dimnames(data)) && !is.null(dimnames(data)[[1]])) { dimnames(scores)[[1]] <- dimnames(data)[[1]] } else { dimnames(scores)[[1]] <- 1:n } dimnames(scores)[[2]] <- as.list(paste("PC", seq_len(ncol(scores)), sep = "")) dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) ## fix up call to refer to the generic, but leave arg name as 'formula' cl[[1]] <- as.name("PcaClassic") res <- new("PcaClassic", call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=scale, scores=scores, k=k, n.obs=n) ## Compute distances and flags res <- pca.distances(res, data, Xsvd$rank, crit.pca.distances) return(res) } rrcov/R/utils.R0000644000176200001440000000404313567542036013105 0ustar liggesusers## Moore-Penrose pseudoinverse .pinv <- function(X, tol=.Machine$double.eps) { X <- as.matrix(X) xsvd <- svd(X) nze <- sum( xsvd$d > (tol*xsvd$d[1]) ) return (if(nze > 1L) xsvd$v[,1:nze] %*% diag(1/xsvd$d[1:nze]) %*% t(xsvd$u[,1:nze]) else outer(xsvd$v[,1],xsvd$u[,1]) / xsvd$d[1] ) } .isSingular <- function(mat) { ## return( - (determinant(mat, logarithm = TRUE)$modulus[1] - 0)/ncol(mat) > 50) p <- ncol(mat) if(!is.qr(mat)) mat <- qr(mat) return(mat$rank < p) } .check_vars_numeric <- function(mf) { ## we need to test just the columns which are actually used. mt <- attr(mf, "terms") mterms <- attr(mt, "factors") mterms <- rownames(mterms)[apply(mterms, 1, any)] any(sapply(mterms, function(x) is.factor(mf[,x]) || !is.numeric(mf[,x]))) } vecnorm <- function(x, p=2) sum(x^p)^(1/p) ## ## Several Matlab-like utility functions ====================================================== ## ## ## Return the square root of a symetric positive definite matrix sqrtm <- function(A){ ## ## [E D] = eig(A); sqrtm(A) = E * sqrt(D) * E' ## if(!is.matrix(A) || ncol(A) != nrow(A)) stop("The matrix A must be a square matrix\n") ee <- eigen(A) if(any(ee$values < 0)) { stop("The matrix A must be positive definite.") } ee$vectors %*% diag(sqrt(ee$values)) %*% t(ee$vectors) } ## Return an n by p matrix of ones ##ones <- function(n=1, p=1){ ## matrix(1, nrow=n, ncol=p) ##} ## Return an n by p matrix of zeros ##zeros <- function(n=1, p=1){ ## matrix(0, nrow=n, ncol=p) ##} ## ## a=[1 2 ; 3 4]; ## repmat(a,2,3) ## ## ## a <- matrix(1:4,2,byrow=T) ## repmat(a,2,3) ## ## ## a <- 1:4; n=10 ## matrix(rep(a, times=n), nrow=n, byrow=TRUE) ## ##repmat <- function(A, n, p) { ## ## if(is.vector(A)) # we need a column matrix, not a vector, speaking in R terms ## A <- t(A) ## kronecker(matrix(1,n,p), A) ##} rrcov/R/zzz.R0000644000176200001440000000057312763517421012603 0ustar liggesusers.onAttach <- function(lib, pkg) { where <- match(paste("package:", pkg, sep = ""), search()) ver <- read.dcf(file.path(lib, pkg, "DESCRIPTION"), "Version") ver <- as.character(ver) title <- read.dcf(file.path(lib, pkg, "DESCRIPTION"), "Title") title <- as.character(title) packageStartupMessage(paste(title, " (version ", ver, ")\n", sep = "")) } rrcov/R/donostah.R0000644000176200001440000001341312763517421013562 0ustar liggesusersdonostah <- function(x, control) { if(missing(control)) control <- covRob.control(estim="donostah") n <- nrow(x) p <- ncol(x) center <- control$center nresamp <- control$nresamp maxres <- control$maxres prob <- control$prob eps <- control$eps if(!control$random.sample) { if(exists(".Random.seed", where = 1)) { random.seed <- get(".Random.seed", pos = 1) on.exit(assign(".Random.seed", random.seed, pos = 1)) } set.seed(21) } if(casefold(nresamp) == "auto") nresamp <- ceiling(log(1 - control$prob)/log(1 - (1 - control$eps)^(p+1))) else if(!is.integer(nresamp)) stop("nresamp must be a nonnegative integer or ", dQuote("auto")) if(nresamp != 0) nresamp <- max(1000, nresamp) if(casefold(maxres) == "auto") maxres <- 2 * nresamp else if(!is.integer(maxres)) stop(sQuote("maxres"), " is not a positive integer") tune <- sqrt(qchisq(control$tune, p)) icent <- 1 locat <- double(p) covmat <- matrix(0.0, p, p) storage.mode(covmat) <- "double" wk <- double(4*n+p) iwork <- integer(4*n+p) nresper <- 0 w <- double(n) z <- double(n) if(length(center) == 1 && !center) center <- rep(0, p) if(length(center) > 1) { if(length(center) != p) stop("the dimension of ", sQuote("center"), " does not match the ", "dimension of ", sQuote("x")) x <- sweep(x, 2, center) icent <- 0 } sdlist <- .Fortran("rlds", n = as.integer(n), p = as.integer(p), nresamp = as.integer(nresamp), x = as.double(x), tune = as.double(tune), wk = as.double(wk), center = as.double(locat), cov = covmat, maxres = as.integer(maxres), nresper = as.integer(nresper), weights = as.double(w), outlyingness = as.double(z), icent = as.integer(icent), iwork = as.integer(iwork), PACKAGE = "rrcov") dist <- mahalanobis(x, center = if(length(center) > 1) rep(0, p) else sdlist$center, cov = sdlist$cov) consistency.correction <- median(dist) / qchisq(.5, p) sdlist$cov <- sdlist$cov * consistency.correction sdlist$dist <- dist / consistency.correction if(length(center) > 1) sdlist$center <- center sdlist[c("cov", "center", "dist")] } covRob.control <- function(estim, ...) { estim <- casefold(estim) control <- list(...) control$estim <- estim if(estim == "donostah") { if(is.null(control$nresamp)) control$nresamp <- "auto" if(is.null(control$maxres)) control$maxres <- "auto" if(is.null(control$random.sample)) control$random.sample <- FALSE if(is.null(control$center)) control$center <- TRUE if(is.null(control$tune)) control$tune <- 0.95 if(is.null(control$prob)) control$prob <- 0.99 if(is.null(control$eps)) control$eps <- 0.5 control <- control[c("estim", "nresamp", "maxres", "random.sample", "center", "tune", "prob", "eps")] } else if(estim == "mcd" || estim == "weighted") { ## For backwards compatibility we support the use of quan and ntrial ## ## to specify alpha and nsamp for estim = "mcd", estim = "weighted" ## ## and estim = "M". Providing both quan and alpha or both ntrial and ## ## nsamp will result in an error. ## if(is.null(control$alpha)) control$alpha <- ifelse(is.null(control$quan), 0.5, control$quan) if(is.null(control$nsamp)) control$nsamp <- ifelse(is.null(control$ntrial), 500, control$ntrial) if(is.null(control$trace)) control$trace <- FALSE if(is.null(control$use.correction)) control$use.correction <- TRUE if(is.null(control$tolSolve)) control$tolSolve <- 1e-14 if(is.null(control$seed)) control <- control[c("estim", "alpha", "nsamp", "trace", "use.correction", "tolSolve")] else control <- control[c("estim", "alpha", "nsamp", "seed", "trace", "use.correction", "tolSolve")] } else if(estim == "m") { if(is.null(control$alpha)) control$alpha <- ifelse(is.null(control$quan), 0.5, control$quan) if(is.null(control$nsamp)) control$nsamp <- ifelse(is.null(control$ntrial), 500, control$ntrial) if(is.null(control$trace)) control$trace <- FALSE if(is.null(control$use.correction)) control$use.correction <- TRUE if(is.null(control$tolSolve)) control$tolSolve <- 1e-14 if(is.null(control$seed)) init.control <- control[c("estim", "alpha", "nsamp", "trace", "use.correction", "tolSolve")] else init.control <- control[c("estim", "alpha", "nsamp", "seed", "trace", "use.correction", "tolSolve")] init.control$estim = "mcd" control$init.control <- init.control if(is.null(control$r)) control$r <- 0.45 if(is.null(control$arp)) control$arp <- 0.05 if(is.null(control$eps)) control$eps <- 1e-03 if(is.null(control$maxiter)) control$maxiter <- 120 control <- control[c("estim", "r", "arp", "eps", "maxiter", "init.control")] } else control <- control["estim"] control } rrcov/R/PcaLocantore.R0000644000176200001440000001516212763517421014320 0ustar liggesuserssetClass("PcaLocantore", representation(delta = "numeric", quan = "numeric"), contains="PcaRobust") setMethod("getQuan", "PcaLocantore", function(obj) obj@n.obs) ## The S3 version PcaLocantore <- function (x, ...) UseMethod("PcaLocantore") PcaLocantore.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a `standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaLocantore.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaLocantore") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaLocantore.default <- function(x, k=ncol(x), kmax=ncol(x), delta = 0.001, na.action = na.fail, scale=FALSE, signflip=TRUE, crit.pca.distances=0.975, trace=FALSE, ...) { cl <- match.call() if(missing(x)){ stop("You have to provide at least some data") } y <- data <- x <- as.matrix(x) n <- nrow(y) p <- ncol(y) ## ## verify and set the input parameters: k and kmax ## kmax <- max(min(floor(kmax), rankMM(x)),1) if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } if(k != 0) k <- min(k, ncol(data)) ###################################################################### ## VT::4.08.2016 ## if scale = TRUE, scale with mad, otherwise scale can be a vector ## of length p, or a function ## use the undocumented function doScale() from robustbase ## if(is.logical(scale)) scale <- if(scale) mad else NULL if(!is.null(scale)) { x.scaled <- doScale(x, center=NULL, scale=scale) sc <- x.scaled$scale data <- x.scaled$x }else { sc <- vector('numeric', p) + 1 data <- x } ## if(is.logical(scale)) ## { ## if(scale) ## { ## sc <- apply(x, 2L, sd) ## data <- sweep(data, 2L, sc, "/", check.margin=FALSE) ## } ## } ## else if(is.numeric(scale) && length(scale) == p) ## { ## data <- sweep(data, 2L, scale, "/", check.margin = FALSE) ## sc <- scale ## } ## else stop("length of 'scale' must equal the number of columns of 'x'") ## attr(data, "scaled:scale") <- sc ## Center with the spatial median and project on the sphere spa = spatial.median(data, delta) mu = spa$mu ep = spa$ep tt = matrix(mu, n, p, byrow=TRUE) data = data-tt for(i in 1:n) { z = sqrt(sum((data[i, ])^2)) y[i, ] = 0 * data[i, ] if(z > ep) { y[i, ] = (data[i, ] )/z } } ## no scaling - we have already scaled with MAD out = PcaClassic(y, k=k, kmax=kmax, scale=FALSE, signflip=signflip, ...) k <- out@k scores = y %*% out@loadings # these are (slightly) diferent from the scores returned by PcaClassic # because PcaClassic will center by the mean the already centered data # use these scores to compute the standard deviations (mad) sdev = apply(scores, 2, "mad") names2 = names(sdev) orsdev = order(sdev) # sort the sdevs (although almost always they will be sorted) orsdev = rev(orsdev) # use them to sort the laodings, etc. sdev = sdev[orsdev] scores = scores[,orsdev, drop=FALSE] loadings = out@loadings[,orsdev, drop=FALSE] names(sdev)=names2 dimnames(scores)[[2]]=names2 dimnames(loadings)[[2]]=names2 ## scale is a vector of 1s with length p (if FALSE), a vector with column mad (if TRUE) or ## any other vector with length p (posibly computed by doScale()) scale <- sc center <- doScale(t(as.vector(mu)), center=NULL, scale=1/scale)$x # rescale back to the original data scores <- doScale(x, center, scale)$x %*% loadings # compute the scores scores <- scores[, 1:k, drop=FALSE] # select only fist k loadings <- loadings[, 1:k, drop=FALSE] eigenvalues <- (sdev^2)[1:k] ###################################################################### names(eigenvalues) <- NULL if(is.list(dimnames(data))) { ##dimnames(scores)[[1]] <- dimnames(data)[[1]] rownames(scores) <- rownames(data) } dimnames(scores)[[2]] <- as.list(paste("PC", seq_len(ncol(scores)), sep = "")) dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) ## fix up call to refer to the generic, but leave arg name as cl[[1]] <- as.name("PcaLocantore") res <- new("PcaLocantore", call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=scale, scores=scores, k=k, n.obs=n) ## Compute distances and flags res <- pca.distances(res, x, p, crit.pca.distances) return(res) } ## computes the spatial median spatial.median <- function(x, delta) { dime = dim(x) n=dime[1] p=dime[2] delta1=delta*sqrt(p) mu0=apply(x,2,median) h=delta1+1 tt=0 while(h>delta1) { tt=tt+1 TT=matrix(mu0,n,p,byrow=TRUE) U=(x-TT)^2 w=sqrt(apply(U,1,sum)) w0=median(w) ep=delta*w0 z=(w<=ep) w[z]=ep w[!z]=1/w[!z] w=w/sum(w) x1=x for(i in 1:n) x1[i,]=w[i]*x[i,] mu=apply(x1,2,sum) h=sqrt(sum((mu-mu0)^2)) mu0=mu } out=list(mu=mu0,ep=ep) out } rrcov/R/AllClasses.R0000644000176200001440000004206313573762726014006 0ustar liggesuserssetClass("PsiFun", representation(n = "numeric", p = "numeric", r = "numeric", alpha = "numeric", c1 = "numeric")) setClass("PsiBwt", representation(M = "numeric"), contains="PsiFun") ## Define class unions for optional slots, e.g. for definition ## of slots which will be computed on demand, like the ## mahalanobis/robust distances setClassUnion("Uvector", c("vector", "NULL")) setClassUnion("Unumeric", c("numeric", "NULL")) setClassUnion("Cnumeric", c("numeric", "character")) setClassUnion("Umatrix", c("matrix", "NULL")) setClassUnion("Ulist", c("list", "NULL")) setClassUnion("Ufunction", c("function", "character", "NULL")) setClassUnion("Utable", c("table", "NULL")) ## This is a virtual base class for control objects. Each robust ## method like CovMest, CovOgk, etc. will derive a subclass with ## the necessary control parameters, e.g. CovControlMest will ## contain the control parameters for CovMest. setClass("CovControl", representation(trace="logical", tolSolve="numeric", "VIRTUAL")) setClassUnion("UCovControl", c("CovControl", "NULL")) setClass("Cov", representation(call = "language", cov = "matrix", center = "vector", det = "numeric", n.obs = "numeric", mah = "Uvector", flag = "Uvector", method = "character", singularity = "Ulist", X = "Umatrix", "VIRTUAL"), prototype=list(det=-1)) setClassUnion("UCov", c("Cov", "NULL")) setClass("SummaryCov", representation(covobj = "Cov", evals = "vector")) setClass("CovClassic", contains="Cov") setClass("CovRobust", representation(iter="numeric", crit="numeric", wt="Uvector", "VIRTUAL"), contains="Cov") setClass("SummaryCovRobust", representation(), contains="SummaryCov") setClass("CovMest", representation(vt="vector"), contains="CovRobust") setClass("CovMcd", representation(alpha = "numeric", quan = "numeric", best = "Uvector", raw.cov = "matrix", raw.center = "vector", raw.mah = "Uvector", raw.wt = "Uvector", raw.cnp2 = "numeric", cnp2 = "numeric"), contains="CovRobust") setClass("CovMrcd", representation(alpha = "numeric", quan = "numeric", best = "Uvector", cnp2 = "numeric", icov = "matrix", rho = "numeric", target="matrix"), contains="CovRobust") setClass("CovOgk", representation(raw.cov = "matrix", raw.center = "vector", raw.mah = "Uvector", raw.wt = "Uvector"), contains="CovRobust") setClass("CovMve", representation(alpha = "numeric", quan = "numeric", best = "Uvector", raw.cov = "matrix", raw.center = "vector", raw.mah = "Uvector", raw.wt = "Uvector", raw.cnp2 = "numeric", cnp2 = "numeric"), contains="CovRobust") setClass("CovSest", representation(iBest = "numeric", nsteps = "Uvector", initHsets = "Umatrix", cc = "numeric", kp = "numeric"), contains="CovRobust") setClass("CovSde", representation(), contains="CovRobust") setClass("CovMMest", representation(c1 ="numeric", sest = "CovSest"), contains="CovRobust") ## Control parameters for CovMcd setClass("CovControlMcd", representation(alpha="numeric", nsamp="Cnumeric", scalefn="Ufunction", maxcsteps="numeric", seed="Uvector", use.correction="logical"), prototype = list(alpha=0.5, nsamp=500, scalefn=NULL, maxcsteps=200, seed=NULL, trace=FALSE, tolSolve=1e-14, use.correction=TRUE), contains="CovControl") ## Control parameters for CovMrcd setClass("CovControlMrcd", representation(alpha="numeric", h="Unumeric", maxcsteps="numeric", rho="Unumeric", target = "character", maxcond = "numeric"), prototype = list(alpha=0.5, h=NULL, maxcsteps=200, rho=NULL, target="identity", maxcond=50, trace=FALSE, tolSolve=1e-14), contains="CovControl") ## Control parameters for CovMest setClass("CovControlMest", representation(r="numeric", arp="numeric", eps="numeric", maxiter="numeric"), prototype = list(r=0.45, arp=0.05, eps=1e-3, maxiter=120, trace=FALSE, tolSolve=1e-14), contains="CovControl" ) ## Control parameters for CovOgk ## ## Computes robust univariate mu and sigmma of the vector x ## - sigma: tau scale Yohai and Zamar (1988) - a truncated ## standard deviation ## - mu: weighted mean ## ## Returns a vector of length two with the calculated mu and sigma ## .mrobTau <- function(x, c1 = 4.5, c2 = 3.0, ...) #c2=2.36075 { return(scaleTau2(x, mu.too=TRUE)) # use scaleTau2 from package robustbase if(FALSE) { m0 <- median(x) # MED s0 <- median(abs(x - m0)) # MAD r <- abs(x-m0)/s0 wt <- (1 - (r/c1)^2)^2 wt <- ifelse(r <= c1, wt, 0) # wt = weigths w(x,c1) m <- sum(x*wt)/sum(wt) # mu = weighted mean r <- (x-m)/s0 r <- r^2 r[r > c2^2] <- c2^2 # rho(x,c2) s2 <- s0^2 / length(x) * sum(r) # sigma = tau scale (Yohai&Zamar 1988) # truncated standard deviation c(m, sqrt(s2)) } } ## ## Compute a robust estimate of the covariance of two random ## variables x1 and x2. ## Use the estimate defined by Gnanadesikan and Kettenring (1972): ## cov(X,Y)=1/4 * (sigma(X+Y)^2 - sigma(X-Y)^2) ## where sigma is a robust univariate scale. ## As sigma is used the tau scale estimate defined above - mrobTau() ## .vrobGK <- function(x1, x2, ...) { (.mrobTau(x1+x2, ...)[2]^2 - .mrobTau(x1-x2, ...)[2]^2)/4.0 } setClass("CovControlOgk", representation(niter="numeric", beta="numeric", mrob="Ufunction", # mrob=.mrobTau vrob="Ufunction", # vrob=.vrobGK smrob="character", svrob="character"), prototype = list(niter=2, beta=0.90, mrob=NULL, vrob=.vrobGK, smrob="scaleTau2", svrob="gk", trace=FALSE, tolSolve=1e-14), contains="CovControl" ) ## Control parameters for CovMve setClass("CovControlMve", representation(alpha="numeric", nsamp="numeric", seed="Uvector"), prototype = list(alpha=0.5, nsamp=500, seed=NULL, trace=FALSE, tolSolve=1e-14), contains="CovControl") ## Control parameters for CovSest setClass("CovControlSest", representation(bdp="numeric", arp="numeric", eps="numeric", maxiter="numeric", nsamp="numeric", seed="Uvector", method="character"), prototype = list(bdp=0.5, arp=0.1, eps=1e-5, maxiter=120, nsamp=500, seed=NULL, trace=FALSE, tolSolve=1e-14, method="sfast"), contains="CovControl") CovControlSest <- function (bdp=0.5, arp=0.1, eps=1e-5, maxiter=120, nsamp=500, seed=NULL, trace=FALSE, tolSolve=1e-14, method="sfast") { new("CovControlSest", bdp=bdp, arp=arp, eps=eps, maxiter=maxiter, nsamp=nsamp, seed=seed, trace=trace, tolSolve=tolSolve, method=method) } ## Control parameters for CovSde setClass("CovControlSde", representation(nsamp="numeric", maxres="numeric", tune="numeric", eps="numeric", prob="numeric", seed="Uvector"), prototype = list(tune=0.95, eps=0.5, prob=0.99, seed=NULL, trace=FALSE, tolSolve=1e-14), contains="CovControl") ## Control parameters for CovMMest setClass("CovControlMMest", representation(bdp="numeric", eff="numeric", maxiter="numeric", sest="CovControlSest"), prototype = list(bdp=0.5, eff=0.95, maxiter=50, sest=CovControlSest(), trace=FALSE, tolSolve=10e-14), contains="CovControl" ) ###################### PCA #################################### setClass("Pca", representation(call = "language", center = "vector", scale = "Uvector", loadings = "matrix", eigenvalues = "vector", scores = "matrix", k = "numeric", sd = "Uvector", od = "Uvector", cutoff.sd = "numeric", cutoff.od = "numeric", crit.pca.distances = "numeric", flag = "Uvector", n.obs = "numeric", "VIRTUAL")) setClass("SummaryPca", representation(pcaobj = "Pca", importance ="matrix")) setClass("PcaClassic", contains="Pca") setClass("PcaRobust", representation("VIRTUAL"), contains="Pca") setClass("PcaHubert", representation(alpha = "numeric", quan = "numeric"), contains="PcaRobust") setClass("PcaLocantore", representation(), contains="PcaRobust") setClass("PcaCov", representation(quan = "numeric"), contains="PcaRobust") setClass("PcaProj", representation(), contains="PcaRobust") setClass("PcaGrid", representation(), contains="PcaRobust") ###################### LDA #################################### setClass("Lda", representation(call = "language", prior = "vector", counts = "vector", center = "matrix", cov = "matrix", ldf = "matrix", ldfconst = "vector", method = "character", X = "Umatrix", grp = "factor", covobj = "UCov", control = "UCovControl", "VIRTUAL")) setClass("SummaryLda", representation(ldaobj = "Lda")) setClass("LdaClassic", contains="Lda") setClass("LdaRobust", representation("VIRTUAL"), contains="Lda") setClass("PredictLda", representation(classification = "factor", posterior = "matrix", x = "matrix", ct="Utable")) setClass("Linda", representation( l1med = "logical"), contains="LdaRobust") setClass("LdaPP", representation( raw.ldf = "matrix", raw.ldfconst = "vector"), contains="LdaRobust") ###################### QDA #################################### setClass("Qda", representation(call = "language", prior = "vector", counts = "vector", center = "matrix", cov = "array", covinv = "array", covdet = "vector", method = "character", X = "Umatrix", grp = "factor", control = "UCovControl", "VIRTUAL")) setClass("SummaryQda", representation(qdaobj = "Qda")) setClass("QdaClassic", contains="Qda") setClass("QdaRobust", representation("VIRTUAL"), contains="Qda") setClass("PredictQda", representation(classification = "factor", posterior = "matrix", x = "matrix", ct="Utable")) setClass("QdaCov", contains="QdaRobust") rrcov/R/QdaClassic.R0000644000176200001440000001046612763517421013757 0ustar liggesusers## The S3 version QdaClassic <- function (x, ...) UseMethod("QdaClassic") QdaClassic.formula <- function(formula, data, ..., subset, na.action) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- QdaClassic.default(x, grouping, ...) ## res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as formula cl <- match.call() cl[[1]] <- as.name("QdaClassic") res@call <- cl ## res$contrasts <- attr(x, "contrasts") ## res$xlevels <- .getXlevels(Terms, m) ## res$na.action <- attr(m, "na.action") res } QdaClassic.default <- function(x, grouping, prior = proportions, tol = 1.0e-4, ...) { if(is.null(dim(x))) stop("x is not a matrix") xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) if(length(grouping) == 1) { # this is the number of groups and the groups are of equal size ng = grouping ni = n/ng if(ng*ni < n) stop("nrow(x) is not divisible by the number of groups") grouping <- rep(0,0) for(i in 1:ng) grouping <- c(grouping, rep(i,ni)) }else if(length(grouping) > 1 && length(grouping) < n) { # grouping contains a vector with the group sizes ng <- length(grouping) if(sum(grouping) != n) stop("nrow(x) is not equal to n1+n2+...+nn") gx <- rep(0,0) for(i in 1:ng) gx <- c(gx, rep(i,grouping[i])) grouping <- gx } if(n != length(grouping)) stop("nrow(x) and length(grouping) are different") g <- as.factor(grouping) lev <- lev1 <- levels(g) counts <- as.vector(table(g)) if(!missing(prior)) { if(any(prior < 0) || round(sum(prior), 5) != 1) stop("invalid prior") if(length(prior) != nlevels(g)) stop("prior is of incorrect length") prior <- prior[counts > 0] } if(any(counts == 0)) { warning(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) lev1 <- lev[counts > 0] g <- factor(g, levels=lev1) counts <- as.vector(table(g)) } proportions <- counts/n ng <- length(proportions) names(g) <- NULL names(prior) <- levels(g) xcov <- .allcovClass(x, grouping) ## inv <- solve(xcov$wcov) ## ldf <- xcov$means %*% inv ## ldfconst <- diag(log(prior) - ldf %*% t(xcov$means)/2) return (new("QdaClassic", call=xcall, prior=prior, counts=counts, center=xcov$means, cov=xcov$cov, covinv=xcov$covinv, covdet=xcov$covdet, method="Quadratic Discriminant Analysis (QDA)", control=NULL, X=x, grp=g)) } .allcovClass <- function(x, grouping){ xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) dimn <- dimnames(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts/n) # compute group means and covariance matrices for each group mX <- matrix(0,ng,p) covX <- array(0,c(p,p,ng)) covInv <- array(0,c(p,p,ng)) covdet <- vector(mode="numeric", length=ng) for(i in 1:ng){ tmpc <- cov.wt(as.matrix(x[which(g == lev[i]),])) mX[i,] <- tmpc$center covX[,,i] <- tmpc$cov covInv[,,i] <- solve(tmpc$cov) covdet[i] <- det(tmpc$cov) } dimnames(mX) <- list(levels(g), dimn[[2]]) dimnames(covX) <- list(dimn[[2]], dimn[[2]], levels(g)) dimnames(covInv) <- list(dimn[[2]], dimn[[2]], levels(g)) names(covdet) <- levels(g) ans <- list(call=xcall, means=mX, cov=covX, covinv=covInv, covdet=covdet) class(ans) <- "allcov" return(ans) } rrcov/R/detmrcd.R0000644000176200001440000005643313607354065013377 0ustar liggesusers## @title Compute the Minimum Regularized Covariance Determinant (MRCD) estimator ## @references Paper available at: http://dx.doi.org/10.2139/ssrn.2905259. ## @param x a numerical matrix. The columns represent variables, and rows represent observations. ## @param alpha the proportion of the contamination (between 0.5 and 1) ## @param h the size of the subset (between ceiling(n/2) and n) ## @param initHsets NULL or a K x h integer matrix of initial subsets of observations ## of size h (specified by the indices in 1:n). If provided, then the initial ## shape estimates are not calculated. ## @param save.hsets ## @param maxcsteps maximum number of generalized C-steps for each initial subset (default 200) ## @param maxcond maximum condition number allowed (see step 3.4 in algorithm 1) (default 50) ## @param minscale minimum scale allowed (default 0.001) ## @param target = c("identity", "equicorrelation"). Structure of the robust ## positive definite target matrix: (default) "identity": target matrix is ## diagonal matrix with robustly estimated univariate scales on the diagonal or ## "equicorrelation": non-diagonal target matrix that incorporates an ## equicorrelation structure (see (17) in paper) ## @param trace ## @return A list with the following elements: ## \describe{ ## \item{icov}{inverse of the covariance matrix} ## \item{rho}{regularization parameter} ## \item{target}{the target matrix used} ## } ## .detmrcd <- function(x, h=NULL, alpha=.75, rho=NULL, maxcond=50, minscale=0.001, target=0, maxcsteps = 200, hsets.init=NULL, save.hsets=missing(hsets.init), full.h = save.hsets, trace=FALSE) { ## NOTES: VT ## ## - use r6pack from robustbase ## - X check subset #5 - something is wrong there ## - X mX is not back transformed to compensate the SVD rescaling ## ==> the distances returned by MWRCD are different from ## the distances computed outside of MWRCD. ## ## - X MRCD works with the transposed matrix X - it shoould be transposed inside the function ## - Help of CovMcd - remove data.matrix from the example ## - X What is doing the parameter 'bc'? Can be omitted - bc removed ## - X parameter 'initrho' is never used: remove it ## - X scfactor(alpha, p) is equivalent to robustbase:::.MCDcons(p, alpha) - replaced ## - X condnumber () is never used - remove it - removed ## - X robustbase:::r6pack() will not work for p > n, because there is a check svd$rank < p - comment out the check ## - X using kendal's tau cor.fk from pcaPP - replace by spearman. Later we could move cor.fk() from pcaPP into robustbase ## - X No SVD if the target matrix is the Identity; if equicorrelation, the eigenvectors are a helmert matrix ##---------------------------------------------------------------- ## @title Robust Distance based observation orderings based on robust "Six pack" ## @param x n x p data matrix ## @param h integer ## @param full.h full (length n) ordering or only the first h? ## @param scaled is 'x' is already scaled? otherwise, apply doScale(x, median, scalefn) ## @param scalefn function to compute a robust univariate scale. ## @return a h' x 6 matrix of indices from 1:n; if(full.h) h' = n else h' = h r6pack <- function(x, h, full.h, adjust.eignevalues=TRUE, scaled=TRUE, scalefn=Qn) { ## As the considered initial estimators Sk may have very ## inaccurate eigenvalues, we try to 'improve' them by applying ## a transformation similar to that used in the OGK algorithm. ## ## After that compute the corresponding distances, order them and ## return the indices initset <- function(data, scalefn, P, h) { stopifnot(length(d <- dim(data)) == 2, length(h) == 1, h >= 1) n <- d[1] stopifnot(h <= n) lambda <- doScale(data %*% P, center=median, scale=scalefn)$scale sqrtcov <- P %*% (lambda * t(P)) ## == P %*% diag(lambda) %*% t(P) sqrtinvcov <- P %*% (t(P) / lambda) ## == P %*% diag(1/lambda) %*% t(P) estloc <- colMedians(data %*% sqrtinvcov) %*% sqrtcov centeredx <- (data - rep(estloc, each=n)) %*% P sort.list(mahalanobisD(centeredx, FALSE, lambda))[1:h]# , partial = 1:h } ## ## Compute the raw OGK estimator. For m(.) and s(.) (robust ## univariate estimators of location and scale) use the median ## and Qn for reasons of simplicity (no choice of tuning parameters) ## and to be consistent with the other components of DetMCD. ## ogkscatter <- function(Y, scalefn, only.P = TRUE) { stopifnot(length(p <- ncol(Y)) == 1, p >= 1) U <- diag(p) for(i in seq_len(p)[-1L]) {# i = 2:p sYi <- Y[,i] ii <- seq_len(i - 1L) for(j in ii) { sYj <- Y[,j] U[i,j] <- (scalefn(sYi + sYj)^2 - scalefn(sYi - sYj)^2) / 4 } ## also set the upper triangle U[ii,i] <- U[i,ii] } ## now done above: U <- lower.tri(U) * U + t(U) # U <- tril(U, -1) + t(U) P <- eigen(U, symmetric=TRUE)$vectors if(only.P) return(P) ## else : Z <- Y %*% t(P) sigz <- apply(Z, 2, scalefn) lambda <- diag(sigz^2) list(P=P, lambda=lambda) } stopifnot(length(dx <- dim(x)) == 2) n <- dx[1] p <- dx[2] ## If scalefn is missing or is NULL, use Qn for smaller data sets (n < 1000) ## and tau-scale of Yohai and Zamar (1988) otherwise. ## scalefn <- robustbase:::robScalefn(scalefn, n) ## If the data was not scaled already (scaled=FALSE), center and scale using ## the median and the provided function 'scalefn'. if(!scaled) { ## Center and scale the data to (0, 1) - robustly x <- doScale(x, center=median, scale=scalefn)$x } nsets <- 6 hsets <- matrix(integer(), h, nsets) ## Determine 6 initial estimates (ordering of obs) ## 1. Hyperbolic tangent of standardized data y1 <- tanh(x) R1 <- cor(y1) P <- eigen(R1, symmetric=TRUE)$vectors hsets[,1] <- initset(x, scalefn=scalefn, P=P, h=h) ## 2. Spearmann correlation matrix R2 <- cor(x, method="spearman") P <- eigen(R2, symmetric=TRUE)$vectors hsets[,2] <- initset(x, scalefn=scalefn, P=P, h=h) ## 3. Tukey normal scores y3 <- qnorm((apply(x, 2L, rank) - 1/3)/(n + 1/3)) R3 <- cor(y3, use = "complete.obs") P <- eigen(R3, symmetric=TRUE)$vectors hsets[,3] <- initset(x, scalefn=scalefn, P=P, h=h) ## 4. Spatial sign covariance matrix znorm <- sqrt(rowSums(x^2)) ii <- znorm > .Machine$double.eps x.nrmd <- x x.nrmd[ii,] <- x[ii, ] / znorm[ii] SCM <- crossprod(x.nrmd)# / (n-1) not needed for e.vectors P <- eigen(SCM, symmetric=TRUE)$vectors hsets[,4] <- initset(x, scalefn=scalefn, P=P, h=h) ## 5. BACON ind5 <- order(znorm) half <- ceiling(n/2) Hinit <- ind5[1:half] covx <- cov(x[Hinit, , drop=FALSE]) P <- eigen(covx, symmetric=TRUE)$vectors hsets[,5] <- initset(x, scalefn=scalefn, P=P, h=h) ## 6. Raw OGK estimate for scatter P <- ogkscatter(x, scalefn, only.P=TRUE) hsets[,6] <- initset(x, scalefn=scalefn, P=P, h=h) ## VT::15.11.2019 ## No need of the code below in MRCD. ## Instead of computing md and sorting, just return hsets. ## if(!adjust.eignevalues) return (hsets) ## Now combine the six pack : if(full.h) hsetsN <- matrix(integer(), n, nsets) for(k in 1:nsets) ## sort each of the h-subsets in *increasing* Mah.distances { xk <- x[hsets[,k], , drop=FALSE] svd <- classPC(xk, signflip=FALSE) # [P,T,L,r,centerX,meanvct] = classSVD(xk) ## VT::15.10.2018 - we do not need this check, because we are using r6pack ## also for MRCD. Comment it out , maybe should move it to detmcd: FIXME ## if(svd$rank < p) ## FIXME: " return("exactfit") " ## stop('More than half of the observations lie on a hyperplane.') score <- (x - rep(svd$center, each=n)) %*% svd$loadings ord <- order(mahalanobisD(score, FALSE, sqrt(abs(svd$eigenvalues)))) if(full.h) hsetsN[,k] <- ord else hsets[,k] <- ord[1:h] } ## return if(full.h) hsetsN else hsets } # Return target correlation matrix with given structure # input: # mX: the p by n matrix of the data # target: structure of the robust positive definite target matrix (default=1) # 0: identity matrix # 1: non-diagonal matrix with an equicorrelation structure (see (17) in paper) # output: # the target correlation matrix .TargetCorr <- function(mX, target=1, mindet=0) { p <- dim(mX)[1] I <- diag(1, p) if(target == 0){ R <- I } else if(target == 1) { ## cortmp <- cor.fk(t(mX)) # from pcaPP ## cortmp <- cor(t(mX), method="kendal") # very slow cortmp <- cor(t(mX), method="spearman") cortmp <- sin(1/2 * pi * cortmp) constcor <- mean(cortmp[upper.tri(cortmp, diag=FALSE)]) # KB: add bound to ensure positive definiteness; see paper page 7, below (17) if(constcor <= min(c(0, (-1/(p-1) + 0.01)))){ constcor <- min(c(0,(-1/(p-1) + 0.01))) } J <- matrix(1, p, p) R <- constcor * J + (1-constcor) * I } return(R) } eigenEQ <- function(T) { rho <- T[1,2] d <- ncol(T) helmert <- matrix(0, nrow=d, ncol=d) helmert[, 1] <- rep(1/sqrt(d), d) for(j in 2:ncol(helmert)) { helmert[1:(j-1), j] <- 1/sqrt(j*(j-1)) helmert[j, j] <- -(j-1)/sqrt(j*(j-1)) } out <- NULL out$values <- c(1 + (d-1)*rho, rep(1-rho, d-1)) out$vectors <- helmert out } # compute the regularized covariance # input: # XX, the p by n (or h) matrix of the data (not necessarily demeaned) # vMu: the initial mean (p-vector) # rho: the regularization parameter # mT: the target matrix # scfac: the scaling factor # bcd: diagonal matrix used for rescaling (ratio of scales of target and mcd component) # target: structure of the robust positive definite target matrix (default=1) # 0: identity matrix # 1: non-diagonal matrix with an equicorrelation structure (see (17) in paper) # invert: if true, gives also inverted regularized covariance # # output (a list): # rho: the regularization parameter # mT: the target matrix # cov: the covariance matrix based on subset (without regularization step) # rcov: the regularized covariance matrix # inv_rcov: the inverse of the regularized covariance matrix (if invert=True) .RCOV <- function(XX, vMu, rho=NULL, mT, scfac, target=1, invert=FALSE) { mE <- XX-vMu n <- dim(mE)[2] p <- dim(mE)[1] mS <- mE %*% t(mE)/n rcov <- rho * mT + (1-rho) * scfac * mS if(invert) { if(p > n) { nu <- (1-rho) * scfac mU <- mE/sqrt(n) inv_rcov <- .InvSMW(rho=rho, mT=mT, nu=nu, mU=mU) }else { inv_rcov = chol2inv(chol(rcov)) } return(list(rho=rho, mT=mT, cov=mS, rcov=rcov, inv_rcov=inv_rcov)) } else return(list(rho=rho, mT=mT, cov=mS, rcov=rcov)) } ## Compute inverse of covariance matrix using Sherman-Morrison-Woodbury ## identity when dimension is larger than sample size # # input: # rho: the regularization parameter # mT: the target matrix # nu: the scaling factor multiplied with (1-rho) # mU: the scaled data # output: # the inverse of the covariance matrix .InvSMW <- function(rho, mT, nu, mU) { p = dim(mT)[1] pp = dim(mU) vD = sqrt(diag(mT)) imD = diag(vD^(-1)) R = imD %*% mT %*% imD constcor = R[2, 1] I = diag(1, p) J = matrix(1, p, p) imR = 1/(1-constcor) * (I - constcor/(1 + (p-1) * constcor) * J) imB = (rho)^(-1) * imD %*% imR %*% imD Temp <- base::chol2inv(base::chol(diag(pp[2]) + nu * (t(mU) %*% (imB %*% mU)))) return(imB - (imB%*%mU) %*% (nu * Temp) %*% (t(mU)%*%imB)) } # Apply generalized C-steps to obtain optimal subset # input: # mX: the p by T matrix of the residuals or data, not necessarily demeaned # rho: the regularization parameter # mT: the target matrix # target: structure of the robust positive definite target matrix (default=1) # 0: identity matrix # 1: non-diagonal matrix with an equicorrelation structure (see (17) in paper) # vMu: the initial mean (as vector) # mIS: the p by p matrix of the initial inverted covariance # h: the size of the subset OR alpha: the proportion of the contamination # maxcsteps: the maximal number of iteration of the C-step algorithm # index: the initial subset H_0 # output (a list) # index: the optimal h-subset # numit: the number of iterations # mu: the vector with means # cov: the regularized covariance estimate # icov: the inverse of the regularized covariance matrix # rho: the regularization parameter # mT: the target matrix # dist: the Mahalanobis distances using the MRCD estimates # scfac: the scaling factor .cstep_mrcd <- function(mX, rho=NULL, mT=NULL, target=1, vMu=NULL, mIS=NULL, h, scfac, index=NULL, maxcsteps=50) { n <- dim(mX)[2] p <- dim(mX)[1] # random choice if(is.null(index)) index <- sample(1:n, h) # if no index is given we sample one... XX <- mX[, index] # p x h if(is.null(vMu)) vMu = rowMeans(XX) if(is.null(mIS)){ ret = .RCOV(XX=XX, vMu=vMu, rho=rho, mT=mT, scfac=scfac, target=target, invert=T) mIS = ret$inv_rcov } vdst = diag(t(mX-vMu) %*% (mIS %*% (mX-vMu))) #vdst = apply(mX-vMu,2,ftmp) index = sort(sort.int(vdst, index.return=T)$ix[1:h]) iter = 1 while(iter < maxcsteps){ XX <- mX[,index] vMu <- rowMeans(XX) ret <- .RCOV(XX=XX, vMu=vMu, rho=rho, mT=mT, target=target, scfac=scfac, invert=T) mIS <- ret$inv_rcov vdst <- diag(t(mX-vMu) %*% (mIS %*% (mX-vMu))) nndex <- sort(sort.int(vdst,index.return=T)$ix[1:h]) if(all(nndex == index)) break index <- nndex iter <- iter+1 } return(list(index=index, numit=iter, mu=vMu, cov=ret$rcov, icov=ret$inv_rcov, rho=ret$rho, mT=ret$mT, dist=vdst, scfac=scfac)) } mX <- t(x) # we want the transposed data matrix ## several parametrs which we do not want toexpose to the user. mindet <- 0 # minimum determinant allowed for target matrix objective <- "geom" # objective function to determine optimal subset, see (3) in paper # 'det': typically one minimizes the determinant of the sample covariance based on the subset # 'geom': p-th root of determinant or standardized generalized variance (for numerical reasons) n <- dim(mX)[2] p <- dim(mX)[1] if(!is.null(h)) alpha <- h/n else if(!is.null(alpha)) h <- ceiling(alpha*n) else stop("Either 'h' (number of observations in a subset) or 'alpha' (proportion of observations) has to be supplied!") if(alpha < 1/2 | alpha > 1) stop("'alpha' must be between 0.5 and 1.0!") # choose objective function to determine optimal subset if (objective == 'det'){ obj <- function(x) det(x) }else if (objective == 'geom'){ obj <- function(x) { det(x)^(1/p) } #geometric mean of eigenvalues } ## 1. Standardize the p variables: compute standardized observations u_i, see (6) in paper, using median and Qn estimator vmx <- apply(mX, 1, median) vsd <- apply(mX, 1, Qn) vsd[vsd < minscale] <- minscale Dx <- diag(vsd) mU <- scale(t(mX), center=vmx, scale=vsd) mX <- t(mU) mT <- .TargetCorr(mX, target=target, mindet=mindet) ## 2. Perform singular value decomposition of target matrix and compute observations w_i if(target == 1){ mTeigen <- eigenEQ(mT) mQ <- mTeigen$vectors mL <- diag(mTeigen$values) msqL <- diag(sqrt(mTeigen$values)) misqL <- diag(sqrt(mTeigen$values)^(-1)) mW <- mU %*% mQ %*% misqL mX <- t(mW) } mT = diag(p) ## 3.1-3.2 Follow Hubert et al. (2012) to obtain 6 initial ## scatter matrices (if scatter matrix is not invertible, ## use its regularized version) ## 3.3 Determine subsets with lowest Mahalanobis distance ## Assume that 'hsets.init' already contains h-subsets: the first h observations each ## VT::15.11.2019 - added adjust.eignevalues=FALSE, this will set automatically full.h=FALSE if(is.null(hsets.init)) { hsets.init <- r6pack(x=t(mX), h=h, full.h=FALSE, adjust.eignevalues=FALSE, scaled=FALSE, scalefn=Qn) dh <- dim(hsets.init) } else { ## user specified, (even just *one* vector): if(is.vector(hsets.init)) hsets.init <- as.matrix(hsets.init) dh <- dim(hsets.init) if(dh[1] < h || dh[2] < 1) stop("'hsets.init' must be a h' x L matrix (h' >= h) of observation indices") if(full.h && dh[1] != n) warning("'full.h' is true, but 'hsets.init' has less than n rows") if(min(hsets.init) < 1 || max(hsets.init) > n) stop("'hsets.init' must be in {1,2,...,n}; n = ", n) } hsets.init <- hsets.init[1:h, ] scfac <- .MCDcons(p, h/n) # for consistency with MCD ## 3.4 Determine smallest value of rho_i for each subset rho6pack <- condnr <- c() nsets <- ncol(hsets.init) if(is.null(rho)) { for(k in 1:nsets){ mXsubset <- mX[ , hsets.init[, k]] vMusubset <- rowMeans(mXsubset) mE <- mXsubset-vMusubset mS <- mE%*%t(mE)/(h-1) if(all(mT == diag(p))) { veigen <- eigen(scfac * mS)$values e1 <- min(veigen) ep <- max(veigen) fncond <- function(rho) { condnr <- (rho + (1-rho) * ep) / (rho + (1-rho) * e1) return(condnr - maxcond) } } else { fncond <- function(rho) { rcov <- rho*mT + (1-rho) * scfac * mS temp <- eigen(rcov)$values condnr <- max(temp) / min(temp) return(condnr - maxcond) } } out <- try(uniroot(f=fncond, lower=0.00001, upper=0.99), silent=TRUE) if(class(out) != "try-error") { rho6pack[k] <- out$root }else { grid <- c(0.000001, seq(0.001, 0.99, by=0.001), 0.999999) if(all(mT == diag(p))) { objgrid <- abs(fncond(grid)) irho <- min(grid[objgrid == min(objgrid)]) }else { objgrid <- abs(apply(as.matrix(grid), 1, "fncond")) irho <- min(grid[objgrid == min(objgrid)]) } rho6pack[k] <- irho } } ## 3.5 Set rho as max of the rho_i's obtained for each subset in previous step cutoffrho <- max(c(0.1, median(rho6pack))) rho <- max(rho6pack[rho6pack <= cutoffrho]) Vselection <- seq(1, nsets) Vselection[rho6pack > cutoffrho] = NA if(sum(!is.na(Vselection)) == 0){ stop("None of the initial subsets is well-conditioned") } initV <- min(Vselection, na.rm=TRUE) setsV <- Vselection[!is.na(Vselection)] setsV <- setsV[-1] }else{ setsV <- 1:ncol(hsets.init) initV <- 1 } ## 3.6 For each of the six initial subsets, repeat the generalized ## C-steps (from Theorem 1) until convergence ## ## 3.7 Choose final subset that has lowest determinant among the ## ones obtained from the six initial subsets hset.csteps <- integer(nsets) ret <- .cstep_mrcd(mX=mX, rho=rho, mT=mT, target=target, h=h, scfac=scfac, index=hsets.init[, initV], maxcsteps=maxcsteps) objret <- obj(ret$cov) hindex <- ret$index best6pack <- initV for(k in setsV){ if(trace) { if(trace >= 2) cat(sprintf("H-subset %d = observations c(%s):\n-----------\n", k, paste(hsets.init[1:h, k], collapse=", "))) else cat(sprintf("H-subset %d: ", k)) } tmp <- .cstep_mrcd(mX=mX, rho=rho, mT=mT, target=target, h=h, scfac=scfac, index=hsets.init[,k], maxcsteps=maxcsteps) objtmp <- obj(tmp$cov) hset.csteps[k] <- tmp$numit if(trace) cat(sprintf("%3d csteps, obj=log(det|.|)=%g", k, objtmp)) if(objtmp < objret){ if(trace) cat(" = new optim.\n") ret <- tmp objret <- objtmp hindex <- tmp$index best6pack <- k } else if(objtmp == objret) # store as well best6pack <- c(best6pack, k) else if(trace) cat("\n") } c_alpha <- ret$scfac #scaling factor mE <- mX[, hindex] - ret$mu weightedScov <- mE %*% t(mE)/(h-1) D <- c_alpha * diag(1, p) ## MRCD estimates of the standardized data W (inner part of (12) in paper) MRCDmu = rowMeans(mX[,hindex]) MRCDcov = rho*mT + (1-rho) * c_alpha * weightedScov ## Computing inverse of scaled covariance matrix, using SMW identity ## if data is fat (inner part of (14) and (15) in paper). if(p > n & target <= 1){ # !!!! formula InvSMW is used when T is equicorrelation nu <- (1-rho) * c_alpha mU <- mE/sqrt(h-1) iMRCDcov <- .InvSMW(rho=rho, mT=mT, nu=nu, mU=mU) }else iMRCDcov <- chol2inv(chol(MRCDcov)) ## Backtransforming the rescaling steps that we applied in ## the beginning (outer part of (11) and (12) in paper) # transformations due to SVD on target matrix if(target == 1) { ##VT::12.12 - corrected the restoration of X after SVD transformation mX <- t(t(mX) %*% msqL %*% t(mQ)) ## mX <- t(t(mX) %*% mQ %*% msqL) MRCDmu <- mQ %*% msqL %*% MRCDmu MRCDcov <- mQ %*% msqL %*% MRCDcov %*% msqL %*% t(mQ) iMRCDcov <- mQ %*% misqL %*% iMRCDcov %*% misqL %*% t(mQ) mT <- mQ %*% msqL %*% mT %*% msqL %*% t(mQ) } # transformations due to rescaling median and Qn mX <- t(t(mX) %*% Dx) + vmx MRCDmu <- Dx %*% MRCDmu + vmx MRCDcov <- Dx %*% MRCDcov %*% Dx mT <- Dx %*% mT %*% Dx iDx <- diag(1/diag(Dx)) iMRCDcov <- iDx %*% iMRCDcov %*% iDx ## Compute the Mahalanobis distances based on MRCD estimates dist <- mahalanobis(t(mX), center=MRCDmu, cov=iMRCDcov, inverted=TRUE) objret <- determinant(MRCDcov)$modulus[1] ret <- list(alpha=alpha, h=h, initmean=as.numeric(MRCDmu), initcovariance=MRCDcov, icov=iMRCDcov, rho=rho, best=hindex, mcdestimate=objret, mah=dist, target=mT, iBest = best6pack, n.csteps=hset.csteps, initHsets=if(save.hsets) hsets.init, calpha=c_alpha ) return (ret) } rrcov/R/psifun.R0000644000176200001440000000413712763517421013252 0ustar liggesusers## Internal functions, used for ## computing expectations ## .chiInt <- function(p,a,c1) ## partial expectation d in (0,c1) of d^a under chi-squared p return(exp(lgamma((p+a)/2)-lgamma(p/2))*2^{a/2}*pchisq(c1^2,p+a)) .chiInt2 <- function(p,a,c1) ## partial expectation d in (c1,\infty) of d^a under chi-squared p return(exp(lgamma((p+a)/2)-lgamma(p/2))*2^{a/2}*(1-pchisq(c1^2,p+a)) ) ## ## derivatives of the above functions wrt c1 ## .chiIntD <- function(p,a,c1) return(exp(lgamma((p+a)/2)-lgamma(p/2))*2^{a/2}*dchisq(c1^2,p+a)*2*c1) .chiInt2D <- function(p,a,c1) return(-exp(lgamma((p+a)/2)-lgamma(p/2))*2^{a/2}*dchisq(c1^2,p+a)*2*c1) setMethod("iterM", "PsiFun", function(obj, x, t1, s, eps=1e-3, maxiter=20){ ## M-estimation from starting point (t1, s) for translated ## biweight with median scaling (Rocke & Woodruf (1993)) ## - obj contains the weight function parameters, e.g. ## obj@c1 and obj@M are the constans for the translated ## biweight ## - eps - precision for the convergence algorithm ## - maxiter - maximal number of iterations # x <- as.matrix(x) n <- nrow(x) p <- ncol(x) crit <- 100 iter <- 1 w1d <- w2d <- rep(1,n) while(crit > eps & iter <= maxiter) { t.old <- t1 s.old <- s wt.old <- w1d v.old <- w2d ## compute the mahalanobis distances with the current estimates t1 and s d <- sqrt(mahalanobis(x, t1, s)) # Compute k = sqrt(d[(n+p+1)/2])/M # and ajust the distances d = sqrt(d)/k h <- (n+p+1)%/%2 d <- d*sqrt(qchisq(h/(n+1), p))/(sort(d)[h]) # compute the weights w1d <- wt(obj, d) w2d <- vt(obj, d) ## compute reweighted mean and covariance matrix t1 <- colSums(w1d*x)/sum(w1d) xx <- sqrt(w1d)*sweep(x, 2, t1) s <- p*(t(xx) %*% xx)/sum(w2d) ## check convergence crit <- max(abs(w1d-wt.old))/max(w1d) iter <- iter+1 } return(list(t1=t1, s=s, iter=iter, wt=w1d, vt=w2d)) }) rrcov/R/Pca.R0000644000176200001440000004471513363451511012451 0ustar liggesuserssetMethod("names", "Pca", function(x) slotNames(x)) setMethod("$", c("Pca"), function(x, name) slot(x, name)) setMethod("getCenter", "Pca", function(obj) obj@center) setMethod("getScale", "Pca", function(obj) obj@scale) setMethod("getLoadings", "Pca", function(obj) obj@loadings) setMethod("getEigenvalues", "Pca", function(obj) obj@eigenvalues) setMethod("getSdev", "Pca", function(obj) sqrt(obj@eigenvalues)) setMethod("getScores", "Pca", function(obj) obj@scores) setMethod("getPrcomp", "Pca", function(obj) { ret <- list(sdev=sqrt(obj@eigenvalues), rotation=obj@loadings, center=obj@center, scale=obj@scale, x=obj@scores) class(ret) <- "prcomp" ret }) ## ## Follow the standard methods: show, print, plot ## setMethod("show", "Pca", function(object) myPcaPrint(object)) setMethod("summary", "Pca", function(object, ...){ vars <- getEigenvalues(object) vars <- vars/sum(vars) importance <- rbind("Standard deviation" = getSdev(object), "Proportion of Variance" = round(vars,5), "Cumulative Proportion" = round(cumsum(vars), 5)) colnames(importance) <- colnames(getLoadings(object)) new("SummaryPca", pcaobj=object, importance=importance) }) setMethod("show", "SummaryPca", function(object){ cat("\nCall:\n") print(object@pcaobj@call) digits = max(3, getOption("digits") - 3) cat("Importance of components:\n") print(object@importance, digits = digits) invisible(object) }) ## setMethod("print", "Pca", function(x, ...) myPcaPrint(x, ...)) setMethod("predict", "Pca", function(object, ...){ predict(getPrcomp(object), ...) }) setMethod("screeplot", "Pca", function(x, ...){ screeplot(getPrcomp(x), ...) }) setMethod("biplot", "Pca", function(x, choices=1L:2L, scale=1, ...){ if(length(getEigenvalues(x)) < 2) stop("Need at least two components for biplot.") lam <- sqrt(getEigenvalues(x)[choices]) scores <- getScores(x) n <- NROW(scores) lam <- lam * sqrt(n) if(scale < 0 || scale > 1) warning("'scale' is outside [0, 1]") if(scale != 0) lam <- lam^scale else lam <- 1 xx <- t(t(scores[, choices]) / lam) yy <- t(t(getLoadings(x)[, choices]) * lam) .biplot(xx, yy, ...) invisible() }) setMethod("scorePlot", "Pca", function(x, i=1, j=2, ...){ pca.scoreplot(obj=x, i=i, j=j, ...) }) ## The __outlier map__ (diagnostic plot, distance-distance plot) ## visualizes the observations by plotting their orthogonal ## distance to the robust PCA subspace versus their robust ## distances within the PCA subspace. This allows to classify ## the data points into 4 types: regular observations, good ## leverage points, bad leverage points and orthogonal outliers. ## The outlier plot is only possible when k < r (the number of ## selected components is less than the rank of the matrix). ## Otherwise a __distance plot__ will be shown (distances against ## index). ## ## The __screeplot__ shows the eigenvalues and is helpful to select ## the number of principal components. ## ## The __biplot__ is plot which aims to represent both the ## observations and variables of a matrix of multivariate data ## on the same plot. ## ## The __scoreplot__ shows a scatterplot of i-th against j-th score ## of the Pca object with superimposed tollerance (0.975) ellipse ## ## VT::17.06.2008 ##setMethod("plot", "Pca", function(x, y="missing", setMethod("plot", signature(x="Pca", y="missing"), function(x, y="missing", id.n.sd=3, id.n.od=3, ...){ if(all(x@od > 1.E-06)) pca.ddplot(x, id.n.sd, id.n.od, ...) else pca.distplot(x, id.n.sd, ...) }) myPcaPrint <- function(x, print.x=FALSE, print.loadings=FALSE, ...) { if(!is.null(cl <- x@call)) { cat("Call:\n") dput(cl) cat("\n") } cat("Standard deviations:\n"); print(sqrt(getEigenvalues(x)), ...) if(print.loadings) { cat("\nLoadings:\n"); print(getLoadings(x), ...) } if (print.x) { cat("\nRotated variables:\n"); print(getScores(x), ...) } invisible(x) } ## Internal function to calculate the score and orthogonal distances and the ## appropriate cutoff values for identifying outlying observations ## ## obj - the Pca object ## data - ## r - rank ## crit - criterion for computing cutoff for SD and OD ## ## - cutoff for score distances: sqrt(qchisq(crit, k) ## - cutoff for orthogonal distances: Box (1954) ## pca.distances <- function(obj, data, r, crit=0.975) { .distances(data, r, obj, crit) } .distances <- function(data, r, obj, crit=0.975) { ## remember the criterion, could be changed by the user obj@crit.pca.distances <- crit ## compute the score distances and the corresponding cutoff value n <- nrow(data) smat <- diag(obj@eigenvalues, ncol=ncol(obj@scores)) ## VT::02.06.2010: it can happen that the rank of the matrix ## is nk=ncol(scores), but the rank of the diagonal matrix of ## eigenvalues is lower: for example if the last singular ## value was 1E-7, the last eigenvalue will be sv^2=1E-14 ## nk <- min(ncol(obj@scores), rankMM(smat)) if(nk < ncol(obj@scores)) warning(paste("Too small eigenvalue(s): ", obj@eigenvalues[ncol(obj@scores)], "- the diagonal matrix of the eigenvalues cannot be inverted!")) obj@sd <- sqrt(mahalanobis(as.matrix(obj@scores[,1:nk]), rep(0, nk), diag(obj@eigenvalues[1:nk], ncol=nk))) obj@cutoff.sd <- sqrt(qchisq(crit, obj@k)) ## Compute the orthogonal distances and the corresponding cutoff value ## For each point this is the norm of the difference between the ## centered data and the back-transformed scores ## obj@od <- apply(data - repmat(obj@center, n, 1) - obj@scores %*% t(obj@loadings), 1, vecnorm) ## VT::21.06.2016 - the data we get here is the original data - neither centered nor scaled. ## - center and scale the data ## obj@od <- apply(data - matrix(rep(obj@center, times=n), nrow=n, byrow=TRUE) - obj@scores %*% t(obj@loadings), 1, vecnorm) obj@od <- apply(scale(data, obj@center, obj@scale) - obj@scores %*% t(obj@loadings), 1, vecnorm) if(is.list(dimnames(obj@scores))) { names(obj@od) <- dimnames(obj@scores)[[1]] } ## The orthogonal distances make sence only if the number of PCs is less than ## the rank of the data matrix - otherwise set it to 0 obj@cutoff.od <- 0 if(obj@k != r) { obj@cutoff.od <- .crit.od(obj@od, crit=crit, classic=inherits(obj,"PcaClassic")) } ## flag the observations with 1/0 if the distances are less or equal the ## corresponding cutoff values obj@flag <- obj@sd <= obj@cutoff.sd if(obj@cutoff.od > 0) obj@flag <- (obj@flag & obj@od <= obj@cutoff.od) return(obj) } .crit.od <- function(od, crit=0.975, umcd=FALSE, quan, classic=FALSE) { od <- od^(2/3) if(classic) { t <- mean(od) s <- sd(od) }else if(umcd) { ms <- unimcd(od, quan=quan) t <- ms$tmcd s <- ms$smcd }else { t <- median(od) s <- mad(od) } cv <- (t + s * qnorm(crit))^(3/2) cv } ## Flip the signs of the loadings ## - comment from Stephan Milborrow ## .signflip <- function(loadings) { if(!is.matrix(loadings)) loadings <- as.matrix(loadings) apply(loadings, 2, function(x) if(x[which.max(abs(x))] < 0) -x else x) } ## This is from MM in robustbase, but I want to change it and ## therefore took a copy. Later will update in 'robustbase' ## I want to use not 'scale()', but doScale to which i can pass also ## a function. .classPC <- function(x, scale=FALSE, center=TRUE, signflip=TRUE, via.svd = n > p, scores=FALSE) { if(!is.numeric(x) || !is.matrix(x)) stop("'x' must be a numeric matrix") else if((n <- nrow(x)) <= 1) stop("The sample size must be greater than 1 for svd") p <- ncol(x) if(is.logical(scale)) scale <- if(scale) sd else vector('numeric', p) + 1 else if(is.null(scale)) scale <- vector('numeric', p) + 1 if(is.logical(center)) center <- if(center) mean else vector('numeric', p) else if(is.null(center)) center <- vector('numeric', p) x.scaled <- doScale(x, center=center, scale=scale) x <- x.scaled$x center <- x.scaled$center scale <- x.scaled$scale if(via.svd) { svd <- svd(x, nu=0) rank <- rankMM(x, sv=svd$d) loadings <- svd$v[,1:rank] eigenvalues <- (svd$d[1:rank])^2 /(n-1) ## FIXME: here .^2; later sqrt(.) } else { ## n <= p; was "kernelEVD" e <- eigen(tcrossprod(x), symmetric=TRUE) evs <- e$values tolerance <- n * max(evs) * .Machine$double.eps rank <- sum(evs > tolerance) evs <- evs[ii <- seq_len(rank)] eigenvalues <- evs / (n-1) ## MM speedup, was: crossprod(..) %*% diag(1/sqrt(evs)) loadings <- crossprod(x, e$vectors[,ii]) * rep(1/sqrt(evs), each=p) } ## VT::15.06.2010 - signflip: flip the sign of the loadings if(signflip) loadings <- .signflip(loadings) list(rank=rank, eigenvalues=eigenvalues, loadings=loadings, scores = if(scores) x %*% loadings, center=center, scale=scale) } ## VT::19.08.2016 ## classSVD and kernelEVD are no more used - see .classPC ## ## VT::15.06.2010 - Added scaling and flipping of the loadings ## classSVD <- function(x, scale=FALSE, signflip=TRUE){ if(!is.numeric(x) || !is.matrix(x)) stop("'x' must be a numeric matrix") else if(nrow(x) <= 1) stop("The sample size must be greater than 1 for svd") n <- nrow(x) p <- ncol(x) center <- apply(x, 2, mean) x <- scale(x, center=TRUE, scale=scale) if(scale) scale <- attr(x, "scaled:scale") svd <- svd(x/sqrt(n-1)) rank <- rankMM(x, sv=svd$d) eigenvalues <- (svd$d[1:rank])^2 loadings <- svd$v[,1:rank] ## VT::15.06.2010 - signflip: flip the sign of the loadings if(!is.matrix(loadings)) loadings <- data.matrix(loadings) if(signflip) loadings <- .signflip(loadings) scores <- x %*% loadings list(loadings=loadings, scores=scores, eigenvalues=eigenvalues, rank=rank, center=center, scale=scale) } ## VT::15.06.2010 - Added scaling and flipping of the loadings ## kernelEVD <- function(x, scale=FALSE, signflip=TRUE){ if(!is.numeric(x) || !is.matrix(x)) stop("'x' must be a numeric matrix") else if(nrow(x) <= 1) stop("The sample size must be greater than 1 for svd") n <- nrow(x) p <- ncol(x) if(n > p) classSVD(x, scale=scale, signflip=signflip) else { center <- apply(x, 2, mean) x <- scale(x, center=TRUE, scale=scale) if(scale) scale <- attr(x, "scaled:scale") e <- eigen(x %*% t(x)/(n-1)) tolerance <- n * max(e$values) * .Machine$double.eps rank <- sum(e$values > tolerance) eigenvalues <- e$values[1:rank] loadings <- t((x/sqrt(n-1))) %*% e$vectors[,1:rank] %*% diag(1/sqrt(eigenvalues)) ## VT::15.06.2010 - signflip: flip the sign of the loadings if(signflip) loadings <- .signflip(loadings) scores <- x %*% loadings ret <- list(loadings=loadings, scores=scores, eigenvalues=eigenvalues, rank=rank, center=center, scale=scale) } } ## Score plot of the Pca object 'obj' - scatterplot of ith against jth score ## with superimposed tollerance (0.975) ellipse pca.scoreplot <- function(obj, i=1, j=2, main, id.n=0, ...) { if(missing(main)) { main <- if(inherits(obj,"PcaClassic")) "Classical PCA" else "Robust PCA" } x <- cbind(getScores(obj)[,i], getScores(obj)[,j]) ## VT::11.06.2012 ## Here we assumed that the scores are not correlated and ## used a diagonal matrix with the eigenvalues on the diagonal to draw the ellipse ## This is not the case with PP methods, therefore we compute the covariance of ## the scores, considering only the non-outliers ## (based on sore and orthogonal distances) ## ## ev <- c(getEigenvalues(obj)[i], getEigenvalues(obj)[j]) ## cpc <- list(center=c(0,0), cov=diag(ev), n.obs=obj@n.obs) flag <- obj@flag cpc <- cov.wt(x, wt=flag) ## We need to inflate the covariance matrix with the proper size: ## see Maronna et al. (2006), 6.3.2, page 186 ## ## - multiply the covariance by quantile(di, alpha)/qchisq(alpha, 2) ## where alpha = h/n ## ## mdx <- mahalanobis(x, cpc$center, cpc$cov) ## alpha <- length(flag[which(flag != 0)])/length(flag) ## cx <- quantile(mdx, probs=alpha)/qchisq(p=alpha, df=2) ## cpc$cov <- cx * cpc$cov .myellipse(x, xcov=cpc, xlab=paste("PC",i,sep=""), ylab=paste("PC",j, sep=""), main=main, id.n=id.n, ...) abline(v=0) abline(h=0) } ## Distance-distance plot (or diagnostic plot, or outlier map) ## Plots score distances against orthogonal distances pca.ddplot <- function(obj, id.n.sd=3, id.n.od=3, main, xlim, ylim, off=0.02, ...) { if(missing(main)) { main <- if(inherits(obj,"PcaClassic")) "Classical PCA" else "Robust PCA" } if(all(obj@od <= 1.E-06)) warning("PCA diagnostic plot is not defined") else { if(missing(xlim)) xlim <- c(0, max(max(obj@sd), obj@cutoff.sd)) if(missing(ylim)) ylim <- c(0, max(max(obj@od), obj@cutoff.od)) plot(obj@sd, obj@od, xlab="Score distance", ylab="Orthogonal distance", main=main, xlim=xlim, ylim=ylim, type="p", ...) abline(v=obj@cutoff.sd) abline(h=obj@cutoff.od) label.dd(obj@sd, obj@od, id.n.sd, id.n.od, off=off) } invisible(obj) } ## Distance plot, plots score distances against index pca.distplot <- function(obj, id.n=3, title, off=0.02, ...) { if(missing(title)) { title <- if(inherits(obj,"PcaClassic")) "Classical PCA" else "Robust PCA" } ymax <- max(max(obj@sd), obj@cutoff.sd) plot(obj@sd, xlab="Index", ylab="Score distance", ylim=c(0,ymax), type="p", ...) abline(h=obj@cutoff.sd) label(1:length(obj@sd), obj@sd, id.n, off=off) title(title) invisible(obj) } label <- function(x, y, id.n=3, off=0.02){ xrange <- par("usr") xrange <- xrange[2] - xrange[1] if(id.n > 0) { n <- length(y) ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] if(is.character(names(y))) lab <- names(y[ind]) else lab <- ind text(x[ind] - off*xrange, y[ind], lab) } } label.dd <- function(x, y, id.n.sd=3, id.n.od=3, off=0.02){ xrange <- par("usr") xrange <- xrange[2] - xrange[1] if(id.n.sd > 0 && id.n.od > 0) { n <- length(x) ind.sd <- sort(x, index.return=TRUE)$ix ind.sd <- ind.sd[(n - id.n.sd + 1):n] ind.od <- sort(y, index.return=TRUE)$ix ind.od <- ind.od[(n - id.n.od + 1):n] lab <- ind.od if(is.character(names(y))) lab <- names(y[ind.od]) text(x[ind.od] - off*xrange, y[ind.od], lab) lab <- ind.sd if(is.character(names(x))) lab <- names(x[ind.sd]) text(x[ind.sd] - off*xrange, y[ind.sd], lab) } } ## VT::30.09.2009 - add a parameter 'classic' to generate a default caption ## "Robust biplot" or "Classical biplot" for a robust/classical ## PCA object, resp. ## --- do not use it for now --- ## .biplot <- function(x, y, classic, var.axes = TRUE, col, cex = rep(par("cex"), 2), xlabs = NULL, ylabs = NULL, expand=1, xlim = NULL, ylim = NULL, arrow.len = 0.1, main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ...) { n <- nrow(x) p <- nrow(y) ## if(is.null(main)) ## main <- if(classic) "Classical biplot" else "Robust biplot" if(missing(xlabs)) { xlabs <- dimnames(x)[[1L]] if(is.null(xlabs)) xlabs <- 1L:n } xlabs <- as.character(xlabs) dimnames(x) <- list(xlabs, dimnames(x)[[2L]]) if(missing(ylabs)) { ylabs <- dimnames(y)[[1L]] if(is.null(ylabs)) ylabs <- paste("Var", 1L:p) } ylabs <- as.character(ylabs) dimnames(y) <- list(ylabs, dimnames(y)[[2L]]) if(length(cex) == 1L) cex <- c(cex, cex) pcol <- par("col") if(missing(col)) { col <- par("col") if(!is.numeric(col)) col <- match(col, palette(), nomatch=1L) col <- c(col, col + 1L) } else if(length(col) == 1L) col <- c(col, col) unsigned.range <- function(x) c(-abs(min(x, na.rm=TRUE)), abs(max(x, na.rm=TRUE))) rangx1 <- unsigned.range(x[, 1L]) rangx2 <- unsigned.range(x[, 2L]) rangy1 <- unsigned.range(y[, 1L]) rangy2 <- unsigned.range(y[, 2L]) if(missing(xlim) && missing(ylim)) xlim <- ylim <- rangx1 <- rangx2 <- range(rangx1, rangx2) else if(missing(xlim)) xlim <- rangx1 else if(missing(ylim)) ylim <- rangx2 ratio <- max(rangy1/rangx1, rangy2/rangx2)/expand on.exit(par(op)) op <- par(pty = "s") if(!is.null(main)) op <- c(op, par(mar = par("mar")+c(0,0,1,0))) plot(x, type = "n", xlim = xlim, ylim = ylim, col = col[[1L]], xlab = xlab, ylab = ylab, sub = sub, main = main, ...) text(x, xlabs, cex = cex[1L], col = col[[1L]], ...) par(new = TRUE) plot(y, axes = FALSE, type = "n", xlim = xlim*ratio, ylim = ylim*ratio, xlab = "", ylab = "", col = col[[1L]], ...) ## axis(3, col = col[2L], ...) ## axis(4, col = col[2L], ...) ## box(col = col[1L]) axis(3, col = pcol, ...) axis(4, col = pcol, ...) box(col = pcol) text(y, labels=ylabs, cex = cex[2L], col = col[[2L]], ...) if(var.axes) arrows(0, 0, y[,1L] * 0.8, y[,2L] * 0.8, col = col[[2L]], length=arrow.len) invisible() } rrcov/R/PcaProj.R0000644000176200001440000000663612763517421013312 0ustar liggesuserssetMethod("getQuan", "PcaProj", function(obj) obj@n.obs) ## The S3 version PcaProj <- function (x, ...) UseMethod("PcaProj") PcaProj.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a 'standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaProj.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaProj") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaProj.default <- function(x, k=0, kmax=ncol(x), scale=FALSE, na.action = na.fail, crit.pca.distances=0.975, trace=FALSE, ...) { cl <- match.call() if(missing(x)){ stop("You have to provide at least some data") } data <- as.matrix(x) n <- nrow(data) p <- ncol(data) ## ## verify and set the input parameters: k and kmax ## kmax <- max(min(floor(kmax), rankMM(x)),1) if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } if(k != 0) k <- min(k, ncol(data)) else { k <- min(kmax, ncol(data)) if(trace) cat("The number of principal components is defined by the algorithm. It is set to ", k,".\n", sep="") } ###################################################################### if(is.logical(scale)) { scale <- if(scale) sd else NULL } out <- PCAproj(x, k, scale=scale, ...) scores <- predict(out) center <- out$center scale <- out$scale sdev <- out$sdev scores <- as.matrix(scores[, 1:k]) loadings <- as.matrix(out$loadings[, 1:k]) eigenvalues <- (sdev^2)[1:k] ###################################################################### names(eigenvalues) <- NULL if(is.list(dimnames(data))) rownames(scores) <- rownames(data) # dimnames(scores)[[1]] <- dimnames(data)[[1]] dimnames(scores)[[2]] <- paste("PC", seq_len(ncol(scores)), sep = "") dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaProj") res <- new("PcaProj", call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=scale, scores=scores, k=k, n.obs=n) ## Compute distances and flags res <- pca.distances(res, x, p, crit.pca.distances) return(res) } rrcov/R/Linda.R0000644000176200001440000003213713573766030013000 0ustar liggesusers## The S3 version Linda <- function (x, ...) UseMethod("Linda") Linda.formula <- function(formula, data, ..., subset, na.action) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- Linda.default(x, grouping, ...) ## res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as 'formula' cl <- match.call() cl[[1]] <- as.name("Linda") res@call <- cl ## res$contrasts <- attr(x, "contrasts") ## res$xlevels <- .getXlevels(Terms, m) ## res$na.action <- attr(m, "na.action") res } Linda.default <- function(x, grouping, prior = proportions, tol = 1.0e-4, method = c("mcd", "mcdA", "mcdB", "mcdC", "fsa", "mrcd", "ogk"), alpha=0.5, l1med=FALSE, cov.control, trace=FALSE, ...) { if(is.null(dim(x))) stop("x is not a matrix") method <- match.arg(method) xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) if(length(grouping) == 1) { ## this is the number of groups and the groups are of equal size ng = grouping ni = n/ng if(ng*ni < n) stop("nrow(x) is not divisible by the number of groups") grouping <- rep(0,0) for(i in 1:ng) grouping <- c(grouping, rep(i,ni)) }else if(length(grouping) > 1 && length(grouping) < n) { ## grouping contains a vector with the group sizes ng <- length(grouping) if(sum(grouping) != n) stop("nrow(x) is not equal to n1+n2+...+nn") gx <- rep(0,0) for(i in 1:ng) gx <- c(gx, rep(i,grouping[i])) grouping <- gx } if(n != length(grouping)) stop("nrow(x) and length(grouping) are different") g <- as.factor(grouping) lev <- lev1 <- levels(g) counts <- as.vector(table(g)) if(!missing(prior)) { if(any(prior < 0) || round(sum(prior), 5) != 1) stop("invalid prior") if(length(prior) != nlevels(g)) stop("prior is of incorrect length") prior <- prior[counts > 0] } if(any(counts == 0)) { warning(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) lev1 <- lev[counts > 0] g <- factor(g, levels=lev1) counts <- as.vector(table(g)) } proportions <- counts/n ng <- length(proportions) names(g) <- NULL names(prior) <- levels(g) if(missing(cov.control)) cov.control <- if(method == "mrcd") CovControlMrcd(alpha=alpha) else if(method == "ogk") CovControlOgk() else if(method %in% c("mcd", "mcdA", "mcdB", "mcdC")) CovControlMcd(alpha=alpha) else NULL if(method == "mcdC" && !inherits(cov.control, "CovControlMcd")) stop("Method 'C' is defined only for MCD estimates!") if(method == "mcdA" && !inherits(cov.control, "CovControlMcd")) stop("Method 'A' is defined only for MCD estimates!") if(method == "mrcd" && !inherits(cov.control, "CovControlMrcd")) stop("Method 'mrcd' is defined only for MRCD estimates!") if(method == "ogk" && !inherits(cov.control, "CovControlOgk")) stop("Method 'ogk' is defined only for OGK estimates!") if(inherits(cov.control, "CovControlMrcd")) method <- "mrcd" if(inherits(cov.control, "CovControlOgk")) method <- "ogk" if(method == "fsa"){ if(nrow(x) > 5000 | ncol(x) > 100) stop("Method 'fsa' can handle at most 5000 cases and 100 variables!") xcov <- .wcovMwcd(x, grouping, alpha=alpha, trace=trace) } else if(method == "mcdA"){ xcov <- .wcovMcd(x, grouping, method="A", cov.control=cov.control) } else if(method == "mcd" || method == "mrcd" || method == "mcdB" || method == "ogk"){ xcov <- .wcovMcd(x, grouping, method="B", l1med=l1med, cov.control=cov.control) } else if(method == "mcdC"){ xcov <- .wcovMcd(x, grouping, method="C", l1med=l1med, cov.control=cov.control) } else { stop(paste("Unknown method called: ", method)) } ## VT::27.11.2019 ## inv <- solve(xcov$wcov) inv <- if(!is.null(xcov$winv)) xcov$winv else if(!.isSingular(xcov$wcov)) solve(xcov$wcov) else .pinv(xcov$wcov) ldf <- xcov$means %*% inv ldfconst <- diag(log(prior) - ldf %*% t(xcov$means)/2) if(!is.null(xcov$raw.means) && !is.null(xcov$raw.wcov)){ raw.means <- xcov$raw.means raw.wcov <- xcov$raw.wcov ## inv <- solve(raw.wcov) inv <- if(!.isSingular(raw.wcov)) solve(raw.wcov) else .pinv(raw.wcov) raw.ldf <- raw.means %*% inv raw.ldfconst <- diag(log(prior) - raw.ldf %*% t(raw.means)/2) }else{ raw.means <- xcov$means raw.wcov <- xcov$wcov raw.ldf <- ldf raw.ldfconst <- ldfconst } return (new("Linda", call=xcall, prior=prior, counts=counts, center=xcov$means, cov=xcov$wcov, ldf = ldf, ldfconst = ldfconst, method=method, l1med=l1med, X=x, grp=g, covobj=xcov$covobj, control=cov.control)) } .wcovMcd <- function(x, grouping, method = c("A", "B", "C"), alpha=0.5, l1med=FALSE, cov.control){ xcall <- match.call() method <- match.arg(method) x <- as.matrix(x) n <- nrow(x) p <- ncol(x) dimn <- dimnames(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts/n) # compute group means and covariance matrices for each group mX <- matrix(0,ng,p) covX <- array(0,c(p,p,ng)) sumwt <- array(0,ng) raw.mX <- matrix(0,ng,p) raw.covX <- array(0,c(p,p,ng)) raw.sumwt <- array(0,ng) if(method == "A" | !l1med) { for(i in 1:ng){ mcd <- if(!is.null(cov.control)) restimate(cov.control, x[which(g == lev[i]),]) else Cov(x[which(g == lev[i]),]) mX[i,] <- getCenter(mcd) if(inherits(mcd, "CovMcd")) { sumwt[i] <- sum(mcd@wt) covX[,,i] <- getCov(mcd) * sumwt[i] raw.mX[i,] <- mcd@raw.center raw.sumwt[i] <- length(mcd@best) raw.covX[,,i] <- mcd@raw.cov * raw.sumwt[i] } } } else { for(i in 1:ng){ mX[i,] <- l1median(x[which(g == lev[i]),]) } } if(method == "A"){ #Method A: pool the covariance matrices wcov <- matrix(0,p,p) for(i in 1:ng){ wcov <- wcov + covX[,,i] } wcov <- wcov/(sum(sumwt)-ng) final.xcov <- list(wcov=wcov, means=mX, covobj=NULL) ## pool the raw estimates wcov <- matrix(0,p,p) for(i in 1:ng){ wcov <- wcov + raw.covX[,,i] } wcov <- wcov/(sum(raw.sumwt)-ng) mX <- raw.mX mah <- mahalanobis(x-mX[g,], rep(0,p), wcov) weights <- ifelse(mah< qchisq(0.975, p), 1, 0) method <- "mcd-A" }else if(method == "B"){ #Method B: center the data and compute the covariance matrix #of the centered data mcd <- if(!is.null(cov.control)) restimate(cov.control, x - mX[g,]) else Cov(x - mX[g,]) winv <- if("icov" %in% slotNames(mcd)) mcd@icov else NULL final.xcov <- list(wcov=getCov(mcd), winv=winv, means=t(t(mX)+getCenter(mcd)), covobj=mcd) if(inherits(mcd, "CovMcd")) { wcov <- mcd@raw.cov mX <- t(t(mX)+mcd@raw.center) mah <- mcd@raw.mah weights <- mcd@raw.wt }else { wcov <- getCov(mcd) mX <- t(t(mX)+getCenter(mcd)) mah <- weights <- NULL } method <- "mcd-B" }else if(method == "C"){ ## Method C is more or less the same as Method B, but the means ## are computed as the means of the Hi observations from mcd$best ## and the covariance matrix is the raw.cov ## ## Center the data and compute the means and covariance matrix ## of the centered data as in Method B mcd <- restimate(cov.control, x - mX[g,]) ## compute the group means as the means of these observations which are in ## mcd@best, i.e. in case of two groups, if H=best ## partition H in H1 and H2 and compute mi as the mean of the Hi observations ## respectively. ## Take the raw covariance matrix as within group cov for(i in 1:ng){ tmpc <- cov.wt(as.matrix(x[mcd@best[which(mcd@best%in% which(g == lev[i]))],])) mX[i,] <- tmpc$center } wcov <- mcd@raw.cov mah <- mahalanobis(x-mX[g,], rep(0,p), wcov) weights <- ifelse(mah< qchisq(0.975, p), 1, 0) final.xcov <- .wcov.wt(x, g, weights) method <- "mcd-C" }else{ stop("Unknown method specified: ", method) } dimnames(wcov) <- list(dimn[[2]], dimn[[2]]) dimnames(mX) <- list(levels(g), dimn[[2]]) dimnames(final.xcov$wcov) <- list(dimn[[2]], dimn[[2]]) dimnames(final.xcov$means) <- list(levels(g), dimn[[2]]) ans <- list(call=xcall, means=final.xcov$means, wcov=final.xcov$wcov, winv=final.xcov$winv, method=method, raw.means=mX, raw.wcov=wcov, raw.mah=mah, raw.wt=weights, covobj=final.xcov$covobj) class(ans) <- "wcov" return(ans) } .wcovMwcd <- function(x, grouping, alpha=0.5, trace=0){ quan.f <- function(alpha, n, rk) { quan <- floor(2 * floor((n+rk+1)/2) - n + 2 * (n - floor((n+rk+1)/2)) * alpha) return(quan) } xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) quan <- quan.f(alpha, n, p) dimn <- dimnames(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts/n) grouping <- as.integer(g) # transpose x, as necessary for the FSADA subroutine X <- t(x) storage.mode(X) <- "double" storage.mode(n) <- "integer" storage.mode(p) <- "integer" storage.mode(ng) <- "integer" # NG storage.mode(grouping) <- "integer" # IGRP xmean <- matrix(0, nrow = p * ng, ncol = 1) # XM storage.mode(xmean) <- "double" xcov <- matrix(0, nrow = p * p, ncol = 1) # XC storage.mode(xcov) <- "double" storage.mode(counts) <- "double" # XND storage.mode(quan) <- "integer" # IHALF nsamp <- 0 storage.mode(nsamp) <- "integer" # NIT inbest <- matrix(10000, nrow = quan, ncol = 1) # IDSAV storage.mode(inbest) <- "integer" seed <- 0 storage.mode(seed) <- "integer" # MRAND deter <- 0 # DETC storage.mode(deter) <- "double" ierr <- 0 # IERR storage.mode(ierr) <- "integer" mwcd <- .Fortran("fsada", X, n, p, ng, grouping, xmean = xmean, xcov = xcov, counts, quan, nsamp, best = inbest, seed, ierr = ierr, detc = deter, itrace=as.integer(trace), PACKAGE="rrcov") xcov <- mwcd$xcov xmean <- mwcd$xmean dim(xcov) <- c(p, p) dim(xmean) <- c(p,ng) xmean <- t(xmean) dimnames(xcov) <- list(dimn[[2]], dimn[[2]]) dimnames(xmean) <- list(levels(g), dimn[[2]]) ## Compute the consistency correction factor for the raw MCD ## (see calfa in croux and haesbroeck) qalpha <- qchisq(quan/n, p) calphainvers <- pgamma(qalpha/2, p/2 + 1)/(quan/n) calpha <- 1/calphainvers correct <- 1 if(p == 1) { scale <- sqrt(calpha) * as.double(xcov) * sqrt(correct) }else { ## Apply correction factor to the raw estimates and use them to compute weights xcov <- calpha * xcov * correct mah <- mahalanobis(x-xmean[g,], rep(0,p), xcov) weights <- ifelse(mah< qchisq(0.975, p), 1, 0) final.cov <- .wcov.wt(x, g, weights) } ans <- list(call=xcall, raw.means=xmean, raw.wcov=xcov, raw.mah=mah, raw.wt=weights, means=final.cov$means, wcov=final.cov$wcov, covobj=NULL) class(ans) <- "wcov" return(ans) } rrcov/R/CovClassic.R0000644000176200001440000001005313362505240013761 0ustar liggesusers## Just a shortcut and for competability with older versions ## same as CovClassic() ## Cov <- function(x, unbiased = TRUE) { return (CovClassic(x, unbiased)) } CovClassic <- function(x, unbiased = TRUE) { if(is.data.frame(x)) x <- data.matrix(x) else if(!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] ## if(n < p) ## stop("Need at least p=(number of variables) observations ") if(n <= 0) stop("All observations have missing values!") call = match.call() method = "Classical Estimator." ans <- cov.wt(x) nobs <- nrow(x) if(!unbiased) ans$cov <- (ans$cov * (nobs-1))/nobs new("CovClassic", call=call, cov=ans$cov, center=ans$center, n.obs=ans$n.obs, method=method, X=x) } ## VT::17.06.2008 ##setMethod("plot", "CovClassic", function(x, y="missing", setMethod("plot", signature(x="CovClassic", y="missing"), function(x, y="missing", which=c("all", "distance", "qqchi2", "tolEllipsePlot", "screeplot", "pairs"), ask = (which=="all" && dev.interactive(TRUE)), cutoff, id.n, tol = 1e-7, ...) { data <- getData(x) ## parameters and preconditions if(is.vector(data) || is.matrix(data)) { if(!is.numeric(data)) stop( "x is not a numeric dataframe or matrix.") } else if(is.data.frame(data)) { if(!all(sapply(data,data.class) == "numeric")) stop( "x is not a numeric dataframe or matrix.") } n <- dim(data)[1] p <- dim(data)[2] if(length(getCenter(x)) == 0 || length(getCov(x)) == 0) stop( "Invalid object: attributes center and cov missing!") if(length(getCenter(x)) != p) stop( "Data set and provided center have different dimensions!") ## Check for singularity of the cov matrix if(isSingular(x)) stop("The covariance matrix is singular!") if(missing(cutoff)) cutoff <- sqrt(qchisq(0.975, p)) if(!missing(id.n) && !is.null(id.n)) { id.n <- as.integer(id.n) if(id.n < 0 || id.n > n) stop(sQuote("id.n")," must be in {1,..,",n,"}") } ccov <- x rd <- md <- sqrt(getDistance(x)) which <- match.arg(which) op <- if (ask) par(ask = TRUE) else list() on.exit(par(op)) ## index plot of mahalanobis distances if(which == "all" || which == "distance") { .mydistplot(md, cutoff, classic=TRUE, id.n=id.n, ...) } ## qq-plot of the mahalanobis distances versus the ## quantiles of the chi-squared distribution if(which == "all" || which == "qqchi2") { .qqplot(md, p, cutoff=cutoff, classic=TRUE, id.n=id.n, ...) } if(which == "all" || which == "tolEllipsePlot") { if(p == 2) .tolellipse(ccov = x, cutoff=cutoff, id.n=id.n, tol=tol, ...) else if(which != "all") warning("Warning: For tolerance ellipses the dimension must be 2!") } if(which == "tolEllipsePlot" || which == "pairs") { if(which == "tolEllipsePlot" & length(dim(data)) >= 2 && dim(data)[2] == 2){ if(!is.null(rd)){ .tolellipse(rcov=x, cutoff=cutoff, id.n=id.n, tol=tol, ...) } }else if(length(dim(data)) >= 2 && dim(data)[2] <= 10) { .rrpairs(x, ...) }else if(which != "all") warning("Warning: For tolerance ellipses the dimension must be less than 10!") } if(which == "all" || which == "screeplot") { myscreeplot(ccov=x) } }) ## end { plot("CovClassic") } rrcov/R/CovSest.R0000644000176200001440000011332312763517421013332 0ustar liggesusers## TO DO ## ## - 'best', 'exact' and 'deterministic' options for nsamp, as in CovMcd ## CovSest <- function(x, bdp=0.5, arp=0.1, eps=1e-5, maxiter=120, nsamp=500, seed=NULL, trace=FALSE, tolSolve=1e-14, scalefn, maxisteps=200, initHsets = NULL, save.hsets = FALSE, method=c("sfast", "surreal", "bisquare", "rocke", "suser", "sdet"), control, t0, S0, initcontrol ) { ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. method <- match.arg(method) if(!missing(control)){ defcontrol <- CovControlSest() # default control if(bdp == defcontrol@bdp) bdp <- control@bdp # for s-fast and surreal if(arp == defcontrol@arp) arp <- control@arp # for rocke type if(eps == defcontrol@eps) eps <- control@eps # for bisquare and rocke if(maxiter == defcontrol@maxiter) maxiter <- control@maxiter # for bisquare and rocke if(nsamp == defcontrol@nsamp) nsamp <- control@nsamp if(is.null(seed) || seed == defcontrol@seed) seed <- control@seed if(trace == defcontrol@trace) trace <- control@trace if(tolSolve == defcontrol@tolSolve) tolSolve <- control@tolSolve if(method == defcontrol@method) method <- control@method } if(length(seed) > 0) { if(exists(".Random.seed", envir=.GlobalEnv, inherits=FALSE)) { seed.keep <- get(".Random.seed", envir=.GlobalEnv, inherits=FALSE) on.exit(assign(".Random.seed", seed.keep, envir=.GlobalEnv)) } assign(".Random.seed", seed, envir=.GlobalEnv) } if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) xcall <- match.call() ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] if(n <= p + 1) stop(if (n <= p) "n <= p -- you can't be serious!" else "n == p+1 is too small sample size") if(n < 2 * p) { ## p+1 < n < 2p warning("n < 2 * p, i.e., possibly too small sample size") } if(method == "surreal" && nsamp == 500) # default nsamp = 600*p ## compute the constants c1 and kp ## c1 = Tbsc(bdp, p) ## kp = (c1/6) * Tbsb(c1, p) cobj <- .csolve.bw.S(bdp, p) cc <- cobj$cc kp <- cobj$kp if(trace) cat("\nFAST-S...: bdp, p, cc, kp=", bdp, p, cc, kp, "\n") if(missing(scalefn) || is.null(scalefn)) { scalefn <- if(n <= 1000) Qn else scaleTau2 } mm <- if(method == "sfast") ..CSloc(x, nsamp=nsamp, kp=kp, cc=cc, trace=trace) else if(method == "suser") ..fastSloc(x, nsamp=nsamp, kp=kp, cc=cc, trace=trace) else if(method == "surreal") ..covSURREAL(x, nsamp=nsamp, kp=kp, c1=cc, trace=trace, tol.inv=tolSolve) else if(method == "bisquare") ..covSBic(x, arp, eps, maxiter, t0, S0, nsamp, seed, initcontrol, trace=trace) else if(method == "rocke") ..covSRocke(x, arp, eps, maxiter, t0, S0, nsamp, seed, initcontrol, trace=trace) else ..detSloc(x, hsets.init=initHsets, save.hsets=save.hsets, scalefn=scalefn, kp=kp, cc=cc, trace=trace) ans <- new("CovSest", call = xcall, iter=mm$iter, crit=mm$crit, cov=mm$cov, center=mm$center, n.obs=n, iBest=0, cc=mm$cc, kp=mm$kp, X = as.matrix(x), method=mm$method) if(method == "sdet") { ans@iBest <- mm$iBest ans@nsteps <- mm$hset.csteps if(save.hsets) ans@initHsets <- mm$initHsets } ans } ## ## Compute the constants kp and c1 for the Tukey Biweight rho-function for S ## .csolve.bw.S <- function(bdp, p) { ## Compute the constant kp (used in Tbsc) Tbsb <- function(c, p) { ksiint <- function(c, s, p) { (2^s) * gamma(s + p/2) * pgamma(c^2/2, s + p/2)/gamma(p/2) } y1 = ksiint(c,1,p)*3/c - ksiint(c,2,p)*3/(c^3) + ksiint(c,3,p)/(c^5) y2 = c*(1-pchisq(c^2,p)) return(y1 + y2) } ## Compute the tunning constant c1 for the S-estimator with ## Tukey's biweight function given the breakdown point (bdp) ## and the dimension p Tbsc <- function(bdp, p) { eps = 1e-8 maxit = 1e3 cnew <- cold <- sqrt(qchisq(1 - bdp, p)) ## iterate until the change is less than the tollerance or ## max number of iterations reached for(iter in 1:maxit) { cnew <- Tbsb(cold, p)/bdp if(abs(cold - cnew) <= eps) break cold <- cnew } return(cnew) } cc = Tbsc(bdp, p) kp = (cc/6) * Tbsb(cc, p) return(list(cc=cc, kp=kp)) } ## ## A fast procedure to compute an S-estimator similar to the one proposed ## for regression by Salibian-Barrera, M. and Yohai, V.J. (2005), ## "A fast algorithm for S-regression estimates". This current C implemention ## is by Valentin Todorov. ## ## Input: ## x - a data matrix of size (n,p) ## nsamp - number of sub-samples (default=20) ## k - number of refining iterations in each subsample (default=2) ## best.r - number of "best betas" to remember from the subsamples. ## These will be later iterated until convergence (default=5) ## kp, cc - tunning constants for the S-estimator with Tukey's biweight ## function given the breakdown point (bdp) and the dimension p ## ## Output: a list with components ## center - robust estimate of location (vector: length) ## cov - robust estimate of scatter (matrix: p,p) ## crit - value of the objective function (number) ## ..CSloc <- function(x, nsamp=500, kstep=2, best.r=5, kp, cc, trace=FALSE) { dimn <- dimnames(x) if(!is.matrix(x)) x = as.matrix(x) n <- nrow(x) p <- ncol(x) maxit <- 200 # max number of iterations rtol <- 1e-7 # convergence tolerance b <- .C("sest", as.double(x), as.integer(n), as.integer(p), as.integer(nsamp), center = as.double(rep(0,p)), cov = as.double(rep(0,p*p)), scale = as.double(0), as.double(cc), as.double(kp), as.integer(best.r), # number of (refined) to be retained for full iteration as.integer(kstep), # number of refining steps for each candidate as.integer(maxit), # number of (refined) to be retained for full iteration as.double(rtol), converged = logical(1) ) scale <- b$scale center <- b$center cov <- matrix(b$cov, nrow=p) if(scale < 0) cat("\nC function sest() exited prematurely!\n") ## names(b)[names(b) == "k.max"] <- "k.iter" # maximal #{refinement iter.} ## FIXME: get 'res'iduals from C if(!is.null(nms <- dimn[[2]])) { names(center) <- nms dimnames(cov) <- list(nms,nms) } return(list( center=as.vector(center), cov=cov, crit=scale, iter=nsamp, kp=kp, cc=cc, method="S-estimates: S-FAST")) } ## ## A fast procedure to compute an S-estimator similar to the one proposed ## for regression by Salibian-Barrera, M. and Yohai, V.J. (2005), ## "A fast algorithm for S-regression estimates". This version for ## multivariate location/scatter is adapted from the one implemented ## by Kristel Joossens, K.U. Leuven, Belgium ## and Ella Roelant, Ghent University, Belgium. ## ## Input: ## x - a data matrix of size (n,p) ## nsamp - number of sub-samples (default=20) ## k - number of refining iterations in each subsample (default=2) ## best.r - number of "best betas" to remember from the subsamples. ## These will be later iterated until convergence (default=5) ## kp, cc - tunning constants for the S-estimator with Tukey's biweight ## function given the breakdown point (bdp) and the dimension p ## ## Output: a list with components ## center - robust estimate of location (vector: length) ## cov - robust estimate of scatter (matrix: p,p) ## crit - value of the objective function (number) ## ..fastSloc <- function(x, nsamp, k=2, best.r=5, kp, cc, trace=FALSE) { ## NOTES: ## - in the functions rho, psi, and scaledpsi=psi/u (i.e. the weight function) ## is used |x| <= c1 ## ## - function resdis() to compute the distances is used instead of ## mahalanobis() - slightly faster ## The bisquare rho function: ## ## | x^2/2 - x^4/2*c1^2 + x^6/6*c1^4 |x| <= c1 ## rho(x) = | ## | c1^2/6 |x| > c1 ## rho <- function(u, cc) { w <- abs(u) <= cc v <- (u^2/2 * (1 - u^2/cc^2 + u^4/(3*cc^4))) * w + (1-w) * (cc^2/6) v } ## The corresponding psi function: psi = rho' ## ## | x - 2x^3/c1^2 + x^5/c1^4 |x| <= c1 ## psi(x) = | ## | 0 |x| > c1 ## ## using ifelse is 3 times slower psi <- function(u, c1) { ##ifelse(abs(u) < c1, u - 2 * u^3/c1^2 + u^5/c1^4, 0) pp <- u - 2 * u^3/c1^2 + u^5/c1^4 pp*(abs(u) <= c1) } ## weight function = psi(u)/u scaledpsi <- function(u, cc) { ##ifelse(abs(xx) < c1, xx - 2 * xx^3/c1^2 + xx^5/c1^4, 0) pp <- (1 - (u/cc)^2)^2 pp <- pp * cc^2/6 pp*(abs(u) <= cc) } ## the objective function, we solve loss.S(u, s, cc) = b for "s" loss.S <- function(u, s, cc) mean(rho(u/s, cc)) norm <- function(x) sqrt(sum(x^2)) ## Returns square root of the mahalanobis distances of x with respect to mu and sigma ## Seems to be somewhat more efficient than sqrt(mahalanobis()) - by factor 1.4! resdis <- function(x, mu, sigma) { central <- t(x) - mu sqdis <- colSums(solve(sigma, central) * central) dis <- sqdis^(0.5) dis } ## Computes Tukey's biweight objective function (scale) ## (respective to the mahalanobis distances u) using the ## rho() function and the konstants kp and c1 scaleS <- function(u, kp, c1, initial.sc=median(abs(u))/.6745) { ## find the scale, full iterations maxit <- 200 eps <- 1e-20 sc <- initial.sc for(i in 1:maxit) { sc2 <- sqrt(sc^2 * mean(rho(u/sc, c1)) / kp) if(abs(sc2/sc - 1) <= eps) break sc <- sc2 } return(sc) } ## ## Do "k" iterative reweighting refining steps from "initial.mu, initial.sigma" ## ## If "initial.scale" is present, it's used, o/w the MAD is used ## ## k = number of refining steps ## conv = 0 means "do k steps and don't check for convergence" ## conv = 1 means "stop when convergence is detected, or the ## maximum number of iterations is achieved" ## kp and cc = tuning constants of the equation ## re.s <- function(x, initial.mu, initial.sigma, initial.scale, k, conv, kp, cc) { n <- nrow(x) p <- ncol(x) rdis <- resdis(x, initial.mu, initial.sigma) if(missing(initial.scale)) { initial.scale <- scale <- median(abs(rdis))/.6745 } else { scale <- initial.scale } ## if conv == 1 then set the max no. of iterations to 50 magic number alert!!! if(conv == 1) k <- 50 mu <- initial.mu sigma <- initial.sigma for(i in 1:k) { ## do one step of the iterations to solve for the scale scale.super.old <- scale scale <- sqrt(scale^2 * mean(rho(rdis/scale, cc)) / kp) ## now do one step of reweighting with the "improved scale" weights <- scaledpsi(rdis/scale, cc) W <- weights %*% matrix(rep(1,p), ncol=p) xw <- x * W/mean(weights) mu.1 <- apply(xw,2,mean) res <- x - matrix(rep(1,n),ncol=1) %*% mu.1 sigma.1 <- t(res) %*% ((weights %*% matrix(rep(1,p), ncol=p)) * res) sigma.1 <- (det(sigma.1))^(-1/p) * sigma.1 if(.isSingular(sigma.1)) { mu.1 <- initial.mu sigma.1 <- initial.sigma scale <- initial.scale break } if(conv == 1) { ## check for convergence if(norm(mu - mu.1) / norm(mu) < 1e-20) break ## magic number alert!!! } rdis <- resdis(x,mu.1,sigma.1) mu <- mu.1 sigma <- sigma.1 } rdis <- resdis(x,mu,sigma) ## get the residuals from the last beta return(list(mu.rw = mu.1, sigma.rw=sigma.1, scale.rw = scale)) } ################################################################################################ n <- nrow(x) p <- ncol(x) best.mus <- matrix(0, best.r, p) best.sigmas <- matrix(0,best.r*p,p) best.scales <- rep(1e20, best.r) s.worst <- 1e20 n.ref <- 1 for(i in 1:nsamp) { ## Generate a p+1 subsample in general position and compute ## its mu and sigma. If sigma is singular, generate another ## subsample. ## FIXME ---> the singularity check 'det(sigma) < 1e-7' can ## in some cases give TRUE, e.g. milk although ## .isSingular(sigma) which uses qr(mat)$rank returns ## FALSE. This can result in many retrials and thus ## speeding down! ## singular <- TRUE iii <- 0 while(singular) { iii <- iii + 1 if(iii > 10000) { cat("\nToo many singular resamples: ", iii, "\n") iii <- 0 } indices <- sample(n, p+1) xs <- x[indices,] mu <- colMeans(xs) sigma <- cov(xs) ##singular <- det(sigma) < 1e-7 singular <- .isSingular(sigma) } sigma <- det(sigma)^(-1/p) * sigma ## Perform k steps of iterative reweighting on the elemental set if(k > 0) { ## do the refining tmp <- re.s(x=x, initial.mu=mu, initial.sigma=sigma, k=k, conv=0, kp=kp, cc=cc) mu.rw <- tmp$mu.rw sigma.rw <- tmp$sigma.rw scale.rw <- tmp$scale.rw rdis.rw <- resdis(x, mu.rw, sigma.rw) } else { ## k = 0 means "no refining" mu.rw <- mu sigma.rw <- sigma rdis.rw <- resdis(x, mu.rw, sigma.rw) scale.rw <- median(abs(rdis.rw))/.6745 } if(i > 1) { ## if this isn't the first iteration.... ## check whether new mu/sigma belong to the top best results; if so keep ## mu and sigma with corresponding scale. scale.test <- loss.S(rdis.rw, s.worst, cc) if(scale.test < kp) { s.best <- scaleS(rdis.rw, kp, cc, scale.rw) ind <- order(best.scales)[best.r] best.scales[ind] <- s.best best.mus[ind,] <- mu.rw bm1 <- (ind-1)*p; best.sigmas[(bm1+1):(bm1+p),] <- sigma.rw s.worst <- max(best.scales) } } else { ## if this is the first iteration, then this is the best solution anyway... best.scales[best.r] <- scaleS(rdis.rw, kp, cc, scale.rw) best.mus[best.r,] <- mu.rw bm1 <- (best.r-1)*p; best.sigmas[(bm1+1):(bm1+p),] <- sigma.rw } } ## do the complete refining step until convergence (conv=1) starting ## from the best subsampling candidate (possibly refined) super.best.scale <- 1e20 for(i in best.r:1) { index <- (i-1)*p tmp <- re.s(x=x, initial.mu=best.mus[i,], initial.sigma=best.sigmas[(index+1):(index+p),], initial.scale=best.scales[i], k=0, conv=1, kp=kp, cc=cc) if(tmp$scale.rw < super.best.scale) { super.best.scale <- tmp$scale.rw super.best.mu <- tmp$mu.rw super.best.sigma <- tmp$sigma.rw } } super.best.sigma <- super.best.scale^2*super.best.sigma return(list( center=as.vector(super.best.mu), cov=super.best.sigma, crit=super.best.scale, iter=nsamp, kp=kp, cc=cc, method="S-estimates: S-FAST")) } ## ## Computes S-estimates of multivariate location and scatter by the Ruppert's ## SURREAL algorithm using Tukey's biweight function ## data - the data: a matrix or a data.frame ## nsamp - number of random (p+1)-subsamples to be drawn, defaults to 600*p ## kp, c1 - tunning constants for the S-estimator with Tukey's biweight ## function given the breakdown point (bdp) and the dimension p ## ..covSURREAL <- function(data, nsamp, kp, c1, trace=FALSE, tol.inv) { ## --- now suspended --- ## ## Compute the tunning constant c1 for the S-estimator with ## Tukey's biweight function given the breakdown point (bdp) ## and the dimension p vcTukey<-function(bdp, p) { cnew <- sqrt(qchisq(1 - bdp, p)) maxit <- 1000 epsilon <- 10^(-8) error <- 10^6 contit <- 1 while(error > epsilon & contit < maxit) { cold <- cnew kp <- vkpTukey(cold,p) cnew <- sqrt(6*kp/bdp) error <- abs(cold-cnew) contit <- contit+1 } if(contit == maxit) warning(" Maximum iterations, the last values for c1 and kp are:") return (list(c1 = cnew, kp = kp)) } ## Compute the constant kp (used in vcTukey) vkpTukey<-function(c0, p) { c2 <- c0^2 intg1 <- (p/2)*pchisq(c2, (p+2)) intg2 <- (p+2)*p/(2*c2)*pchisq(c2, (p+4)) intg3 <- ((p+4)*(p+2)*p)/(6*c2^2)*pchisq(c2, (p+6)) intg4 <- (c2/6)*(1-pchisq(c2, p)) kp <- intg1-intg2+intg3+intg4 return(kp) } ## Computes Tukey's biweight objective function (scale) ## (respective to the mahalanobis distances dx) scaleS <- function(dx, S0, c1, kp, tol) { S <- if(S0 > 0) S0 else median(dx)/qnorm(3/4) test <- 2*tol rhonew <- NA rhoold <- mean(rhobiweight(dx/S,c1)) - kp while(test >= tol) { delta <- rhoold/mean(psibiweight(dx/S,c1)*(dx/(S^2))) mmin <- 1 control <- 0 while(mmin < 10 & control != 1) { rhonew <- mean(rhobiweight(dx/(S+delta),c1))-kp if(abs(rhonew) < abs(rhoold)) { S <- S+delta control <- 1 }else { delta <- delta/2 mmin <- mmin+1 } } test <- if(mmin == 10) 0 else (abs(rhoold)-abs(rhonew))/abs(rhonew) rhoold <- rhonew } return(abs(S)) } rhobiweight <- function(xx, c1) { lessc1 <- (xx^2)/2-(xx^4)/(2*(c1^2))+(xx^6)/(6*c1^4) greatc1 <- (c1^2)/6 lessc1 * abs(xx=c1) } psibiweight <- function(xx, c1) { (xx - (2*(xx^3))/(c1^2)+(xx^5)/(c1^4))*(abs(xx) ceiling(nsamp*0.2)) { if(l == ceiling(nsamp*(0.5))) laux <- 2 if(l == ceiling(nsamp*(0.8))) laux <- 4 epsilon <- runif(1) epsilon <- epsilon^laux muJ <- epsilon*muJ + (1-epsilon)*mutil covJ <- epsilon*covJ + (1-epsilon)*covtil } covJ <- det(covJ) ^ -mb * covJ md<-sqrt(mahalanobis(data, muJ, covJ, tol.inv=tol.inv)) if(mean(rhobiweight(md/Stil, c1)) < kp) { if(Stil < 5e10) Stil <- scaleS(md, Stil, c1, kp, tol) else Stil <- scaleS(md, 0, c1, kp, tol) mutil <- muJ covtil <- covJ psi <- psibiweight(md, c1*Stil) u <- psi/md ubig <- diag(u) ux <- ubig%*%data muJ <- apply(ux, 2, mean)/mean(u) xcenter <- scale(data, center=muJ,scale=FALSE) covJ <- t(ubig%*%xcenter)%*%xcenter covJ <- det(covJ) ^ -mb * covJ control <- 0 cont <- 1 while(cont < 3 && control != 1) { cont <- cont + 1 md <- sqrt(mahalanobis(data, muJ, covJ, tol.inv=tol.inv)) if(mean(rhobiweight(md/Stil, c1)) < kp) { mutil <- muJ covtil <- covJ control <- 1 if(Stil < 5e10) Stil<-scaleS(md, Stil, c1, kp, tol) else Stil<-scaleS(md, 0, c1, kp, tol) }else { muJ <- (muJ + mutil)/2 covJ <- (covJ + covtil)/2 covJ <- det(covJ) ^ -mb * covJ } } } } covtil <- Stil^2 * covtil return (list(center = mutil, cov = covtil, crit = Stil, iter = nsamp, kp=kp, cc=c1, method="S-estimates: SURREAL") ) } ## ## Compute the S-estimate of location and scatter using the bisquare function ## ## NOTE: this function is equivalent to the function ..covSRocke() for computing ## the rocke type estimates with the following diferences: ## - the call to .iter.rocke() instead of iter.bic() ## - the mahalanobis distance returned by iter.bic() is sqrt(mah) ## ## arp - not used, i.e. used only in the Rocke type estimates ## eps - Iteration convergence criterion ## maxiter - maximum number of iterations ## t0, S0 - initial HBDM estimates of center and location ## nsamp, seed - if not provided T0 and S0, these will be used for CovMve() ## to compute them ## initcontrol - if not provided t0 and S0, initcontrol will be used to compute ## them ## ..covSBic <- function(x, arp, eps, maxiter, t0, S0, nsamp, seed, initcontrol, trace=FALSE){ dimn <- dimnames(x) dx <- dim(x) n <- dx[1] p <- dx[2] method <- "S-estimates: bisquare" ## standarization mu <- apply(x, 2, median) devin <- apply(x, 2, mad) x <- scale(x, center = mu, scale=devin) ## If not provided initial estimates, compute them as MVE ## Take the raw estimates and standardise the covariance ## matrix to determinant=1 if(missing(t0) || missing(S0)){ if(missing(initcontrol)) init <- CovMve(x, nsamp=nsamp, seed=seed) else init <- restimate(initcontrol, x) cl <- class(init) if(cl == "CovMve" || cl == "CovMcd" || cl == "CovOgk"){ t0 <- init@raw.center S0 <- init@raw.cov ## xinit <- cov.wt(x[init@best,]) ## t0 <- xinit$center ## S0 <- xinit$cov detS0 <-det(S0) detS02 <- detS0^(1.0/p) S0 <- S0/detS02 } else{ t0 <- init@center S0 <- init@cov } } ## initial solution center <- t0 cov <- S0 out <- .iter.bic(x, center, cov, maxiter, eps, trace=trace) center <- out$center cov <- out$cov mah <- out$mah iter <- out$iter kp <- out$kp cc <- out$cc mah <- mah^2 med0 <- median(mah) qchis5 <- qchisq(.5,p) cov <- (med0/qchis5)*cov mah <- (qchis5/med0)*mah DEV1 <- diag(devin) center <- DEV1%*%center+mu cov <- DEV1%*%cov%*%DEV1 center <- as.vector(center) crit <- determinant(cov, logarithm = FALSE)$modulus[1] if(!is.null(nms <- dimn[[2]])) { names(center) <- nms dimnames(cov) <- list(nms,nms) } return (list(center=center, cov=cov, crit=crit, method=method, iter=iter, kp=kp, cc=cc, mah=mah) ) } ## ## Compute the S-estimate of location and scatter using Rocke type estimator ## ## see the notes to ..covSBic() ## ..covSRocke <- function(x, arp, eps, maxiter, t0, S0, nsamp, seed, initcontrol, trace=FALSE){ dimn <- dimnames(x) dx <- dim(x) n <- dx[1] p <- dx[2] method <- "S-estimates: Rocke type" ## standarization mu <- apply(x, 2, median) devin <- apply(x, 2, mad) x <- scale(x, center = mu, scale=devin) ## If not provided initial estimates, compute them as MVE ## Take the raw estimates and standardise the covariance ## matrix to determinant=1 if(missing(t0) || missing(S0)){ if(missing(initcontrol)) init <- CovMve(x, nsamp=nsamp, seed=seed) else init <- restimate(initcontrol, x) cl <- class(init) if(cl == "CovMve" || cl == "CovMcd" || cl == "CovOgk"){ t0 <- init@raw.center S0 <- init@raw.cov ## xinit <- cov.wt(x[init@best,]) ## t0 <- xinit$center ## S0 <- xinit$cov detS0 <-det(S0) detS02 <- detS0^(1.0/p) S0 <- S0/detS02 } else{ t0 <- init@center S0 <- init@cov } } ## initial solution center <- t0 cov <- S0 out <- .iter.rocke(x, center, cov, maxiter, eps, alpha=arp, trace=trace) center <- out$center cov <- out$cov mah <- out$mah iter <- out$iter # mah <- mah^2 med0 <- median(mah) qchis5 <- qchisq(.5,p) cov <- (med0/qchis5)*cov mah <- (qchis5/med0)*mah DEV1 <- diag(devin) center <- DEV1%*%center+mu cov <- DEV1%*%cov%*%DEV1 center <- as.vector(center) crit <- determinant(cov, logarithm = FALSE)$modulus[1] if(!is.null(nms <- dimn[[2]])) { names(center) <- nms dimnames(cov) <- list(nms,nms) } return (list(center=center, cov=cov, crit=crit, method=method, iter=iter, kp=0, cc=0, mah=mah) ) } .iter.bic <- function(x, center, cov, maxiter, eps, trace) { stepS <- function(x, b, cc, mah, n, p) { p2 <- (-1/p) w <- w.bi(mah,cc) w.v <- matrix(w,n,p) tn <- colSums(w.v*x)/sum(w) xc <- x-t(matrix(tn,p,n)) vn <- t(xc)%*%(xc*w.v) eii <- eigen(vn, symmetric=TRUE, only.values = TRUE) eii <- eii$values aa <- min(eii) bb <- max(eii) condn <- bb/aa cn <- NULL fg <- TRUE if(condn > 1.e-12) { fg <- FALSE cn <- (det(vn)^p2)*vn } out1 <- list(tn, cn, fg) names(out1) <- c("center", "cov", "flag") return(out1) } scale.full <- function(u, b, cc) { #find the scale - full iterations max.it <- 200 s0 <- median(abs(u))/.6745 s.old <- s0 it <- 0 eps <- 1e-4 err <- eps + 1 while(it < max.it && err > eps) { it <- it+1 s.new <- s.iter(u,b,cc,s.old) err <- abs(s.new/s.old-1) s.old <- s.new } return(s.old) } rho.bi <- function(x, cc) { ## bisquared rho function dif <- abs(x) - cc < 0 ro1 <- (x^2)/2 - (x^4)/(2*(cc^2)) + (x^6)/(6*(cc^4)) ro1[!dif] <- cc^2/6 return(ro1) } psi.bi <- function(x, cc) { ## bisquared psi function dif <- abs(x) - cc < 0 psi1 <- x - (2*(x^3))/(cc^2) + (x^5)/(cc^4) psi1[!dif] <- 0 return(psi1) } w.bi <- function(x, cc) { ## bicuadratic w function dif <- abs(x) - cc < 0 w1 <- 1 - (2*(x^2))/(cc^2) + (x^4)/(cc^4) w1[!dif] <- 0 w1 } s.iter <- function(u, b, cc, s0) { # does one step for the scale ds <- u/s0 ro <- rho.bi(ds, cc) snew <- sqrt(((s0^2)/b) * mean(ro)) return(snew) } ################################################################################## ## main routine for .iter.bic() cc <- 1.56 b <- cc^2/12 dimx <- dim(x) n <- dimx[1] p <- dimx[2] if(trace) cat("\nbisquare.: bdp, p, c1, kp=", 0.5, p, cc, b, "\n") mah <- sqrt(mahalanobis(x, center, cov)) s0 <- scale.full(mah, b, cc) mahst <- mah/s0 ## main loop u <- eps + 1 fg <- FALSE it <- 0 while(u > eps & !fg & it < maxiter) { it <- it + 1 out <- stepS(x, b, cc, mahst, n, p) fg <- out$flag if(!fg) { center <- out$center cov <- out$cov mah <- sqrt(mahalanobis(x, center, cov)) s <- scale.full(mah, b, cc) mahst <- mah/s u <- abs(s-s0)/s0 s0 <- s } } list(center=center, cov=cov, mah=mah, iter=it, kp=b, cc=cc) } .iter.rocke <- function(x, mu, v, maxit, tol, alpha, trace) { rho.rk2 <- function(t, p, alpha) { x <- t z <- qchisq(1-alpha, p) g <- min(z/p - 1, 1) uu1 <- (x <= 1-g) uu2 <- (x > 1-g & x <= 1+g) uu3 <- (x > 1+g) zz <- x x1 <- x[uu2] dd <- ((x1-1)/(4*g))*(3-((x1-1)/g)^2)+.5 zz[uu1] <- 0 zz[uu2] <- dd zz[uu3] <- 1 return(zz) } w.rk2 <- function(t, p, alpha) { x <- t z <- qchisq(1-alpha, p) g <- min(z/p - 1, 1) uu1 <- (x <= (1-g) ) uu2 <- (x > 1-g & x <= 1+g) uu3 <- (x > (1+g)) zz <- x x1 <- x[uu2] dd <- (3/(4*g))*(1-((x1-1)/g)^2) zz[uu1] <- 0 zz[uu2] <- dd zz[uu3] <- 0 return(zz) } disesca <- function(x, mu, v, alpha, delta) { ## calculate square roots of Mahalanobis distances and scale dimx <- dim(x) n <- dimx[1] p <- dimx[2] p2 <- (1/p) p3 <- -p2 maha <- mahalanobisfl(x,mu,v) dis <- maha$dist fg <- maha$flag detv <- maha$det sig <- NULL v1 <- NULL dis1 <- NULL if(!fg) { dis1 <- dis*(detv^p2) v1 <- v*(detv^p3) sig <- escala(p, dis1, alpha, delta)$sig } out <- list(dis=dis1, sig=sig, flag=fg, v=v1) return(out) } fespro <- function(sig, fp, fdis, falpha, fdelta) { z <- fdis/sig sfun <- mean(rho.rk2(z, fp, falpha)) - fdelta return(sfun) } escala <- function(p, dis, alpha, delta) { ## find initial interval for scale sig <- median(dis) a <- sig/100 ff <- fespro(a, p, dis, alpha, delta) while(ff < 0) { a <- a/10 ff <- fespro(a, p, dis, alpha, delta) } b <- sig*10 ff <- fespro(b, p, dis, alpha, delta) while(ff>0) { b <- b*10 ff <- fespro(b, p, dis, alpha, delta) } ## find scale (root of fespro) sig.res <- uniroot(fespro, lower=a, upper=b, fp=p, fdis=dis, falpha=alpha, fdelta=delta) sig <- sig.res$root mens <- sig.res$message ans <- list(sig=sig, message=mens) return(ans) } gradien <- function(x, mu1, v1, mu0, v0, sig0, dis0, sig1, dis1, alpha) { dimx <- dim(x) n <- dimx[1] p <- dimx[2] delta <- 0.5*(1-p/n) decre <- 0. mumin <- mu0 vmin <- v0 dismin <- dis0 sigmin <- sig0 for(i in 1:10) { gamma <- i/10 mu <- (1-gamma)*mu0+gamma*mu1 v <- (1-gamma)*v0+gamma*v1 dis.res <- disesca(x,mu,v,alpha,delta) if(!dis.res$flag) { sigma <- dis.res$sig decre <- (sig0-sigma)/sig0 if(sigma < sigmin) { mumin <- mu vmin <- dis.res$v sigmin <- dis.res$sig dismin <- dis.res$dis } } } ans <- list(mu=mumin, v=vmin, sig=sigmin, dis=dismin) return(ans) } descen1 <- function(x, mu, v, alpha, sig0, dis0) { ## one step of reweighted dimx <- dim(x) n <- dimx[1] p <- dimx[2] p2 <- -(1/p) delta <- 0.5*(1-p/n) daux <- dis0/sig0 w <- w.rk2(daux, p, alpha) w.v <- w %*% matrix(1,1,p) mui <- colSums(w.v * x)/sum(w) xc <- x- (matrix(1,n,1) %*% mui) va <- t(xc) %*% (xc*w.v) disi.res <- disesca(x,mui,va,alpha,delta) if(disi.res$flag) { disi.res$sig <- sig0+1 disi.res$v <- va } disi <- disi.res$dis sigi <- disi.res$sig flagi <- disi.res$flag deti<-disi.res$det vi <- disi.res$v ans <- list(mui=mui, vi=vi, sig=sigi, dis=disi, flag=flagi) return(ans) } invfg <- function(x, tol=1.e-12) { dm <- dim(x) p <- dm[1] y <- svd(x) u <- y$u v <- y$v d <- y$d cond <- min(d)/max(d) fl <- FALSE if(cond < tol) fl <- TRUE det <- prod(d) invx <- NULL if(!fl) invx <- v%*%diag(1/d)%*%t(u) out <- list(inv=invx, flag=fl, det=det) return(out) } mahalanobisfl <- function(x, center, cov, tol=1.e-12) { invcov <- invfg(cov,tol) covinv <- invcov$inv fg <- invcov$flag det1 <- invcov$det dist <- NULL if(!fg) dist <- mahalanobis(x, center, covinv, inverted=TRUE) out <- list(dist=dist, flag=fg, det=det1) return(out) } ################################################################################## ## main routine for .iter.rocke() if(trace) { cat("\nWhich initial t0 and S0 are we using: \n") print(mu) print(v) } dimx <- dim(x) n <- dimx[1] p <- dimx[2] delta <- 0.5*(1-p/n) dis.res <- disesca (x, mu, v, alpha, delta) vmin <- v mumin <- mu sigmin <- dis.res$sig dismin <- dis.res$dis it <- 1 decre <- tol+1 while(decre > tol && it <= maxit) { ## do reweighting des1 <- descen1(x, mumin, vmin, alpha, sigmin, dismin) mu1 <- des1$mui v1 <- des1$vi dis1 <- des1$dis sig1 <- des1$sig decre1 <- (sigmin-sig1)/sigmin if(trace) { cat("\nit, decre1:",it,decre1, "\n") print(des1) } if(decre1 <= tol) { grad <- gradien(x, mu1, v1, mumin, vmin, sigmin, dismin, sig1, dis1, alpha) mu2 <- grad$mu v2 <- grad$v sig2 <- grad$sig dis2<-grad$dis decre2 <- (sigmin-sig2)/sigmin decre <- max(decre1,decre2) if(decre1 >= decre2) { mumin <- mu1 vmin <- v1 dismin <- dis1 sigmin <- sig1 } if(decre1 < decre2) { mumin <- mu2 vmin <- v2 dismin <- dis2 sigmin <- sig2 } } if(decre1 > tol) { decre <- decre1 mumin <- mu1 vmin <- v1 dismin <- dis1 sigmin <- sig1 } it <- it+1 } ans <- list(center=mumin, cov=vmin, scale=sigmin, mah=dismin, iter=it) return(ans) } rrcov/R/da-utils.R0000644000176200001440000000540012763517421013462 0ustar liggesusers.AER <- function(tab) { 1 - sum(tab[row(tab) == col(tab)])/sum(tab) } mtxconfusion <- function(actual, predicted, prior = NULL, printit=FALSE) { .confusion(actual, predicted, prior, printit) } .confusion <- function(actual, predicted, prior = NULL, printit=FALSE) { names <- levels(actual) tab <- table(actual, predicted) acctab <- t(apply(tab, 1, function(x) x/sum(x))) dimnames(acctab) <- list(Actual = names, "Predicted" = names) dimnames(tab) <- list(Actual = names, "Predicted" = names) if(is.null(prior)) { cnt <- table(actual) prior <- cnt/sum(cnt) } else names(prior) <- names AER <- 1 - sum(tab[row(tab) == col(tab)])/sum(tab) if(printit) { prt <- as.matrix(round(c("Apparent error rate" = AER, "Prior frequency" = prior),4)) colnames(prt) <- "" print(prt) cat("\nClassification table", "\n") print(tab) cat("\nConfusion matrix", "\n") print(round(acctab, 3)) } invisible(tab) } ## Internal function to perform leaving-one-out cross validation by brute force - ## recalculates the estimator n times, excluding each observation in turn. ## ## - The discriminantion method (QDA or LDA) is selected according to the type of ## the object. ## - The method for computing the covariance matrices (or the common ## cov matrix in LDA) is selected according the slot methodID. ## .CV <- function(obj){ if(!is(obj, "Lda") && !is(obj, "Qda")) stop("The object must be an Lda or Qda object") classic <- is(obj, "LdaClassic") || is(obj, "QdaClassic") ret <- predict(obj) X <- obj@X grp <- obj@grp ng <- length(levels(grp)) method <- obj@method ptm <- proc.time() n <- nrow(X) p <- ncol(X) if(!classic && n*p > 500) warning("This could take some time!") for(i in 1:n) { cat("i=",i,"\n") ll <- if(is(obj, "LdaClassic")) { LdaClassic(X[-i,], grouping=grp[-i]) } else if(is(obj, "Linda")){ Linda(X[-i,], grouping=grp[-i], method=method, l1med=obj@l1med) } else if(is(obj, "QdaClassic")){ QdaClassic(X[-i,], grouping=grp[-i]) } else if(is(obj, "QdaCov")){ QdaCov(X[-i,], grouping=grp[-i], method=obj@control) } else { stop("ERROR: unknown class") } pp <- predict(ll, newdata=t(X[i,])) ret@classification[i] <- pp@classification[1] ret@posterior[i,] <- pp@posterior[1,] } ret@ct <- mtxconfusion(grp, ret@classification) ## cat("\nElapsed time (loo): ",(proc.time() - ptm)[1],"\n") ret } rrcov/R/Lda.R0000644000176200001440000001015613602443110012426 0ustar liggesuserssetMethod("show", "Lda", function(object){ if(!is.null(cl <- object@call)) { names(cl)[2] <- "" cat("Call:\n") dput(cl) } digits = max(3, getOption("digits") - 3) cat("\nPrior Probabilities of Groups:\n") print(object@prior) if(length(object@center) > 0) { cat("\nGroup means:\n") print(object@center) cat("\nWithin-groups Covariance Matrix:\n") print(object@cov) } cat("\nLinear Coeficients:\n") print(object@ldf) cat("\nConstants:\n") print(object@ldfconst) # svd <- x$svd # names(svd) <- dimnames(x$scaling)[[2]] # if(length(svd) > 1) { # cat("\nProportion of trace:\n") # print(round(svd^2/sum(svd^2), 4), ...) # } invisible(object) }) setMethod("predict", "Lda", function(object, newdata){ ct <- FALSE if(missing(newdata)) { newdata <- object@X # use the training sample ct <- TRUE # perform cross-validation } x <- as.matrix(newdata) if(length(object@center)>0 & ncol(x) != ncol(object@center) | ncol(x) != ncol(object@ldf)) stop("wrong number of variables") ldf <- object@ldf ldfconst <- object@ldfconst ret <- .mypredictLda(object@prior, levels(object@grp), ldf, ldfconst, x) if(ct) ret@ct <- mtxconfusion(object@grp, ret@classification) ret }) .mypredictLda <- function(prior, lev, ldf, ldfconst, x){ ng <- length(prior) nm <- names(prior) if(is.null(nm)) nm <- lev xx <- x %*% t(ldf) xx <- t(t(xx) + ldfconst) posterior <- xx for(i in 1:nrow(xx)){ tmp <- sum(exp(xx[i,])) for(j in 1:ncol(xx)) posterior[i,j] <- exp(xx[i,j])/tmp } cl <- factor(nm[max.col(xx, "first")], levels = lev) new("PredictLda", classification=cl, posterior=posterior, x = xx) } setMethod("show", "PredictLda", function(object){ if(!is.null(object@ct)) { tab <- object@ct acctab <- t(apply(tab, 1, function(x) x/sum(x))) dimnames(acctab) <- dimnames(tab) AER <- 1 - sum(diag(tab))/sum(tab) prt <- as.matrix(round(c("Apparent error rate" = AER),4)) colnames(prt) <- "" print(prt) cat("\nClassification table", "\n") print(tab) cat("\nConfusion matrix", "\n") print(round(acctab, 3)) } else print(object@classification) ## print(object@posterior) ## print(object@x) invisible(object) }) setMethod("summary", "Lda", function(object, ...){ new("SummaryLda", ldaobj=object) }) setMethod("show", "SummaryLda", function(object){ show(object@ldaobj) invisible(object) }) .wcov.wt <- function (x, gr, wt = rep(1, nrow(x))) { xcall <- match.call() if (is.data.frame(x)) x <- as.matrix(x) else if (!is.matrix(x)) stop("'x' must be a matrix or a data frame") if (!all(is.finite(x))) stop("'x' must contain finite values only") n <- nrow(x) p <- ncol(x) lev <- levels(as.factor(gr)) ng <- length(lev) dimn <- dimnames(x) if(with.wt <- !missing(wt)) { if(length(wt) != n) stop("length of 'wt' must equal the number of rows in 'x'") if(any(wt < 0) || (s <- sum(wt)) == 0) stop("weights must be non-negative and not all zero") } sqrtwt <- sqrt(wt) means <- tapply(sqrtwt*x, list(rep(gr, p), col(x)), sum) /rep(tapply(sqrtwt, gr, sum), p) wcov <- crossprod(sqrtwt*(x-means[gr,]))/(sum(sqrtwt)-ng) dimnames(wcov) <- list(dimn[[2]], dimn[[2]]) dimnames(means) <- list(lev, dimn[[2]]) ans <- list(call=xcall, means=means, wcov=wcov, method="Reweighted") class(ans) <- "wcov" ans } print.wcov <- function(x, ...) { if(!is.null(cl <- x$call)) { names(cl)[2] <- "" cat("Call:\n") dput(cl) } cat("\nGroup means:\n") print(x$means, ...) cat("\nWithin-groups Covariance Matrix:\n") print(x$wcov, ...) invisible(x) } rrcov/R/PcaCov.R0000644000176200001440000001576612763517421013133 0ustar liggesuserssetMethod("getQuan", "PcaCov", function(obj) obj@n.obs) ## The S3 version PcaCov <- function (x, ...) UseMethod("PcaCov") PcaCov.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a 'standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaCov.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaCov") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaCov.default <- function(x, k=ncol(x), kmax=ncol(x), cov.control = CovControlMcd(), scale=FALSE, signflip=TRUE, crit.pca.distances=0.975, trace=FALSE, ...) { cl <- match.call() if(missing(x)){ stop("You have to provide at least some data") } data <- as.matrix(x) n <- nrow(data) p <- ncol(data) if(n < p) stop("'PcaCov' can only be used with more units than variables") ## verify and set the input parameters: k and kmax kmax <- max(min(floor(kmax), rankMM(x)),1) if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } ###################################################################### ## ## VT::05.08.2016 ## If scale is TRUE/FALSE, this will be handled by .xpc() ## otherwise call the undocumented function doScale() from robustbase - ## it will behave properly and scale can be a vector or a function if(is.null(scale)) scale <- vector('numeric', p) + 1 else if(!is.logical(scale)) { data <- doScale(data, center=NULL, scale=scale) scale <- data$scale data=data$x } ## VT::30.09.2009 - add the option for classic covariance estimates - if cov.control = NULL covx <- if(!is.null(cov.control)) restimate(cov.control, data) else Cov(data) covmat <- list(cov=getCov(covx), center=getCenter(covx), n.obs=covx@n.obs) ## VT::05.06.2016 -the call to princomp() replaced by an internal function ## it will habdle the case scale=TRUE and will return also the proper scores out <- .xpc(x, covmat=covmat, scale=scale, signflip=signflip) ## VT::11.28.2015: Choose the number of components k (if not specified) ## (see mail of Klaus Nordhausen from 19.11.2015: the help says that the algorithm defines k) ## before it was just k <- min(kmax, p), i.e. k=rank(X) if(k != 0) k <- min(k, p) else { # k <- min(kmax, p) ## ## Find the number of PC 'k' ## Use the test l_k/l_1 >= 10.E-3, i.e. the ratio of ## the k-th eigenvalue to the first eigenvalue (sorted decreasingly) is larger than ## 10.E/3 and the fraction of the cumulative dispersion is larger or equal 80% ## rk <- min(n, p) ev <- out$sdev^2 test <- which(ev/ev[1] <= 1.E-3) k <- if(length(test) != 0) min(min(rk, test[1]), kmax) else min(rk, kmax) cumulative <- cumsum(ev[1:k])/sum(ev) if(cumulative[k] > 0.8) { k <- which(cumulative >= 0.8)[1] } if(trace) cat("\n k, kmax, rank, p: ", k, kmax, rk, p, "\n") if(trace) cat("The number of principal components is defined by the algorithm. It is set to ", k,".\n", sep="") } center <- getCenter(covx) scale <- out$scale sdev <- out$sdev loadings <- out$loadings[, 1:k, drop=FALSE] eigenvalues <- (sdev^2)[1:k] scores <- out$scores[, 1:k, drop=FALSE] ###################################################################### names(eigenvalues) <- NULL if(is.list(dimnames(x))) { rownames(scores) <- rownames(x) # dimnames(scores)[[1]] <- dimnames(data)[[1]] }else dimnames(scores)[[1]] <- 1:n dimnames(scores)[[2]] <- paste("PC", seq_len(ncol(scores)), sep = "") dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) ## fix up call to refer to the generic, but leave arg name as 'formula' cl[[1]] <- as.name("PcaCov") res <- new("PcaCov", call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=scale, scores=scores, k=k, n.obs=n) ## Compute distances and flags res <- pca.distances(res, x, p, crit.pca.distances) return(res) } ## A simplified version of princomp() .xpc <- function (x, covmat, scale=FALSE, signflip=FALSE) { ## x is always available and covmat is always a list ## scores is always TRUE (therefore we need x) ## if (any(is.na(match(c("cov", "n.obs"), names(covmat))))) stop("'covmat' is not a valid covariance list") cv <- covmat$cov n.obs <- covmat$n.obs cen <- covmat$center if(!is.numeric(cv)) stop("PCA applies only to numerical variables") cor <- FALSE if(is.logical(scale)) { if(scale) { cor <- TRUE sds <- sqrt(diag(cv)) if(any(sds == 0)) stop("cannot use 'cor = TRUE' with a constant variable") cv <- cv/(sds %o% sds) } } edc <- eigen(cv, symmetric = TRUE) ev <- edc$values if(any(neg <- ev < 0)) { if(any(ev[neg] < -9 * .Machine$double.eps * ev[1L])) stop("covariance matrix is not non-negative definite") else ev[neg] <- 0 } if(signflip) edc$vectors <- .signflip(edc$vectors) cn <- paste0("PC", 1L:ncol(cv)) names(ev) <- cn dimnames(edc$vectors) <- list(dimnames(x)[[2L]], cn) sdev <- sqrt(ev) sc <- setNames(if(cor) sds else if(!is.logical(scale)) scale else rep.int(1, ncol(cv)), colnames(cv)) scr <- as.matrix(doScale(x, center=cen, scale=sc)$x) %*% edc$vectors dimnames(scr) <- list(dimnames(x)[[1L]], cn) edc <- list(sdev=sdev, loadings=structure(edc$vectors, class="loadings"), center=cen, scale=sc, n.obs=n.obs, scores=scr) class(edc) <- "princomp" edc } rrcov/R/Cov.R0000644000176200001440000001331313372572244012472 0ustar liggesuserssetMethod("names", "Cov", function(x) slotNames(x)) setMethod("$", "Cov", function(x, name) slot(x, name)) ## setMethod("$<-", "Cov", function(x, name, value) {slot(x, name) <- value; slot(x, name)} ) setMethod("isClassic", "Cov", function(obj) TRUE) setMethod("isSingular", "Cov", function(obj) .isSingular(getCov(obj))) ## Here we want to add some getters/setters (i.e. accessor methods). ## The first problem is a name clash: in R the accessors are usually ## named as the member variables(slots); ## we need a generic with this name; if there is a function with ## this name, it will not work (other signature for example) - ## like in the example below with cov ## slot: cov ## generic: cov(object), method: cov(object) ## x <- cov(object) ## cov(object) <- x ## An alternative would be the way it is done in Java: ## getCov(object), setCov(object, matrix) ## ## setMethod("getCenter", "Cov", function(obj) obj@center) setMethod("getCov", "Cov", function(obj) obj@cov) setMethod("getCorr", "Cov", function(obj) cov2cor(obj@cov)) setMethod("getData", "Cov", function(obj) obj@X) setMethod("getEvals", "Cov", function(obj) eigen(getCov(obj), symmetric=TRUE, only.values=TRUE)$values) setMethod("getDistance", "Cov", function(obj){ if(!is(obj@mah,"NULL")) return(obj@mah) if(is(getData(obj), "NULL")) stop("Cannot compute distances: no data provided") dd <- mahalanobis(obj@X, obj@center, obj@cov) ## check if the method is called on an object - i.e. cc=CovMcd(xxx); getDistance(cc) ## or on the constructor call - i.e. getDistance(CovMcd(xxx)) ## Do nothing in the second case ## Our expression is 'obj@mah <- dd' and the parse tree is ## (as a string array) will be c("<-", "obj@mah", "dd") ## We are interested if there are () in the second element ## expr <- substitute(obj@mah <- dd) ss <- as.character(expr) if(length(grep(pattern="(", x=ss[2], fixed=TRUE)) == 0) eval.parent(expr) return(dd) }) setMethod("getDet", "Cov", function(obj){ if(obj@det > 0) return(obj@det) dd <- if(isSingular(obj)) 0 else det(obj@cov) ## check if the method is called on an object - i.e. cc=CovMcd(xxx); getDet(cc) ## or on the constructor call - i.e. getDet(CovMcd(xxx)) ## Do nothing in the second case ## Our expression is 'obj@det <- dd' and the parse tree is ## (as a string array) will be c("<-", "obj@det", "dd") ## We are interested if there are () in the second element ## expr <- substitute(obj@det <- dd) ss <- as.character(expr) if(length(grep(pattern="(", x=ss[2], fixed=TRUE)) == 0) eval.parent(expr) return(dd) }) setMethod("getShape", "Cov", function(obj){ p <- ncol(getCov(obj)) return(if((dd <- getDet(obj)) > 0) dd^(-1/p)*getCov(obj) else getCov(obj)) }) setMethod("getFlag", "Cov", function(obj, prob=0.975){ if(!is(obj@flag,"NULL") && missing(prob)) return(obj@flag) p <- ncol(getCov(obj)) ## dd <- getDistance(obj) if(!is(obj@mah,"NULL")) dd <- obj@mah else if(is(getData(obj), "NULL")) stop("Cannot compute distances: no data provided") else dd <- mahalanobis(obj@X, obj@center, obj@cov) chi <- qchisq(prob, p) fl <- sqrt(dd) < sqrt(chi) ## check if the method is called on an object - i.e. cc=CovMcd(xxx); getFlag(cc) ## or on the constructor call - i.e. getFlag(CovMcd(xxx)) ## Do nothing in the second case ## Our expression is 'obj@flag <- fl' and the parse tree is ## (as a string array) will be c("<-", "obj@flag", "fl") ## We are interested if there are () in the second element ## expr <- substitute(obj@flag <- fl) ss <- as.character(expr) if(length(grep(pattern="(", x=ss[2], fixed=TRUE)) == 0) eval.parent(expr) return(fl) }) ## ## Follow the standard methods: show, summary, plot ## setMethod("show", "Cov", function(object){ cat("\nCall:\n") print(object@call) cat("-> Method: ", object@method, "\n") if(is.list(object@singularity)) cat(strwrap(.MCDsingularityMsg(object@singularity, object@n.obs)), sep ="\n") digits = max(3, getOption("digits") - 3) cat("\nEstimate of Location: \n") print.default(format(object@center, digits = digits), print.gap = 2, quote = FALSE) cat("\nEstimate of Covariance: \n") print.default(format(object@cov, digits = digits), print.gap = 2, quote = FALSE) invisible(object) }) setMethod("summary", "Cov", function(object, ...){ new("SummaryCov", covobj=object, evals=eigen(object@cov)$values) }) setMethod("isClassic", "SummaryCov", function(obj) TRUE) setMethod("getCenter", "SummaryCov", function(obj) getCenter(obj@covobj)) setMethod("getCov", "SummaryCov", function(obj) getCov(obj@covobj)) setMethod("getDistance", "SummaryCov", function(obj) getDistance(obj@covobj)) setMethod("getEvals", "SummaryCov", function(obj) obj@evals) setMethod("show", "SummaryCov", function(object){ cat("\nCall:\n") print(object@covobj@call) digits = max(3, getOption("digits") - 3) cat("\nEstimate of Location: \n") print.default(format(getCenter(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nEstimate of Covariance: \n") print.default(format(getCov(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nEigenvalues of covariance matrix: \n") print.default(format(getEvals(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nMahalanobis Distances: \n") print.default(format(as.vector(getDistance(object)), digits = digits), print.gap = 2, quote = FALSE) }) rrcov/R/CovSde.R0000644000176200001440000001266112763517421013132 0ustar liggesusersCovSde <- function(x, nsamp, maxres, tune=0.95, eps=0.5, prob=0.99, seed=NULL, trace=FALSE, control) { ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. if(!missing(control)){ defcontrol <- CovControlSde() # default control ## no default if(nsamp == defcontrol@nsamp) nsamp <- control@nsamp ## no default if(maxres == defcontrol@maxres) maxres <- control@maxres if(tune == defcontrol@tune) tune <- control@tune if(eps == defcontrol@eps) eps <- control@eps if(prob == defcontrol@prob) prob <- control@prob if(is.null(seed) || seed == defcontrol@seed) seed <- control@seed if(trace == defcontrol@trace) trace <- control@trace } if(length(seed) > 0) { if(exists(".Random.seed", envir=.GlobalEnv, inherits=FALSE)) { seed.keep <- get(".Random.seed", envir=.GlobalEnv, inherits=FALSE) on.exit(assign(".Random.seed", seed.keep, envir=.GlobalEnv)) } assign(".Random.seed", seed, envir=.GlobalEnv) } if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) xcall <- match.call() ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] if(missing(nsamp)) nsamp <- ceiling(log(1 - prob)/log(1 - (1 - eps)^(p+1))) else if(!is.numeric(nsamp)) stop("If present, nsamp must be a nonnegative integer or") if(nsamp != 0) nsamp <- max(1000, nsamp) nsamp <- min(nsamp, .Machine$integer.max) if(missing(maxres)) maxres <- 2 * nsamp else if(!is.numeric(maxres)) stop(sQuote("maxres"), " is not a positive integer") maxres <- min(maxres, .Machine$integer.max) tune <- sqrt(qchisq(tune, p)) if(n <= p + 1) stop(if (n <= p) "n <= p -- you can't be serious!" else "n == p+1 is too small sample size") if(n < 2 * p) { ## p+1 < n < 2p warning("n < 2 * p, i.e., possibly too small sample size") } ## Prepare for calling the Fortran function icent <- 1 locat <- double(p) covmat <- matrix(0.0, p, p) storage.mode(covmat) <- "double" wk <- double(4*n+p) iwork <- integer(4*n+p) nresper <- 0 w <- double(n) z <- double(n) ## We are ignoring the 'center' parameter in the original function in 'robust'- ## center = TRUE - estimate center simultaneously with cov ## center = FALSE - assume the data are centered, i.e. center = rep(0,p) ## center = vector of length p - sweep center from the data ## ## if(length(center) == 1 && !center) ## center <- rep(0, p) ## ## if(length(center) > 1) ## { ## if(length(center) != p) ## stop("the dimension of ", sQuote("center"), " does not match the ", "dimension of ", sQuote("x")) ## x <- sweep(x, 2, center) ## icent <- 0 ## } ## sdlist <- .Fortran("rlds", n = as.integer(n), p = as.integer(p), nsamp = as.integer(nsamp), x = as.double(x), tune = as.double(tune), wk = as.double(wk), center = as.double(locat), cov = covmat, maxres = as.integer(maxres), nresper = as.integer(nresper), weights = as.double(w), outlyingness = as.double(z), icent = as.integer(icent), iwork = as.integer(iwork), PACKAGE = "rrcov") ## again skipping the predefined center ## ## dist <- mahalanobis(x, ## center = if(length(center) > 1) rep(0, p) else sdlist$center, ## cov = sdlist$cov) center <- sdlist$center cov <- sdlist$cov mah <- mahalanobis(x, center=center, cov=cov) consistency.correction <- median(mah) / qchisq(.5, p) ## cat("\nconsistency correction factor: ", consistency.correction, "\n") cov <- cov * consistency.correction mah <- mah / consistency.correction ## if(length(center) > 1) ## sdlist$center <- center ## sdlist[c("cov", "center", "dist")] nms <- dimn[[2]] if(is.null(nms)) nms <- paste("V", 1:p, sep = "") names(center) <- nms dimnames(cov) <- list(nms,nms) ans <- new("CovSde", call = xcall, iter=sdlist$nresper, # actual subsamples performed crit=0, cov=cov, center=center, mah=mah, n.obs=n, wt=sdlist$weights, X = as.matrix(x), method="Stahel-Donoho estimator") ans } rrcov/R/CovControl.R0000644000176200001440000001070013563632016014024 0ustar liggesusersCovControlMcd <- function (alpha=0.5, nsamp=500, scalefn=NULL, maxcsteps=200, seed=NULL, trace=FALSE, use.correction=TRUE) { new("CovControlMcd", alpha = alpha, nsamp = nsamp, scalefn=scalefn, maxcsteps=maxcsteps, seed = seed, trace = trace, use.correction = use.correction) } setMethod("restimate", "CovControlMcd", function(obj, x, ...) CovMcd(x, control = obj, ...) ) CovControlMrcd <- function (alpha=0.5, h=NULL, maxcsteps=200, rho=NULL, target=c("identity", "equicorrelation"), maxcond=50, trace=FALSE) { new("CovControlMrcd", alpha = alpha, h=h, maxcsteps=maxcsteps, rho=rho, target=match.arg(target), maxcond=maxcond, trace = trace) } setMethod("restimate", "CovControlMrcd", function(obj, x, ...) CovMrcd(x, control = obj, ...) ) CovControlMest <- function (r = 0.45, arp = 0.05, eps=1e-3, maxiter=120 ) { new("CovControlMest", r = r, arp = arp, eps=eps, maxiter=maxiter) } setMethod("restimate", "CovControlMest", function(obj, x, ...) CovMest(x, control = obj, ...) ) CovControlOgk <- function (niter=2, beta=0.90, mrob=NULL, vrob=.vrobGK, smrob="scaleTau2", svrob="gk" ) { new("CovControlOgk", niter=niter, beta=beta, mrob=mrob, vrob=vrob, smrob=smrob, svrob=svrob) } setMethod("restimate", "CovControlOgk", function(obj, x, ...) CovOgk(x, control = obj, ...) ) CovControlMve <- function (alpha=0.5, nsamp=500, seed=NULL, trace=FALSE) { new("CovControlMve", alpha = alpha, nsamp = nsamp, seed = seed, trace = trace) } setMethod("restimate", "CovControlMve", function(obj, x, ...) CovMve(x, control = obj, ...) ) ## Moved to AllClassess - should precede the definition of class CovMMest, ## since used in the prototype ## ##CovControlSest <- function (bdp=0.5, ## arp=0.1, ## eps=1e-5, ## maxiter=120, ## nsamp=500, ## seed=NULL, ## trace=FALSE, ## tolSolve=1e-14, ## method="sfast") ##{ ## new("CovControlSest", bdp=bdp, arp=arp, eps=eps, maxiter=maxiter, ## nsamp=nsamp, seed=seed, trace=trace, tolSolve=tolSolve, method=method) ##} ## setMethod("restimate", "CovControlSest", function(obj, x, ...) CovSest(x, control = obj, ...) ) CovControlSde <- function (nsamp=0, maxres=0, tune=0.95, eps=0.5, prob=0.99, seed=NULL, trace=FALSE, tolSolve=1e-14) { new("CovControlSde", nsamp=nsamp, maxres=maxres, tune=tune, eps=eps, prob=prob, seed=seed, trace=trace, tolSolve=tolSolve) } setMethod("restimate", "CovControlSde", function(obj, x, ...) CovSde(x, control = obj, ...) ) CovControlMMest <- function (bdp=0.5, eff=0.95, maxiter=50, sest=CovControlSest(), trace=FALSE, tolSolve=1e-7) { new("CovControlMMest", bdp=bdp, eff=eff, maxiter=maxiter, sest=sest, trace=trace, tolSolve=tolSolve) } setMethod("restimate", "CovControlMMest", function(obj, x, ...) CovMMest(x, control = obj, ...) ) rrcov/R/PcaGrid.R0000644000176200001440000000677412763517421013270 0ustar liggesuserssetMethod("getQuan", "PcaGrid", function(obj) obj@n.obs) ## The S3 version PcaGrid <- function (x, ...) UseMethod("PcaGrid") PcaGrid.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a 'standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaGrid.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaGrid") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaGrid.default <- function(x, k=0, kmax=ncol(x), scale=FALSE, na.action = na.fail, crit.pca.distances=0.975, trace=FALSE, ...) { cl <- match.call() if(missing(x)){ stop("You have to provide at least some data") } data <- as.matrix(x) n <- nrow(data) p <- ncol(data) ## ## verify and set the input parameters: k and kmax ## kmax <- max(min(floor(kmax), rankMM(x)),1) if(trace) cat("k=", k, ", kmax=", kmax, ".\n", sep="") if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } if(k != 0) k <- min(k, ncol(data)) else { k <- min(kmax, ncol(data)) if(trace) cat("The number of principal components is defined by the algorithm. It is set to ", k,".\n", sep="") } ###################################################################### if(is.logical(scale)) { scale <- if(scale) sd else NULL } out <- PCAgrid(x, k, scale=scale, trace=-1, ...) scores <- predict(out) center <- out$center scale <- out$scale sdev <- out$sdev scores <- as.matrix(scores[, 1:k]) loadings <- as.matrix(out$loadings[, 1:k]) eigenvalues <- (sdev^2)[1:k] ###################################################################### names(eigenvalues) <- NULL if(is.list(dimnames(data))) rownames(scores) <- rownames(data) # dimnames(scores)[[1]] <- dimnames(data)[[1]] dimnames(scores)[[2]] <- paste("PC", seq_len(ncol(scores)), sep = "") dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaGrid") res <- new("PcaGrid", call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=scale, scores=scores, k=k, n.obs=n) ## Compute distances and flags res <- pca.distances(res, x, p, crit.pca.distances) return(res) } rrcov/R/LdaClassic.R0000644000176200001440000001143713567531733013756 0ustar liggesusers## The S3 version LdaClassic <- function (x, ...) UseMethod("LdaClassic") LdaClassic.formula <- function(formula, data, ..., subset, na.action) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- LdaClassic.default(x, grouping, ...) ## res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as `formula' cl <- match.call() cl[[1]] <- as.name("LdaClassic") res@call <- cl ## res$contrasts <- attr(x, "contrasts") ## res$xlevels <- .getXlevels(Terms, m) ## res$na.action <- attr(m, "na.action") res } LdaClassic.default <- function(x, grouping, prior = proportions, tol = 1.0e-4, ...) { if(is.null(dim(x))) stop("x is not a matrix") xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) if(length(grouping) == 1) { # this is the number of groups and the groups are of equal size ng = grouping ni = n/ng if(ng*ni < n) stop("nrow(x) is not divisible by the number of groups") grouping <- rep(0,0) for(i in 1:ng) grouping <- c(grouping, rep(i,ni)) }else if(length(grouping) > 1 && length(grouping) < n) { # grouping contains a vector with the group sizes ng <- length(grouping) if(sum(grouping) != n) stop("nrow(x) is not equal to n1+n2+...+nn") gx <- rep(0,0) for(i in 1:ng) gx <- c(gx, rep(i,grouping[i])) grouping <- gx } if(n != length(grouping)) stop("nrow(x) and length(grouping) are different") g <- as.factor(grouping) lev <- lev1 <- levels(g) counts <- as.vector(table(g)) if(!missing(prior)) { if(any(prior < 0) || round(sum(prior), 5) != 1) stop("invalid prior") if(length(prior) != nlevels(g)) stop("prior is of incorrect length") prior <- prior[counts > 0] } if(any(counts == 0)) { warning(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) lev1 <- lev[counts > 0] g <- factor(g, levels=lev1) counts <- as.vector(table(g)) } proportions <- counts/n ng <- length(proportions) names(g) <- NULL names(prior) <- levels(g) xcov <- .wcovClass(x, grouping) ## VT::27.11.2019 ## inv <- solve(xcov$wcov) inv <- if(!.isSingular(xcov$wcov)) solve(xcov$wcov) else .pinv(xcov$wcov) ldf <- xcov$means %*% inv ldfconst <- diag(log(prior) - ldf %*% t(xcov$means)/2) return (new("LdaClassic", call=xcall, prior=prior, counts=counts, center=xcov$means, cov=xcov$wcov, ldf = ldf, ldfconst = ldfconst, method="Linear Discriminant Analysis (LDA)", X=x, grp=g)) } .wcovClass <- function(x, grouping, method = c("A", "B")){ xcall <- match.call() method <- match.arg(method) x <- as.matrix(x) n <- nrow(x) p <- ncol(x) dimn <- dimnames(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts/n) # compute group means and covariance matrices for each group mX <- matrix(0,ng,p) covX <- array(0,c(p,p,ng)) for(i in 1:ng){ tmpc <- cov.wt(as.matrix(x[which(g == lev[i]),])) mX[i,] <- tmpc$center covX[,,i] <- tmpc$cov } if(method == "A"){ #Method A: pool the covariance matrices wcov <- matrix(0,p,p) for(i in 1:ng){ wcov <- wcov + (counts[i]-1)*covX[,,i] } wcov <- wcov/(n-ng) }else if(method == "B"){ #Method B: center the data and compute the covariance matrix #of the centered data tmpc <- cov.wt(x - mX[g,]) tmpc$cov <- tmpc$cov*(n-1)/(n-ng) # Add tmpc$center to mX ->mB wcov <- tmpc$cov }else if(method == "C"){ stop("Method C not defined for classical estimates") }else{ stop("Unknown method specified: ", method) } dimnames(wcov) <- list(dimn[[2]], dimn[[2]]) dimnames(mX) <- list(levels(g), dimn[[2]]) ans <- list(call=xcall, means=mX, wcov=wcov, method="MLE") class(ans) <- "wcov" return(ans) } rrcov/R/plot-utils.R0000644000176200001440000005402413607355612014062 0ustar liggesusers###### ## VT::14.01.2020 ## ## ## roxygen2::roxygenise("C:/projects/statproj/R/rrcov") ## #' Calculates the points for drawing a confidence ellipsoid #' #' @description A simple function to calculate the points of #' a confidence ellipsoid, by default \code{dist=qchisq(0.975, 2)} #' @param loc location vector #' @param cov a \code{pXp} covariance matrix #' @param crit the confidence level, default is \code{crit=0.975} #' @return A matrix with two columns containing the calculated points. #' #' @examples #' #' data(hbk) #' cc <- cov.wt(hbk) #' e1 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2]) #' e2 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2], crit=0.99) #' plot(X2~X1, data=hbk, #' xlim=c(min(X1, e1[,1], e2[,1]), max(X1,e1[,1], e2[,1])), #' ylim=c(min(X2, e1[,2], e2[,2]), max(X2,e1[,2], e2[,2]))) #' lines(e1, type="l", lty=1, col="red") #' lines(e2, type="l", lty=2, col="blue") #' legend("topleft", legend=c(0.975, 0.99), lty=1:2, col=c("red", "blue")) #' #' @export #' @author Valentin Todorov, \email{valentin.todorov@@chello.at} #' getEllipse <- function(loc=c(0, 0), cov=matrix(c(1,0,0,1), ncol=2), crit=0.975) { ## A simple function to calculate the points of a confidence ellipsoid, ## by default \code{dist=qchisq(0.975, 2)} ## input: data set location and covariance estimate, cutoff if (length(d <- dim(cov)) != 2 || (p <- d[1]) != d[2]) stop("'cov' must be p x p cov-matrix defining an ellipsoid") dist <- sqrt(qchisq(crit, p)) A <- solve(cov) eA <- eigen(A) ev <- eA$values lambda1 <- max(ev) lambda2 <- min(ev) eigvect <- eA$vectors[, order(ev)[2]] z <- seq(0, 2 * pi, by = 0.01) z1 <- dist/sqrt(lambda1) * cos(z) z2 <- dist/sqrt(lambda2) * sin(z) alfa <- atan(eigvect[2]/eigvect[1]) r <- matrix(c(cos(alfa), - sin(alfa), sin(alfa), cos(alfa)), ncol = 2) z <- t(t(cbind(z1, z2) %*% r) + loc) # xmin <- min(x, z[, 1]) z } ## Internal class defining a default legend parameters to be used ## in plots with both robust and classical lines in the same panel ## (e.g. scree plot, tolerance ellipses) setClass(".Legend", representation( leg = "logical", # whether to draw a legend pos = "character", # position of the legend txt = "vector", # texts col = "vector", # colors lty = "vector", # line styles pch = "vector"), # characters prototype = list(leg = TRUE, pos = "topright", txt = c("robust", "classical"), col = c("red", "blue"), lty = c("solid", "dotted"), pch = c(1,24))) myscreeplot <- function(rcov, ccov) { .myscreeplot(rcov, ccov) } .myscreeplot <- function(rcov, ccov) { er <- NULL ec <- NULL ee <- NULL if(!missing(ccov)) ee <- ec <- getEvals(ccov) if(!missing(rcov)) ee <- er <- getEvals(rcov) if(is.null(ee)) stop("Both parameters are NULL") leg <- new(".Legend") eall <- if(!is.null(ec) && !is.null(er)) c(er, ec) else if(!is.null(ec)) ec else er ylim <- c(min(eall), max(eall)) plot(ee, ylim=ylim, ylab="Eigenvalues", xlab="Index", type="n") if(!is.null(ec) && !is.null(er)) legend(leg@pos, leg@txt, pch = leg@pch, lty = leg@lty, col = leg@col) if(!is.null(er)) lines(er, type="o", pch = leg@pch[1], lty = leg@lty[1], col=leg@col[1]) if(!is.null(ec)) lines(ec, type="o", pch = leg@pch[2], lty = leg@lty[2], col=leg@col[2]) title(main="Scree plot") } .myddplot <- function(md, rd, cutoff, id.n, main="Distance-Distance Plot", xlab="Mahalanobis distance", ylab="Robust distance", labs=1:length(md), ...) { ## Distance-Distance Plot: ## Plot the vector y=rd (robust distances) against ## x=md (mahalanobis distances). Identify by a label the id.n ## observations with largest rd. If id.n is not supplied, calculate ## it as the number of observations larger than cutoff. Use cutoff ## to draw a horisontal and a vertical line. Draw also a dotted line ## with a slope 1. n <- length(md) if(missing(id.n)) id.n <- length(which(rd>cutoff)) plot(md, rd, xlab=xlab, ylab=ylab, type="p", ...) .label(md,rd,id.n, labs=labs) abline(0, 1, lty=2) abline(v=cutoff) abline(h=cutoff) title(main=main) } .mydistplot <- function(x, cutoff, classic = FALSE, id.n, ylim=NULL, main="Distance Plot", xlab="Index", ylab=paste(if(classic) "Mahalanobis" else "Robust", "distance"), labs=1:length(x), ...) { ## VT::10.11.2007 - change "Squared Robust distance" to "Robust distance" ## VT::10.11.2007 - Add parameter ylim to make possible robust and ## classical plot to use the same y-scale ## Index Plot: ## Plot the vector x (robust or mahalanobis distances) against ## the observation indexes. Identify by a label the id.n ## observations with largest value of x. If id.n is not supplied, ## calculate it as the number of observations larger than cutoff. ## Use cutoff to draw a horisontal line. ## Use classic=FALSE/TRUE to choose the label of the vertical axes n <- length(x) if(missing(id.n)) id.n <- length(which(x>cutoff)) plot(x, ylab=ylab, xlab=xlab, type="p", ylim=ylim, ...) .label(1:n, x, id.n, labs=labs) abline(h=cutoff) title(main=main) } .qqplot <- function(x, p, cutoff, classic=FALSE, id.n, main=eval(substitute(expression(paste(chi^2, " QQ-Plot")))), xlab=eval(substitute(expression(paste("Sqrt of the quantiles of the ", chi^2, " distribution")))), ylab=paste(if(classic) "Mahalanobis" else "Robust", "distance"), labs=1:length(x), ...) { ## Chisquare QQ-Plot: ## Plot the vector x (robust or mahalanobis distances) against ## the square root of the quantiles of the chi-squared distribution ## with p degrees of freedom. ## Identify by a label the id.n observations with largest value of x. ## If id.n is not supplied, calculate it as the number of observations ## larger than cutoff. ## Use classic=FALSE/TRUE to choose the label of the vertical axes ## parameters and preconditions n <- length(x) if(missing(cutoff)) cutoff <- sqrt(qchisq(0.975, p)) if(missing(id.n)) id.n <- length(which(x>cutoff)) qq <- sqrt(qchisq(((1:n)-1/3)/(n+1/3), p)) x <- sort(x, index.return=TRUE) ix <- x$ix x <- x$x ## xlab <- "Square root of the quantiles of the chi-squared distribution" plot(qq, x, xlab=xlab, ylab=ylab, type="p", ...) if(id.n > 0) { ind <- (n-id.n+1):n xrange <- par("usr") xrange <- xrange[2] - xrange[1] text(qq[ind] + xrange/50, x[ind], labs[ix[ind]]) } abline(0, 1, lty=2) title(main=main) } .label <- function(x, y, id.n=3, labs=1:length(x)) { if(id.n > 0) { xrange <- par("usr") xrange <- xrange[2] - xrange[1] n <- length(y) ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] text(x[ind] + xrange/50, y[ind], labs[ind]) } } .tolellipse <- function(rcov, ccov, cutoff = NULL, id.n = NULL, tol = 1e-07, main = "Tolerance ellipse (97.5%)", xlab = "", ylab = "", labs, ...) { leg <- new(".Legend") if(missing(rcov) || is.null(rcov)){ if(missing(ccov) || is.null(ccov)) stop("Location and scatter matrix must be provided!") ## there is no robust location/scatter object rcov <- ccov leg@leg <- FALSE } if(is.null(data <- getData(rcov))) stop("No data provided!") n <- dim(data)[1] p <- dim(data)[2] if(p != 2) stop("Dimension must be 2!") r.cov <- getCov(rcov) r.loc <- getCenter(rcov) if(length(r.loc) == 0 || length(r.cov) == 0) stop("Invalid 'rcov' object: attributes center and cov missing!") z1 <- getEllipse(loc = r.loc, cov = r.cov) rd <- sqrt(getDistance(rcov)) x1 <- c(min(data[, 1], z1[, 1]), max(data[,1],z1[,1])) y1 <- c(min(data[, 2], z1[, 2]), max(data[,2],z1[,2])) classic <- FALSE if(!missing(ccov) && !is.null(ccov)){ c.cov <- getCov(ccov) c.loc <- getCenter(ccov) if(length(c.loc) == 0 || length(c.cov) == 0) stop("Invalid 'ccov' object: attributes center and cov missing!") classic <- TRUE z2 <- getEllipse(loc=c.loc, cov=c.cov) md <- sqrt(getDistance(ccov)) x1 <- c(min(data[, 1], z1[, 1], z2[, 1]), max(data[,1],z1[,1], z2[,1])) y1 <- c(min(data[, 2], z1[, 2], z2[, 2]), max(data[,2],z1[,2], z2[,2])) } ## Note: the *calling* function may pass a 'missing' value if(missing(cutoff) || is.null(cutoff)) cutoff <- sqrt(qchisq(0.975, df = 2)) if(missing(id.n) || is.null(id.n)) id.n <- sum(rd > cutoff) if(missing(labs) || is.null(labs)) labs <- 1:length(rd) ind <- sort(rd, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] ## 1. Robust tolerance ## define the plot, plot a box, plot the "good" points, ## plot the outliers either as points or as numbers depending on outflag, ## plot the ellipse, write a title of the plot plot(data, xlim = x1, ylim = y1, xlab = xlab, ylab = ylab, ...) box() ## VT:::03.08.2008 if(id.n > 0){ xrange <- par("usr") xrange <- xrange[2] - xrange[1] text(data[ind, 1] + xrange/50, data[ind, 2], labs[ind]) } if(leg@leg) points(z1, type = "l", lty=leg@lty[1], col=leg@col[1]) title(main) ## 2. Classical tolerance ellipse and legend if(classic){ points(z2, type = "l", lty=leg@lty[2], col=leg@col[2]) if(leg@leg) legend("bottomright", leg@txt, pch=leg@pch, lty=leg@lty, col=leg@col) } invisible() } ## Plot a scatter plot of the data 'x' and superimpose a ## (cutoff-)tollernce ellipse. ## The differences to tolEllipsePlot() in robustbase are: ## - customizable (titles, limits, labels, etc) ## - can take either a Cov object or a list (aka cov.wt or covMcd) ## .myellipse <- function (x, xcov, cutoff = NULL, id.n = NULL, classic = FALSE, tol = 1e-07, xlab = "", ylab = "", main="Tolerance ellipse (97.5%)", sub="", txt.leg=c("robust", "classical"), col.leg = c("red", "blue"), lty.leg=c("solid", "dashed"), xlim, ylim) { if (is.data.frame(x)) x <- data.matrix(x) if (!is.matrix(x) || !is.numeric(x)) stop("x is not a numeric dataframe or matrix.") n <- dim(x)[1] p <- dim(x)[2] if (p != 2) stop("Dimension {= ncol(x)} must be 2!") if(missing(xcov)) xcov <- CovMcd(x) if(is(xcov, "Cov")) { x.loc <- getCenter(xcov) x.cov <- getCov(xcov) } else { if (!is.numeric(xcov$center) || !is.numeric(xcov$cov)) stop("argument 'xcov' must have numeric components 'center' and 'cov'") x.loc <- xcov$center ## x.cov <- n/(n - 1) * xcov$cov x.cov <- xcov$cov } xM <- colMeans(x) z1 <- getEllipse(loc=xM, cov=n/(n - 1) * cov.wt(x)$cov) z2 <- getEllipse(loc=x.loc, cov=x.cov) ## VT::09.06.200 ## if no need of the classic ellipse - set it to the robust one ## otherwise the xlim and ylim will be set to fit both ellipses ## if(classic == FALSE) ## z1 <- z2 x1 <- c(min(x[, 1], z1[, 1], z2[, 1]), max(x[, 1], z1[, 1], z2[, 1])) y1 <- c(min(x[, 2], z1[, 2], z2[, 2]), max(x[, 2], z1[, 2], z2[, 2])) md <- sqrt(mahalanobis(x, xM, cov(x), tol = tol)) rd <- sqrt(mahalanobis(x, x.loc, x.cov, tol = tol)) if (missing(cutoff) || is.null(cutoff)) cutoff <- sqrt(qchisq(0.975, df = 2)) if (missing(id.n) || is.null(id.n)) id.n <- sum(rd > cutoff) ind <- sort(rd, index.return = TRUE)$ix ind <- ind[(n - id.n + 1):n] if(missing(xlim)) xlim <- x1 if(missing(ylim)) ylim <- y1 plot(x, xlim = xlim, ylim = ylim, xlab = xlab, ylab = ylab, main = main, sub=sub) box() if(id.n > 0) { xrange <- par("usr") xrange <- xrange[2] - xrange[1] text(x[ind, 1] + xrange/50, x[ind, 2], ind) } points(z2, type = "l", lty = lty.leg[1], col = col.leg[1]) if (classic) { points(z1, type = "l", lty = lty.leg[2], col = col.leg[2]) legend("bottomright", txt.leg, lty = lty.leg, col = col.leg) } invisible() } ## Draw pairwise scatter plots for the data set 'x' ## - upper triangle - scatter plot with classical and robust 0.975-ellipses ## - histograms on the diagonal ## - lower triangle - robust (MCD) and classical correlations ## ## - x - data ## - main - caption of the plot ## .rrpairs <- function(obj, main="", sub="", xlab="", ylab="", ...){ hcol <- "cyan" # colour for histogram dcol <- "red" # color of the density line ecol.class <- "blue" # colour for classical ellipse ecol.rob <- "red" # colour for robust ellipse ## quick and dirty simulation of panel.number() which seems not to work ## in the panel functions of pairs() ## Retursns list of the corresponding i and j ## ## Example call: which.ij(hbk[,1], hbk[,3], getData(CovMcd(hbk))) ## which.ij <-function(x, y, data) { i <- j <- 0 for(k in 1:ncol(data)) { ifi <- all.equal(x, data[,k], check.attributes=FALSE) ifj <- all.equal(y, data[,k], check.attributes=FALSE) if(i == 0 && !is.character(ifi) && ifi) i <- k if(j == 0 && !is.character(ifj) && ifj) j <- k if(i != 0 & j != 0) break } list(i=i, j=j) } panel.hist <- function(x, ...) { usr <- par("usr"); on.exit(par(usr)) par(usr = c(usr[1:2], 0, 1.5) ) h <- hist(x, plot = FALSE) breaks <- h$breaks; nB <- length(breaks) y <- h$counts; y <- y/max(y) rect(breaks[-nB], 0, breaks[-1], y, col=hcol, ...) } panel.hist.density <- function(x,...) { usr <- par("usr"); on.exit(par(usr)) par(usr = c(usr[1:2], 0, 1.5) ) h <- hist(x, plot = FALSE) breaks <- h$breaks; nB <- length(breaks) y <- h$counts; y <- y/max(y) rect(breaks[-nB], 0, breaks[-1], y, col=hcol) tryd <- try( d <- density(x, na.rm=TRUE, bw="nrd", adjust=1.2), silent=TRUE) if(class(tryd) != "try-error") { d$y <- d$y/max(d$y) lines(d, col=dcol) } } panel.cor <- function(x, y, digits=2, ...) { ix <- which.ij(x, y, getData(obj)) usr <- par("usr"); on.exit(par(usr)) par(usr = c(0, 1, 0, 1)) r <- cor(x, y) rr <- getCorr(obj)[ix$i,ix$j] prefix <- "" rprefix <- "" ff <- 0.35 txt <- format(c(r, 0.123456789), digits=digits)[1] txt <- paste(prefix, txt, sep="") rtxt <- format(c(rr, 0.123456789), digits=digits)[1] rtxt <- paste(rprefix, rtxt, sep="") txt <- if(isClassic(obj)) txt else paste0("(", txt, ")") # parentheses around the classical correlation # only if the object is a robust one cex <- ff/strwidth(txt) text(0.5, 0.3, txt, cex = cex, col=ecol.class) if(!isClassic(obj)) text(0.5, 0.5, rtxt, cex = cex, col=ecol.rob) } panel.ellipse <- function(x, y, ...) { usr <- par("usr"); on.exit(par(usr)) X <- cbind(x,y) C.ls <- cov(X) m.ls <- colMeans(X) ix <- which.ij(x, y, getData(obj)) ## cat("\npanel.ellipse: ", ix$i, ix$j,"\n") C.rr <- getCov(obj)[c(ix$i,ix$j), c(ix$i,ix$j)] m.rr <- getCenter(obj)[c(ix$i,ix$j)] e.class <- getEllipse(loc=m.ls, cov=C.ls, crit=0.975) e.rob <- getEllipse(loc=m.rr, cov=C.rr, crit=0.975) xmin <- min(c(min(x), min(e.class[,1]), min(e.rob[,1]))) xmax <- max(c(max(x), max(e.class[,1]), max(e.rob[,1]))) ymin <- min(c(min(y), min(e.class[,2]), min(e.rob[,2]))) ymax <- max(c(max(y), max(e.class[,2]), max(e.rob[,2]))) ff <- 0.1 xmin <- xmin - ff*(xmax-xmin); #print(ff*(xmax-xmin)) xmax <- xmax + ff*(xmax-xmin); #print(ff*(xmax-xmin)) ymin <- ymin - ff*(ymax-ymin); #print(ff*(ymax-ymin)) ymax <- ymax + ff*(ymax-ymin); #print(ff*(ymax-ymin)) par(usr = c(xmin, xmax, ymin, ymax)) points(x,y, ...) lines(e.class, col=ecol.class, lty="dashed") if(!isClassic(obj)) lines(e.rob, col=ecol.rob) } ## get the data x <- getData(obj) ## VT::27.04.2011 - fix the names of the variables on the ## diagonal - labels= in the call to pairs(). ## Plot also density line ## pairs(x, main = main, sub=sub, lower.panel=panel.cor, diag.panel=panel.hist.density, upper.panel=panel.ellipse, labels=names(getCenter(obj)), ...) } ## Distance plot: ## Plot the robust and classical distances against the the index ## obj - A CovRobust object, ## getData(obj) - data frame or matrix ## .xydistplot <- function(obj, cutoff, main="Distance Plot", xlab="Index", ylab="Mahalanobis distance", col="darkred", labs, ...) { myPanel <- function(x, y, subscripts, cutoff, id.n, ...) { panel.xyplot(x, y, ...) panel.abline(h=cutoff,lty="dashed") n <- length(y) if(missing(id.n)) id.n <- length(which(y > cutoff)) if(id.n > 0){ ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] xrange<-range(y) adj <- (xrange[2]-xrange[1])/20 ltext(x[ind] + adj, y[ind] + adj, ind, cex=0.85) } } X <- getData(obj) n <- nrow(X) p <- ncol(X) if(missing(cutoff)) cutoff <- sqrt(qchisq(0.975, p)) if(missing(labs) || is.null(labs)) labs <- 1:length(getDistance(obj)) ## VT::12.11.2018 - In case of MRCD we can use also classic regularized estimate dd1 <- sqrt(getDistance(obj)) # robust distances if(inherits(obj, "CovMrcd")) { vv <- CovMrcd(X, alpha=1) # classical REGULARIZED center and covariance dd2 <- sqrt(getDistance(vv)) # classical distances } else { vv <- cov.wt(X) dd2 <- sqrt(mahalanobis(X,vv$center,vv$cov)) # classical distances } dd <- c(dd1, dd2) # a vector with both robust and classical distances ind <- c(1:n, 1:n) # 1, 2, ..., n, 1, 2, ...n - gr <- as.factor(c(rep(1,n), rep(2,n))) # 1, 1, ..., 1, 2, 2, ...2 - n x 1, n x 2 levels(gr)[1] <- "Robust" levels(gr)[2] <- "Classical" xyplot(dd~ind|gr, cutoff=cutoff, panel = myPanel, xlab=xlab, ylab=ylab, main=main, col=col, ...) } ## QQ-Chi plot: ## Plot QQ plot of the robust and classical distances against the ## quantiles of the Chi2 distr ## X - data frame or matrix ## .xyqqchi2 <- function(obj, cutoff, main=eval(substitute(expression(paste(chi^2, " QQ-Plot")))), xlab=eval(substitute(expression(paste("Sqrt of the quantiles of the ", chi^2, " distribution")))), ylab="Mahalanobis distance", col="darkred", labs, ...) { myPanel <- function(x, y, subscripts, cutoff, id.n, ...) { y <- sort(y, index.return=TRUE) iy <- y$ix y <- y$x panel.xyplot(x, y, ...) panel.abline(0,1,lty="dashed") n <- length(y) if(missing(id.n)) id.n <- length(which(y > cutoff)) if(id.n > 0){ ind <- (n-id.n+1):n xrange<-range(y) adj <- (xrange[2]-xrange[1])/50 ltext(x[ind] + adj, y[ind] + adj, iy[ind], cex=0.85) } } X <- getData(obj) n <- nrow(X) p <- ncol(X) if(missing(cutoff)) cutoff <- sqrt(qchisq(0.975, p)) if(missing(labs) || is.null(labs)) labs <- 1:length(getDistance(obj)) ## VT::12.11.2018 - In case of MRCD we can use also classic regularized estimate dd1 <- sqrt(getDistance(obj)) # robust distances if(inherits(obj, "CovMrcd")) { vv <- CovMrcd(X, alpha=1) # classical REGULARIZED center and covariance dd2 <- sqrt(getDistance(obj)) # classical Mahalanobis distances } else { vv <- cov.wt(X) # classical center and covariance dd2 <- sqrt(mahalanobis(X,vv$center,vv$cov)) # classical Mahalanobis distances } dd <- c(dd1, dd2) # a vector with both robust and classical distances qq <- sqrt(qchisq(((1:n)-1/3)/(n+1/3), p)) ind<-c(qq, qq) gr<-as.factor(c(rep(1,n), rep(2,n))) # 1, 1, ...., 1, 2, 2, ..., 2 - n x 1, n x 2 levels(gr)[1]<-"Robust" levels(gr)[2]<-"Classical" xyplot(dd~ind|gr, cutoff=cutoff, panel = myPanel, xlab=xlab, ylab=ylab, main=main, col=col, ...) } rrcov/R/CovMcd.R0000644000176200001440000000351112763517421013114 0ustar liggesusersCovMcd <- function(x, raw.only = FALSE, alpha=control@alpha, nsamp = control@nsamp, scalefn=control@scalefn, maxcsteps=control@maxcsteps, initHsets=NULL, save.hsets=FALSE, seed=control@seed, trace=control@trace, use.correction=control@use.correction, control=CovControlMcd(), ...) { ## MM 2014-11-04: add '...' so we are compatible to covMcd() extensions in robustbase ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. ## prepare the call to covMcd() which will return an S3 object ## handle the case of nsamp="best" or "exact" iter <- if(is.numeric(nsamp)) nsamp else 0 xcall <- match.call() mcd <- covMcd(x=x, raw.only=raw.only, alpha=alpha, nsamp=nsamp, scalefn=control@scalefn, maxcsteps=control@maxcsteps, initHsets = NULL, save.hsets = FALSE, seed=seed, trace=trace, use.correction=use.correction, ...) new("CovMcd", call= xcall, iter=iter, crit=mcd$crit, cov=mcd$cov, center=mcd$center, n.obs=mcd$n.obs, mah = mcd$mah, wt = mcd$mcd.wt, X = mcd$X, method=mcd$method, best=mcd$best, alpha=mcd$alpha, quan=mcd$quan, raw.cov = mcd$raw.cov, raw.center = mcd$raw.center, raw.mah = mcd$raw.mah, raw.wt = mcd$raw.weights, raw.cnp2 = mcd$raw.cnp2, cnp2 = mcd$cnp2, singularity = mcd$singularity) } rrcov/R/psibwt.R0000644000176200001440000000767212763517421013265 0ustar liggesuserssetMethod("psi", "PsiBwt", function(obj, x) { if(obj@c1 == 0){ x1 <- x - obj@M ivec1 <- (x1 <= 0) ivec2 <- (x1 > 0) } else { x1 <- (x-obj@M)/obj@c1 ivec1 <- (x1 < 0) ivec2 <- (x1 > 1) } return(ivec1*x+(1-ivec1-ivec2)*x*(1-x1^2)^2) }) setMethod("wt", "PsiBwt", function(obj, x) { if(obj@c1 == 0){ x1 <- x - obj@M ivec1 <- (x1 <= 0) ivec2 <- (x1 > 0) } else { x1 <- (x-obj@M)/obj@c1 ivec1 <- (x1 < 0) ivec2 <- (x1 > 1) } return(ivec1+(1-ivec1-ivec2)*(1-x1^2)^2) }) setMethod("vt", "PsiBwt", function(obj, x) { return(x*psi(obj,x)) }) setMethod("erho", "PsiBwt", function(obj) { # expectation of rho(d) under chi-squared p c1<-obj@c1 M<-obj@M p<-obj@p if (c1 == 0) return(.chiInt(p,2,M)/2 + M^2/2*.chiInt2(p,0,M)) return(.chiInt(p,2,M)/2 +(M^2/2+c1*(5*c1+16*M)/30)*.chiInt2(p,0,M+c1) +(M^2/2-M^2*(M^4-5*M^2*c1^2+15*c1^4)/(30*c1^4))*(.chiInt(p,0,M+c1)-.chiInt(p,0,M)) +(1/2+M^4/(2*c1^4)-M^2/c1^2)*(.chiInt(p,2,M+c1)-.chiInt(p,2,M)) +(4*M/(3*c1^2)-4*M^3/(3*c1^4))*(.chiInt(p,3,M+c1)-.chiInt(p,3,M)) +(3*M^2/(2*c1^4)-1/(2*c1^2))*(.chiInt(p,4,M+c1)-.chiInt(p,4,M)) -(4*M/(5*c1^4))*(.chiInt(p,5,M+c1)-.chiInt(p,5,M)) +(1/(6*c1^4))*(.chiInt(p,6,M+c1)-.chiInt(p,6,M))) }) setMethod("erhoLim", "PsiBwt", function(obj) { p<-obj@p c1<-obj@c1 return(.chiInt(p,2,c1) + c1^2*.chiInt2(p,0,c1)) }) setMethod("erhoLimD", "PsiBwt", function(obj) { p<-obj@p c1<-obj@c1 return(.chiIntD(p,2,c1) + 2*c1*.chiInt2(p,0,c1) + c1^2*.chiInt2D(p,0,c1)) }) setMethod("arpLim", "PsiBwt", function(obj) { p<-obj@p r<-obj@r obj@c1 <- c1 <- 2*p iter <- 1 crit <- 100 eps <- 1e-5 while(crit>eps & iter<100) { c1.old <- c1 fc <- erhoLim(obj) - c1^2*r fcp <- erhoLimD(obj) - 2*c1*r obj@c1 <- c1 <- c1 - fc/fcp if(c1 < 0) obj@c1 <- c1 <- c1.old/2 crit <- abs(fc) ## print(c(iter,c1.old,crit)) iter <- iter+1 } # print(c(iter,c1,crit)) return(c(c1, pchisq(c1^2,p), log10(1-pchisq(c1^2,p)))) }) setMethod("csolve", "PsiBwt", function(obj) { ## find constants c1 and M that give a specified breakdown r ## and rejection point alpha n<-obj@n p<-obj@p r<-obj@r alpha<-obj@alpha if(r > (n-p)/(2*n)) obj@r <- r <- (n-p)/(2*n) # maximum achievable breakdown ## print(c(n,p,r,alpha)) ## ## if rejection is not achievable, use c1=0 and best rejection ## limvec <- arpLim(obj) if(1-limvec[2] <= alpha) { obj@c1 <- c1 <- 0 obj@M <- M <- sqrt(qchisq(1-alpha, p)) ## print("adjusting alpha") ## print(c(alpha, M, c1)) } else { c1.plus.M <- sqrt(qchisq(1-alpha,p)) obj@M <- M <- sqrt(p) obj@c1 <- c1 <- c1.plus.M - M iter <- 1 crit <- 100 eps <- 1e-5 while(crit > eps & iter<100){ deps <- 1e-4 M.old <- M c1.old <- c1 er <- erho(obj) fc <- er - r*(M^2/2+c1*(5*c1+16*M)/30) obj1 <- obj; obj1@c1 <- c1+deps obj2 <- obj; obj2@M <- M+deps fcc1 <- (erho(obj1) - er)/deps fcM <- (erho(obj2) - er)/deps ## fcp <- fcM - fcc1 - r*(M-(5*c1+16*M)/30+c1*9/30) fcp <- fcM - fcc1 - r*(M-(5*c1+16*M)/30+c1*11/30) # changed according to CB obj@M <- M <- M - fc/fcp if(M >= c1.plus.M ){ obj@M <- M <- (M.old + c1.plus.M)/2 } obj@c1 <- c1 <- c1.plus.M - M crit <- abs(fc) ## print(c(iter, M.old, c1.old, crit)) iter <- iter+1 } } return(obj) }) rrcov/R/transform.R0000644000176200001440000000067613022566024013755 0ustar liggesuserstransform.ilr <- function(x) { x.ilr <- x[, -ncol(x), drop=FALSE] colnames(x.ilr) <- paste("X", 1:ncol(x.ilr), sep="") rownames(x.ilr) <- NULL D <- ncol(x) for (i in 1:ncol(x.ilr)){ x.ilr[,i]=sqrt((D-i)/(D-i+1))*log(((apply(as.matrix(x[,(i+1):D,drop=FALSE]),1,prod))^(1/(D-i)))/(x[,i])) ##x.ilr[,i]=sqrt((D-i)/(D-i+1))*log(apply(as.matrix(x[,(i+1):D]), 1, gm)/(x[,i])) } return(-x.ilr) } rrcov/R/QdaCov.R0000644000176200001440000001052312763517421013117 0ustar liggesusers## The S3 version QdaCov <- function (x, ...) UseMethod("QdaCov") QdaCov.formula <- function(formula, data, ..., subset, na.action) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- QdaCov.default(x, grouping, ...) ## res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as 'formula' cl <- match.call() cl[[1]] <- as.name("QdaCov") res@call <- cl ## res$contrasts <- attr(x, "contrasts") ## res$xlevels <- .getXlevels(Terms, m) ## res$na.action <- attr(m, "na.action") res } QdaCov.default <- function(x, grouping, prior = proportions, tol = 1.0e-4, method=CovControlMcd(), ...) { if(is.null(dim(x))) stop("x is not a matrix") ## method <- match.arg(method) xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) if(length(grouping) == 1) { ## this is the number of groups and the groups are of equal size ng = grouping ni = n/ng if(ng*ni < n) stop("nrow(x) is not divisible by the number of groups") grouping <- rep(0,0) for(i in 1:ng) grouping <- c(grouping, rep(i,ni)) }else if(length(grouping) > 1 && length(grouping) < n) { ## grouping contains a vector with the group sizes ng <- length(grouping) if(sum(grouping) != n) stop("nrow(x) is not equal to n1+n2+...+nn") gx <- rep(0,0) for(i in 1:ng) gx <- c(gx, rep(i,grouping[i])) grouping <- gx } if(n != length(grouping)) stop("nrow(x) and length(grouping) are different") g <- as.factor(grouping) lev <- lev1 <- levels(g) counts <- as.vector(table(g)) if(!missing(prior)) { if(any(prior < 0) || round(sum(prior), 5) != 1) stop("invalid prior") if(length(prior) != nlevels(g)) stop("prior is of incorrect length") prior <- prior[counts > 0] } if(any(counts == 0)) { warning(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) lev1 <- lev[counts > 0] g <- factor(g, levels=lev1) counts <- as.vector(table(g)) } proportions <- counts/n ng <- length(proportions) names(g) <- NULL names(prior) <- levels(g) if(missing(method)) method <- "mcd" xcov <- .allcovMcd(x, grouping, method, ...) return (new("QdaCov", call=xcall, prior=prior, counts=counts, center=xcov$means, cov=xcov$cov, covinv=xcov$covinv, covdet=xcov$covdet, method=xcov$method, control=xcov$control, X=x, grp=g)) } .allcovMcd <- function(x, grouping, method=CovControlMcd(), ...){ xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) dimn <- dimnames(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts/n) # compute group means and covariance matrices for each group mX <- matrix(0,ng,p) covX <- array(0,c(p,p,ng)) covInv <- array(0,c(p,p,ng)) covdet <- vector(mode="numeric", length=ng) for(i in 1:ng){ mcdControl <- .covRobustControl(method) mcd <- CovRobust(x[which(g == lev[i]),], control=mcdControl) mX[i,] <- getCenter(mcd) covX[,,i] <- getCov(mcd) covInv[,,i] <- solve(getCov(mcd)) covdet[i] <- det(getCov(mcd)) } dimnames(mX) <- list(levels(g), dimn[[2]]) dimnames(covX) <- list(dimn[[2]], dimn[[2]], levels(g)) dimnames(covInv) <- list(dimn[[2]], dimn[[2]], levels(g)) names(covdet) <- levels(g) ans <- list(call=xcall, means=mX, cov=covX, covinv=covInv, covdet=covdet, method=getMeth(mcd), control=mcdControl) class(ans) <- "allcov" return(ans) } rrcov/R/PcaHubert.R0000644000176200001440000005574312763517421013634 0ustar liggesusers##setGeneric("PcaHubert", function(x, ...) standardGeneric("PcaHubert")) ##setMethod("PcaHubert", "formula", PcaHubert.formula) ##setMethod("PcaHubert", "ANY", PcaHubert.default) setMethod("getQuan", "PcaHubert", function(obj) obj@quan) ## The S3 version PcaHubert <- function (x, ...) UseMethod("PcaHubert") PcaHubert.formula <- function (formula, data = NULL, subset, na.action, ...) { cl <- match.call() mt <- terms(formula, data = data) if (attr(mt, "response") > 0) stop("response not allowed in formula") mf <- match.call(expand.dots = FALSE) mf$... <- NULL mf[[1]] <- as.name("model.frame") mf <- eval.parent(mf) ## this is not a `standard' model-fitting function, ## so no need to consider contrasts or levels if (.check_vars_numeric(mf)) stop("PCA applies only to numerical variables") na.act <- attr(mf, "na.action") mt <- attr(mf, "terms") attr(mt, "intercept") <- 0 x <- model.matrix(mt, mf) res <- PcaHubert.default(x, ...) ## fix up call to refer to the generic, but leave arg name as `formula' cl[[1]] <- as.name("PcaHubert") res@call <- cl # if (!is.null(na.act)) { # res$na.action <- na.act # if (!is.null(sc <- res$x)) # res$x <- napredict(na.act, sc) # } res } PcaHubert.default <- function(x, k=0, kmax=10, alpha=0.75, mcd=TRUE, maxdir=250, scale=FALSE, signflip=TRUE, crit.pca.distances=0.975, trace=FALSE, ...) { ## k - Number of principal components to compute. If \code{k} is missing, ## or \code{k = 0}, the algorithm itself will determine the number of ## components by finding such \code{k} that \code{l_k/l_1 >= 10.E-3} and ## \code{sum_1:k l_j/sum_1:r l_j >= 0.8}. It is preferable to ## investigate the scree plot in order to choose the number ## of components and the run again. Default is \code{k=0}. ## ## kmax - Maximal number of principal components to compute Default is \code{kmax=10}. ## If \code{k} is provided, \code{kmax} does not need to be specified, ## unless \code{k} is larger than 10. ## alpha This parameter measures the fraction of outliers the algorithm should ## resist. In MCD alpha controls the size of the subsets over which the determinant ## is minimized, i.e. alpha*n observations are used for computing the determinant. ## Allowed values are between 0.5 and 1 and the default is 0.5. ## mcd - Logical - when the number of variables is sufficiently small, ## the loadings are computed as the eigenvectors of the MCD covariance matrix, ## hence the function \code{\link{CovMcd}()} is automatically called. The number of ## principal components is then taken as k = rank(x). Default is \code{mcd=TRUE}. ## If \code{mcd=FALSE}, the ROBPCA algorithm is always applied. ## trace whether to print intermediate results. Default is \code{trace = FALSE}} ## Example: ## data(hbk) ## pca <- PcaHubert(hbk) ## ## The value returned by 'PcaHubert' is an S4 object containing the following slots: ## ## loadings - Robust loadings (eigenvectors) ## eigenvalues - Robust eigenvalues ## center - Robust center of the data ## scores - Robust scores ## k - Number of (chosen) principal components ## ## quan - The quantile h used throughout the algorithm ## sd - Robust score distances within the robust PCA subspace ## od - Orthogonal distances to the robust PCA subspace ## cutoff - Cutoff values for the robust score and orthogonal distances ## flag - The observations whose score distance is larger than result.cutoff.sd ## or whose orthogonal distance is larger than result$cutoff$od ## can be considered as outliers and receive a flag equal to zero. ## The regular observations receive a flag 1. ## This implementation followes closely the Matlab implementation, available as part of 'LIBRA, ## a Matlab Library for Robust Analysis': ## www.wis.kuleuven.ac.be/stat/robust.html cl <- match.call() if(missing(x)) stop("You have to provide at least some data") data <- as.matrix(x) n <- nrow(data) p <- ncol(data) ## ___Step 1___: Reduce the data space to the affine subspace spanned by the n observations ## Apply svd() to the mean-centered data matrix. If n > p we use the kernel approach - ## the decomposition is based on computing the eignevalues and eigenvectors of(X-m)(X-m)' Xsvd <- .classPC(data, scale=scale, signflip=signflip, scores=TRUE) if(Xsvd$rank == 0) stop("All data points collapse!") ## VT::27.08.2010: introduce 'scale' parameter; return the scale in the value object ## myscale = if(is.logical(scale) && !scale) vector('numeric', p) + 1 else Xsvd$scale ## ## verify and set the input parameters: alpha, k and kmax ## determine h based on alpha and kmax, using the function h.alpha.n() ## ## VT::06.11.2012 - kmax <= floor(n/2) is too restrictive ## kmax <- max(min(floor(kmax), floor(n/2), Xsvd$rank),1) kmax <- max(min(floor(kmax), Xsvd$rank),1) if((k <- floor(k)) < 0) k <- 0 else if(k > kmax) { warning(paste("The number of principal components k = ", k, " is larger then kmax = ", kmax, "; k is set to ", kmax,".", sep="")) k <- kmax } if(missing(alpha)) { default.alpha <- alpha h <- min(h.alpha.n(alpha, n, kmax), n) alpha <- h/n if(k == 0) { if(h < floor((n+kmax+1)/2)) { h <- floor((n+kmax+1)/2) alpha <- h/n warning(paste("h should be larger than (n+kmax+1)/2. It is set to its minimum value ", h, ".", sep="")) } } else { if(h < floor((n+k+1)/2)) { h <- floor((n+k+1)/2) alpha <- h/n warning(paste("h should be larger than (n+k+1)/2. It is set to its minimum value ", h, ".", sep="")) } } if(h > n) { alpha <- default.alpha if(k == 0) h <- h.alpha.n(alpha, n, kmax) else h <- h.alpha.n(alpha, n, k) warning(paste("h should be smaller than n = ", n, ". It is set to its default value ", h, ".", sep="")) } }else { if(alpha < 0.5 | alpha > 1) stop("Alpha is out of range: should be between 1/2 and 1") if(k == 0) h <- h.alpha.n(alpha, n, kmax) else h <- h.alpha.n(alpha, n, k) } X <- Xsvd$scores center <- Xsvd$center rot <- Xsvd$loadings ## ## ___Step 2___: Either calculate the standard PCA on the MCD covariance matrix (p< apply MCD { if(trace) cat("\nApplying MCD.\n") X.mcd <- CovMcd(as.data.frame(X), alpha=alpha) X.mcd.svd <- svd(getCov(X.mcd)) rank <- ncol(X) ## The covariance matrix is not singular ev <- X.mcd.svd$d ## VT::11.28.2015: Choose the number of components k (if not specified) ## ## Use the test l_k/l_1 >= 10.E-3, i.e. the ratio of ## the k-th eigenvalue to the first eigenvalue (sorted decreasingly) is larger than ## 10.E/3 and the fraction of the cumulative dispersion is larger or equal 80% ## if(k != 0) k <- min(k, ncol(X)) else { test <- which(ev/ev[1] <= 1.E-3) k <- if(length(test) != 0) min(min(rank, test[1]), kmax) else min(rank, kmax) cumulative <- cumsum(ev[1:k])/sum(ev) if(cumulative[k] > 0.8) { k <- which(cumulative >= 0.8)[1] } if(trace) cat("\n k, kmax, rank, p: ", k, kmax, rank, p, "\n") if(trace) cat("The number of principal components is defined by the algorithm. It is set to ", k,".\n", sep="") } scores <- (X - matrix(rep(getCenter(X.mcd), times=nrow(X)), nrow=nrow(X), byrow=TRUE)) %*% X.mcd.svd$u ## VT::19.08.2016: we need also to rescale back the MCD center, ## before adding it to the original center ## center <- as.vector(center + getCenter(X.mcd) %*% t(rot)) center <- as.vector(center + sweep(getCenter(X.mcd) %*% t(rot), 2, myscale, "*")) eigenvalues <- X.mcd.svd$d[1:k] loadings <- Xsvd$loadings %*% X.mcd.svd$u[,1:k] scores <- as.matrix(scores[,1:k]) if(is.list(dimnames(data)) && !is.null(dimnames(data)[[1]])) { dimnames(scores)[[1]] <- dimnames(data)[[1]] } else { dimnames(scores)[[1]] <- 1:n } dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) dimnames(scores)[[2]] <- as.list(paste("PC", seq_len(ncol(scores)), sep = "")) res <- new("PcaHubert",call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=myscale, scores=scores, k=k, quan=X.mcd@quan, alpha=alpha, n.obs=n) } else # p > n or mcd=FALSE => apply the ROBPCA algorithm { if(trace) cat("\nApplying the projection method of Hubert.\n") ## ## For each direction 'v' through 2 data points we project the n data points xi on v ## and compute their robustly standardized absolute residual ## |xi'v - tmcd(xj'v|/smcd(xj'v) ## alldir <- choose(n, 2) # all possible directions through two data points - n*(n-1)/2 ndir <- min(maxdir, alldir) # not more than maxdir (250) all <- (ndir == alldir) # all directions if n small enough (say n < 25) B <- extradir(X, ndir, all=all) # the rows of B[ndir, ncol(X)] are the (random) directions Bnorm <- vector(mode="numeric", length=nrow(B)) # ndir x 1 Bnorm <- apply(B, 1, vecnorm) # Bnormr <- Bnorm[Bnorm > 1.E-12] # choose only the nonzero length vectors m <- length(Bnormr) # the number of directions that will be used B <- B[Bnorm > 1.E-12,] # B[m x ncol(X)] A <- diag(1/Bnormr) %*% B # A[m x ncol(X)] Y <- X %*% t(A) # n x m - projections of the n points on each of the m directions Z <- matrix(0,n, m) # n x m - to collect the outlyingness of each point on each direction for(i in 1:m) { umcd <- unimcd(Y[,i], quan=h) # one-dimensional MCD: tmcd and smcd if(umcd$smcd < 1.E-12) { ## exact fit situation: will not be handled if((r2 <- rankMM(data[umcd$weights==1,])) == 1) stop("At least ", sum(umcd$weights), " observations are identical.") } else Z[,i] <- abs(Y[,i] - umcd$tmcd) / umcd$smcd } H0 <- order(apply(Z, 1, max)) # n x 1 - the outlyingnesses of all n points Xh <- X[H0[1:h], ] # the h data points with smallest outlyingness Xh.svd <- .classPC(Xh) kmax <- min(Xh.svd$rank, kmax) if(trace) cat("\nEigenvalues: ", Xh.svd$eigenvalues, "\n") ## ## Find the number of PC 'k' ## Use the test l_k/l_1 >= 10.E-3, i.e. the ratio of ## the k-th eigenvalue to the first eigenvalue (sorted decreasingly) is larger than ## 10.E/3 and the fraction of the cumulative dispersion is larger or equal 80% ## if(k == 0) { test <- which(Xh.svd$eigenvalues/Xh.svd$eigenvalues[1] <= 1.E-3) k <- if(length(test) != 0) min(min(Xh.svd$rank, test[1]), kmax) else min(Xh.svd$rank, kmax) cumulative <- cumsum(Xh.svd$eigenvalues[1:k])/sum(Xh.svd$eigenvalues) if(cumulative[k] > 0.8) { k <- which(cumulative >= 0.8)[1] } if(trace) cat(paste("The number of principal components is set by the algorithm. It is set to ", k, ".\n", sep="")) } if(trace) cat("\nXsvd$rank, Xh.svd$rank, k and kmax: ", Xsvd$rank, Xh.svd$rank, k, kmax,"\n") ## perform extra reweighting step if(k != Xsvd$rank) { if(trace) cat("\nPerform extra reweighting step (k != rank)", k) ## VT::27.08.2010 - bug report from Stephen Milborrow: if n is small relative to p ## k can be < Xsvd$rank but larger than Xh.svd$rank - the number of observations in ## Xh.svd is roughly half of these in Xsvd k <- min(Xh.svd$rank, k) XRc <- X - matrix(rep(Xh.svd$center, times=n), nrow=n, byrow=TRUE) Xtilde <- XRc %*% Xh.svd$loadings[,1:k] %*% t(Xh.svd$loadings[,1:k]) Rdiff <- XRc - Xtilde odh <- apply(Rdiff, 1, vecnorm) umcd <- unimcd(odh^(2/3), h) cutoffodh <- sqrt(qnorm(0.975, umcd$tmcd, umcd$smcd)^3) indexset <- (odh <= cutoffodh) Xh.svd <- .classPC(X[indexset,]) k <- min(Xh.svd$rank, k) if(trace) cat("\nPerform extra reweighting step (k != rank)", k) } ## Project the data points on the subspace spanned by the first k0 eigenvectors ## VT::19.08.2016: we need also to rescale back the MCD center, ## before adding it to the original center ## center <- center + Xh.svd$center %*% t(rot) center <- center + sweep(Xh.svd$center %*% t(rot), 2, myscale, "*") rot <- rot %*% Xh.svd$loadings X2 <- (X - matrix(rep(Xh.svd$center, times=n), nrow=n, byrow=TRUE)) %*% Xh.svd$loadings X2 <- as.matrix(X2[ ,1:k]) rot <- as.matrix(rot[ ,1:k]) ## Perform now MCD on X2 in order to obtain a robust scatter matrix: find h data points whose ## covariance matrix has minimal determinant ## ## First apply C-step with the h points selected in the first step, i.e. those that ## determine the covariance matrix after the C-steps have converged. ## mah <- mahalanobis(X2, center=rep(0, ncol(X2)), cov=diag(Xh.svd$eigenvalues[1:k], nrow=k)) oldobj <- prod(Xh.svd$eigenvalues[1:k]) niter <- 100 for(j in 1:niter) { if(trace) cat("\nIter=",j, " h=", h, " k=", k, " obj=", oldobj, "\n") Xh <- X2[order(mah)[1:h], ] Xh.svd <- .classPC(as.matrix(Xh)) obj <- prod(Xh.svd$eigenvalues) X2 <- (X2 - matrix(rep(Xh.svd$center, times=n), nrow=n, byrow=TRUE)) %*% Xh.svd$loadings ## VT::19.08.2016: we need also to rescale back the MCD center, ## before adding it to the original center ## center <- center + Xh.svd$center %*% t(rot) center <- center + sweep(Xh.svd$center %*% t(rot), 2, myscale, "*") rot <- rot %*% Xh.svd$loadings mah <- mahalanobis(X2, center=matrix(0,1, ncol(X2)), cov=diag(Xh.svd$eigenvalues, nrow=length(Xh.svd$eigenvalues))) if(Xh.svd$rank == k & abs(oldobj - obj) < 1.E-12) break oldobj <- obj if(Xh.svd$rank < k) { j <- 1 k <- Xh.svd$rank } } ## Perform now MCD on X2 X2mcd <- CovMcd(X2, nsamp=250, alpha=alpha) if(trace) cat("\nMCD crit=",X2mcd@crit," and C-Step obj function=",obj," Abs difference=", abs(X2mcd@crit-obj), "\n") ## VT::14.12.2009 - if there is even a slight difference between mcd$crit and obj ## and it is on the negative side, the following reweighting step will be triggered, ## which could lead to unwanted difference in the results. Therefore compare with ## a tolerance 1E-16. eps <- 1e-16 if(X2mcd@crit < obj + eps) { X2cov <- getCov(X2mcd) X2center <- getCenter(X2mcd) if(trace) cat("\nFinal step - PC of MCD cov used.\n") }else { consistencyfactor <- median(mah)/qchisq(0.5,k) mah <- mah/consistencyfactor weights <- ifelse(mah <= qchisq(0.975, k), TRUE, FALSE) ## VT::27.08.2010 - not necessary, cov.wt is doing it properly ## wcov <- .wcov(X2, weights) wcov <- cov.wt(x=X2, wt=weights, method="ML") X2center <- wcov$center X2cov <- wcov$cov if(trace) cat("\nFinal step - PC of a reweighted cov used.\n") } ee <- eigen(X2cov) P6 <- ee$vectors ## VT::19.08.2016: we need also to rescale back the MCD center, ## before adding it to the original center ## center <- as.vector(center + X2center %*% t(rot)) center <- as.vector(center + sweep(X2center %*% t(rot), 2, myscale, "*")) eigenvalues <- ee$values loadings <- rot %*% P6 ## if(signflip) ## loadings <- .signflip(loadings) scores <- (X2 - matrix(rep(X2center, times=n), nrow=n, byrow=TRUE)) %*% P6 ## scores <- doScale(data, center, myscale)$x %*% loadings if(is.list(dimnames(data)) && !is.null(dimnames(data)[[1]])) { dimnames(scores)[[1]] <- dimnames(data)[[1]] } else { dimnames(scores)[[1]] <- 1:n } dimnames(loadings) <- list(colnames(data), paste("PC", seq_len(ncol(loadings)), sep = "")) dimnames(scores)[[2]] <- as.list(paste("PC", seq_len(ncol(scores)), sep = "")) res <- new("PcaHubert",call=cl, loadings=loadings, eigenvalues=eigenvalues, center=center, scale=myscale, scores=scores, k=k, quan=h, alpha=alpha, n.obs=n) } cl[[1]] <- as.name("PcaHubert") res@call <- cl ## Compute distances and flags res <- pca.distances(res, data, Xsvd$rank, crit.pca.distances) return(res) } ## ## Returns 'ndirect' (random) directions through the data - ## each through a pair of (randomly choosen) data points. ## If all=TRUE all possible directions (all possible pairs of points) ## are returned. ## extradir <- function(data, ndirect, all=TRUE){ if(all) # generate all possible directions (all pairs of n points) { cc <- combn(nrow(data), 2) B2 <- data[cc[1,],] - data[cc[2,],] } else { # generate 'ndirect' random directions if(TRUE){ uniran <- function(seed = 0){ seed<-floor(seed*5761)+999 quot<-floor(seed/65536) seed<-floor(seed)-floor(quot*65536) random<-seed/65536 list(seed=seed, random=random) } ## ## Draws a random subsubsample of k objects out of n. ## This function is called if not all (p+1)-subsets ## out of n will be considered. ## randomset <- function(n, k, seed){ ranset <- vector(mode="numeric", length=k) for(j in 1:k){ r <- uniran(seed) seed <- r$seed num <- floor(r$random * n) + 1 if(j > 1){ while(any(ranset == num)){ r <- uniran(seed) seed <- r$seed num <- floor(r$random * n) + 1 } } ranset[j] <- num } ans<-list() ans$seed <- seed ans$ranset <- ranset ans } n <- nrow(data) p <- ncol(data) r <- 1 B2 <- matrix(0,ndirect, p) seed <- 0 while(r <= ndirect) { sseed <- randomset(n, 2, seed) seed <- sseed$seed B2[r,] <- data[sseed$ranset[1], ] - data[sseed$ranset[2],] r <- r + 1 } } else { B2 <- matrix(0,ndirect, ncol(data)) for(r in 1:ndirect) { smpl <- sample(1:nrow(data), 2) # choose a random pair of points B2[r,] <- data[smpl[1], ] - data[smpl[2], ] # calculate the random direction based on these points } } } return(B2) } unimcd <- function(y, quan){ out <- list() ncas <- length(y) len <- ncas-quan+1 if(len == 1){ out$tmcd <- mean(y) out$smcd <- sqrt(var(y)) } else { ay <- c() I <- order(y) y <- y[I] ay[1] <- sum(y[1:quan]) for(samp in 2:len){ ay[samp]<-ay[samp-1]-y[samp-1]+y[samp+quan-1] } ay2<-ay^2/quan sq<-c() sq[1]<-sum(y[1:quan]^2)-ay2[1] for(samp in 2:len){ sq[samp]<-sq[samp-1]-y[samp-1]^2+y[samp+quan-1]^2-ay2[samp]+ay2[samp-1] } sqmin<-min(sq) Isq<-order(sq) ndup<-sum(sq == sqmin) ii<-Isq[1:ndup] slutn<-c() slutn[1:ndup]<-ay[ii] initmean<-slutn[floor((ndup+1)/2)]/quan initcov<-sqmin/(quan-1) res<-(y-initmean)^2/initcov sortres<-sort(res) factor<-sortres[quan]/qchisq(quan/ncas,1) initcov<-factor*initcov res<-(y-initmean)^2/initcov quantile<-qchisq(0.975,1) out$weights<-(res 1 & lmu != p)) stop("'mu' must be a numeric vector of length ", p) if(lmu == 1) mu <- rep(mu, p) if(!missing(conf.level) && (length(conf.level) != 1 || !is.finite(conf.level) || conf.level < 0 || conf.level > 1)) stop("'conf.level' must be a single number between 0 and 1") alpha <- 1 - conf.level ## One sample test - y == NULL if(is.null(y)) { alternative <- paste("true mean vector is not equal to", paste("(", paste(round(mu, digits=3), collapse = ", "), ")'", sep = ""), "\n") null.value <- mu METHOD = "One-sample Hotelling test" if(method == "c"){ xbar <- colMeans(x) xdiff <- xbar - mu V <- var(x) d <- p * (n-1)/(n-p) q <- n-p T2 <- STATISTIC <- n * crossprod(xdiff, solve(V, xdiff))[1, ] F <- STATISTIC <- STATISTIC/d PVALUE <- 1 - pf(STATISTIC, p, n - p) PARAMETER <- c(p, n - p) ESTIMATE = t(as.matrix(xbar)) rownames(ESTIMATE) <- "mean x-vector" }else if(method == "mcd"){ mcd <- CovMcd(x, trace=FALSE, alpha=0.75) xbar <- getCenter(mcd) xdiff <- xbar - mu V <- getCov(mcd) xdq <- .getApprox(p, n) d <- xdq$d q <- xdq$q T2 <- STATISTIC <- n * crossprod(xdiff, solve(V, xdiff))[1, ] F <- STATISTIC <- STATISTIC/d PVALUE <- 1 - pf(STATISTIC, p, q) PARAMETER <- c(p, q) ESTIMATE = t(as.matrix(xbar)) rownames(ESTIMATE) <- "MCD x-vector" METHOD <- paste(METHOD, " (Reweighted MCD Location)") } else stop(paste("Invalid method=",method)) cutoff.alpha <- qf(1-alpha, p, q) ## simultaneous confidence intervals for the components of mu conf.int <- matrix(1:(2*p), nrow=p) for(i in 1:p) { conf.int[i,1] <- xbar[i] - sqrt(1/n*d*qf(1-alpha, p, q) * V[i,i]) conf.int[i,2] <- xbar[i] + sqrt(1/n*d*qf(1-alpha, p, q) * V[i,i]) } dimnames(conf.int) <- list(dimnames(x)[[2]], c("Lower bound","Upper bound")) attr(conf.int,"conf.level") <- conf.level ## switch off the confidence intervals, since 'htest' ## does not know how to print them conf.int <- NULL } else { if(method != "c") stop("Robust two-sample test not yet implemeted!") xbar <- colMeans(x) ybar <- colMeans(y) xdiff <- xbar - ybar # the difference between the two means Vx <- var(x) Vy <- var(y) V <- ((n1 - 1) * Vx + (n2 - 1) * Vy) / (n1+ n2 - 2) # the pooled covariance matrix df1 <- p df2 <- n1 + n2 - p - 1 T2 <- STATISTIC <- crossprod(xdiff, solve(V, xdiff))[1,] * n1 * n2 / (n1+n2) F <- STATISTIC <- STATISTIC * (n1 + n2 - p - 1) / (n1 + n2 - 2) / p PVALUE <- 1 - pf(STATISTIC, df1, df2) PARAMETER = c(df1, df2) null.value <- NULL METHOD = "Two-sample Hotelling test" ESTIMATE = rbind(xbar, ybar) rownames(ESTIMATE) <- c("mean x-vector", "mean y-vector") alternative <- paste("true difference in mean vectors is not equal to (", paste(rep(0,p), collapse=","),")", sep="") conf.int <- NULL } names(PARAMETER) <- c("df1", "df2") ## names(STATISTIC) <- "T^2" STATISTIC <- c(T2, F) names(STATISTIC) <- c("T2", "F") rval <- list(statistic = STATISTIC, parameter = PARAMETER, p.value = PVALUE, conf.int=conf.int, estimate=ESTIMATE, null.value = NULL, alternative = alternative, method=METHOD, data.name=dname) class(rval) <- "htest" return(rval) } T2.test.formula <- function(formula, data, subset, na.action, ...) { if(missing(formula) || (length(formula) != 3) || (length(attr(terms(formula[-2]), "term.labels")) != 1)) stop("'formula' missing or incorrect") m <- match.call(expand.dots = FALSE) if(is.matrix(eval(m$data, parent.frame()))) m$data <- as.data.frame(data) m[[1]] <- as.name("model.frame") m$... <- NULL mf <- eval(m, parent.frame()) DNAME <- paste(names(mf), collapse = " by ") names(mf) <- NULL response <- attr(attr(mf, "terms"), "response") g <- factor(mf[[-response]]) if(nlevels(g) != 2) stop("grouping factor must have exactly 2 levels") xind <- which(g==levels(g)[1]) yind <- which(g==levels(g)[2]) y <- T2.test(x=mf[[response]][xind,], y=mf[[response]][yind,], ...) y$data.name <- DNAME y } ## ## Validate that 'x' is a numeric data frame or matrix. ## Convert 'x' to a matrix ## Optionally drop all rows with missing values ## .tomatrix <- function(x, drop.missing=TRUE){ x.name <- deparse(substitute(x)) msg <- paste(x.name, " is not a numeric dataframe or matrix.") if(is.vector(x) || (is.matrix(x) && !is.data.frame(x))) { if(!is.numeric(x)) stop(msg) } if(!is.vector(x) && !is.matrix(x) || is.data.frame(x)) { if((!is.data.frame(x) && !is.numeric(x)) || (!all(sapply(x, data.class) == "numeric"))) stop(msg) } x <- as.matrix(x) if(drop.missing){ ## drop all rows with missing values na.x <- !is.finite(x %*% rep(1, ncol(x))) xok <- !na.x x <- x[xok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") } x } .kappa.s <- function(alfa, p) { ## Computes the asymptotic variance for the reweighted ## MCD location estimator ## - p is the dimension ## - alfa, between 1/2 and 1 is the percentage of the observations ## that are used to determine the raw MCD. alfa <- 1 - alfa qalfa <- qchisq(1 - alfa, p) calfainvers <- pgamma(qalfa/2, p/2 + 1) c2 <- -1/2 * pgamma(qalfa/2, p/2 + 1) effrr <- (4 * c2^2)/calfainvers delta <- 0.025 qdelta <- qchisq(1 - delta, p) c1invers <- pgamma(qdelta/2, p/2 + 1) c2delta <- -1/2 * pgamma(qdelta/2, p/2 + 1) c1tilde <- pgamma(qdelta/2, p/2) asvar <- (1 + (2 * c2delta)/c1tilde)^2/effrr asvar <- asvar - (calfainvers * (c1tilde + 2 * c2delta))/(c1tilde^2 * c2) asvar <- asvar + c1invers/c1tilde^2 return(asvar) } ## ## F approximation for the robust Hotelling test - Willems et al ## Calculate the factor d and the degrees of freedom q for a given n and p ## .getApprox <- function(p, n) { ## determining the estimates for E[X] and Var[X] coeffpqp2varx <- matrix(c(7,4.829586,2.868279,10,4.261745,3.023672),ncol=2) coeffpqp2ex <- matrix(c(7,1.050505,1.360808,10,0.7280273,1.4685161),ncol=2) limvarx <- .kappa.s(0.75, p)^2*2*p limex <- .kappa.s(0.75, p)*p vb1 <- exp(coeffpqp2varx[2,1])/p^(coeffpqp2varx[3,1]) vb2 <- exp(coeffpqp2varx[2,2])/p^(coeffpqp2varx[3,2]) vb <- c(log(vb1),log(vb2)) va12 <- log(7*p^2) va22 <- log(10*p^2) vA <- matrix(c(1,va12,1,va22), ncol=2, byrow=TRUE) vy <- if(p == 2) c(8.518773,-1.851881) else if(p == 1) c(6.202284,-1.731468) else solve(vA,vb) varx <- limvarx+exp(vy[1])/(n^(-vy[2])) eb1 <- exp(coeffpqp2ex[2,1])/p^(coeffpqp2ex[3,1]) eb2 <- exp(coeffpqp2ex[2,2])/p^(coeffpqp2ex[3,2]) eb <- c(log(eb1),log(eb2)) ea12 <- log(7*p^2) ea22 <- log(10*p^2) eA <- matrix(c(1,ea12,1,ea22), ncol=2, byrow=TRUE) ey <- if(p == 2) c(3.383723,-1.081893) else if(p == 1) c(2.741737,-1.403526) else solve(eA, eb) ex <- limex + exp(ey[1])/(n^(-ey[2])) ## matching the moments q <- (varx/ex^2*p/2-1)^(-1)*(p+2) + 4 ## When n gets large, the expression for q goes to infinity, ## but is very sensitive; no harm is done by setting q equal ## to n when the expression yields negative or extremely large values if(q > n || q < 0) q <- n d <- ex*(q-2)/q list(d=d, q=q) } rrcov/R/Wilks.test.R0000644000176200001440000003034612763517421014016 0ustar liggesusersWilks.test <- function(x, ...) UseMethod("Wilks.test") Wilks.test.formula <- function(formula, data, ..., subset, na.action) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) if (.check_vars_numeric(m)) stop("Wilks test applies only to numerical variables") Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- Wilks.test.default(x, grouping, ...) res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as `formula' cl <- match.call() cl[[1]] <- as.name("Wilks.test") res$call <- cl res$contrasts <- attr(x, "contrasts") res$xlevels <- .getXlevels(Terms, m) res$na.action <- attr(m, "na.action") res } Wilks.test.data.frame <- function(x, ...) { res <- Wilks.test(structure(data.matrix(x), class="matrix"), ...) cl <- match.call() cl[[1]] <- as.name("Wilks.test") res$call <- cl res } Wilks.test.matrix <- function(x, grouping, ..., subset, na.action) { if(!missing(subset)) { x <- x[subset, , drop = FALSE] grouping <- grouping[subset] } if(!missing(na.action)) { dfr <- na.action(structure(list(g = grouping, x = x), class = "data.frame")) grouping <- dfr$g x <- dfr$x } res <- Wilks.test.default(x, grouping, ...) cl <- match.call() cl[[1]] <- as.name("Wilks.test") res$call <- cl res } ## ## Default S3 method for Wilks.test ## ## x - matrix or data frame ## grp - grouping variable - factor specifying the class for each observation ## approximation - ## method - "c" for standard estimators of the mean and variance, "mcd" for robust estimates based on MCD. ## xq - used only when method="mcd". Multiplication factor for the approximate Chi2 distribution. If NULL ## simulation will be performed to determine xq and xd (default is NULL) ## xd - used only when method="mcd". Degrees of freedom for the approximate Chi2 distribution. If NULL ## simulation will be performed to determine xq and xd (default is NULL) ## nrep - number of trials for the simulation for estimating xq and xd (default is 3000) ## trace - whether to provide trace output (default is FALSE) ## Wilks.test.default <- function(x, grouping, method=c("c", "mcd", "rank"), approximation=c("Bartlett", "Rao", "empirical"), xd=NULL, xq=NULL, xfn = NULL, xwl=NULL, nrep=3000, trace=FALSE, ...){ alpha <- 0.5 ## approximation <- "Bartlett" ## approximation <- "empirical" cl <- match.call() method <- match.arg(method) approximation <- match.arg(approximation) dname <- deparse(substitute(x)) if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") grouping <- grouping[ok] n <- nrow(x) p <- ncol(x) if(method == "rank") x <- apply(x, 2, rank) ww <- .wilks(x, grouping, method, alpha=alpha) nk <- ww$nk ng <- length(nk) wilks <- ww$wilks METHOD = NULL PARAMETER = NULL if(approximation == "Bartlett") { ## Bartlett's ChiSq approximation Y <- log(wilks) if(method == "mcd"){ if(missing(xd) || is.null(xd) || missing(xq) || is.null(xq)){ xqd <- simulateChi2(nrep=nrep, nk, p, trace=trace, alpha=alpha) xd <- xqd$xd xq <- xqd$xq xfn <- xqd$xfn xwl <- xqd$xwl } STATISTIC <- wilks chi2.value <- Y/xd df <- xq names(STATISTIC) <- "Wilks' Lambda" # "Chi2-approximation (simulated)" METHOD <- "Robust One-way MANOVA (Bartlett Chi2)" }else{ STATISTIC <- wilks chi2.value <- -(n - 1 - (p+ng)/2)*Y df <- p*(ng-1) names(STATISTIC) <- "Wilks' Lambda" # "Chi2-approximation" METHOD <- "One-way MANOVA (Bartlett Chi2)" } PVAL <- 1-pchisq(chi2.value, df) PARAMETER <- c(chi2.value, df) names(PARAMETER) <- c("Chi2-Value", "DF") }else if(approximation == "Rao"){ ## Rao's F approximation t1 <- p*p*(ng-1)*(ng-1) - 4 t2 <- p*p + (ng-1)*(ng-1) - 5 t <- if(t1==0 | t2 == 0) 1 else sqrt(t1/t2) ## t <- sqrt((p*p*(ng-1)*(ng-1) - 4)/(p*p + (ng-1)*(ng-1) - 5)) df1 <- p*(ng-1) df2 <- t*((n-1) - (p + ng)/2) - (p*(ng-1) - 2)/2 # instead of n - the total number of observations - use # the sum of weights ? Y <- wilks^(1/t) STATISTIC <- df2*(1-Y)/(df1*Y) PVAL <- 1-pf(STATISTIC, df1, df2) PARAMETER <- c(df1,df2) names(STATISTIC) <- "F-approximation" names(PARAMETER) <- c("DF1", "DF2") }else if(approximation == "empirical") { Y <- log(wilks) if(method == "mcd"){ if(missing(xd) || is.null(xd) || missing(xq) || is.null(xq)){ xqd <- simulateChi2(nrep=nrep, nk, p, trace=trace, alpha=alpha) xd <- xqd$xd xq <- xqd$xq xfn <- xqd$xfn xwl <- xqd$xwl } STATISTIC <- wilks METHOD <- "Robust One-way MANOVA (empirical distribution)" PVAL <- xfn(wilks) }else{ STATISTIC <- wilks chi2.value <- -(n - 1 - (p+ng)/2)*Y df <- p*(ng-1) names(STATISTIC) <- "Wilks' Lambda" # "Chi2-approximation" METHOD <- "One-way MANOVA (Bartlett Chi2)" PVAL <- 1-pchisq(chi2.value, df) PARAMETER <- c(chi2.value, df) names(PARAMETER) <- c("Chi2-Value", "DF") } } ans <- list(statistic=STATISTIC, parameter=PARAMETER, p.value=PVAL, estimate=ww$group.means, method=METHOD, data.name=dname, W=ww$W, T=ww$T, wilks=wilks, xd=xd, xq=xq, xfn=xfn, xwl=xwl) cl[[1]] <- as.name("Wilks.test") ans$call <- cl class(ans) <- "htest" ans } covMWcd <-function(x, grouping, alpha=0.75){ ## compute group means, pool the observations and compute the common ## covariance matrix covMWcd.B <- function(){ group.means <- matrix(0, ng, p) for(i in 1:ng){ mcd <- CovMcd(x[which(grouping == lev[i]),], alpha=alpha) group.means[i,] <- getCenter(mcd) } mcd <- CovMcd(x - group.means[g,], alpha=alpha) ans <- list(center=group.means, wcov=getCov(mcd), mah=getDistance(mcd), wt=mcd@wt) class(ans) <- "mwcd" attr(ans, "call") <- sys.call() return(ans) } x <-as.matrix(x) p <- ncol(x) n <- nrow(x) g <- as.factor(grouping) lev <- levels(g) ng <- length(lev) covMWcd.B() } ## ## Find by simulation the parameters 'd' and 'q' of the approximate Chi2 distribution ## for the robust Wilks Lambda test based on MCD ## for a given p, g and n=\sum ni ## ## nrep - number of trials (3000) ## nk - array of integers giving the group sizes, e.g. nk=c(20, 20) ## p - dimension ## simulateChi2 <- function(nrep=3000, nk, p, trace=FALSE, alpha=0.75){ if(missing(nk)) stop("The number and size of groups must be provided!") if(missing (p)) stop("The dimensipon 'p' must be provided") if(trace) cat("\nFind approximate distribution...\n") ptm <- proc.time() n <- sum(nk) ng <- length(nk) grp <- as.factor(rep(1:ng, nk)) wl <- rwl <- vector(mode = "numeric", length = nrep) for(i in 1:nrep){ # x <- as.matrix(mvrnorm(n=n, mu=rep(0,p), Sigma=diag(rep(1,p)))) x <- matrix(rnorm(n*p), ncol=p) tt <- .wilks(x, grp, method="c", alpha=alpha) rtt <- .wilks(x, grp, method="mcd", alpha=alpha) wl[i] <- tt$wilks rwl[i] <- rtt$wilks } Y <- log(wl) RY <- log(rwl) xmean <- mean(Y) xvar <- var(Y) xq <- 2*xmean*xmean/xvar xd <- xmean/xq rxmean <- mean(RY) rxvar <- var(RY) rxq <- 2*rxmean*rxmean/rxvar rxd <- rxmean/rxq rxfn <- ecdf(rwl) if(trace){ cat(sprintf('\n nrep=%5.0f p=%4.0f ng=%2.0f n=%5.0f', nrep,p,ng,n)) cat(sprintf('\n alpha=%5.2f', alpha)) cat(sprintf('\n mean var d q')) cat(sprintf('\n %5.3f %5.3f', -1/(n-1-(p*ng)/2), p*(ng-1))) cat(sprintf('\n WILKS: %5.3f %5.3f %5.3f %5.3f', xmean, xvar, xd, xq)) cat(sprintf('\nR WILKS: %5.3f %5.3f %5.3f %5.3f', rxmean, rxvar, rxd, rxq)) cat("\n") cat(" Elapsed time: ", (proc.time() - ptm)[1],"\n") } invisible(list(xd=rxd, xq=rxq, xfn=rxfn, xwl=rwl)) } .wilks <- function(x, grouping, method, alpha=0.75){ n <- nrow(x) p <- ncol(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) ## get rid of empty groups grouping <- g <- as.factor(as.character(g)) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts) if(method == "c" | method == "rank"){ wts <- rep(1, n) }else if(method == "mcd"){ mcd <- covMWcd(x, grouping=grouping, alpha=alpha) wts <- mcd$wt }else stop("Undefined method: ", method) group.means <- matrix(0,ng,p) for(i in 1:ng){ group.means[i,] <- cov.wt(x[which(grouping == lev[i]),], wt=wts[which(grouping == lev[i])])$center } wcross <- cov.wt((x - group.means[g, ]), wt=wts) wcross <- (sum(wts)-1) * wcross$cov tcross <- cov.wt(x, wt=wts) tcross <- (sum(wts)-1) * tcross$cov wilks <- det(wcross)/det(tcross) names(wilks) <- "Wilks' Lambda" names(group.means) <- names(x) dimnames(group.means) <- list(lev, dimnames(x)[[2]]) list(nk=counts, wilks=wilks, W=wcross, T=tcross, group.means=group.means) } .wilksx <- function(x, grouping, method, alpha=0.75){ n <- nrow(x) p <- ncol(x) if(!is.factor(g <- grouping)) g <- as.factor(grouping) ## get rid of empty groups g <- as.factor(as.character(g)) lev <- levels(g) counts <- as.vector(table(g)) if(any(counts == 0)) { stop(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) } ng <- length(counts) if(method == "c" | method == "rank"){ wts <- rep(1, n) }else if(method == "mcd"){ mcd <- covMWcd(x, grouping=grouping, alpha=alpha) wts <- mcd$wt }else stop("Undefined method: ", method) group.means <- matrix(0,ng,p) for(i in 1:ng){ group.means[i,] <- cov.wt(x[which(grouping == lev[i]),], wt=wts[which(grouping == lev[i])])$center } wcross <-cov.wt((x - group.means[g, ]), wt=wts) wcross <- (sum(wts)-1) * wcross$cov tcross <- cov.wt(x, wt=wts) tcross <- (sum(wts)-1) * tcross$cov wilks <- det(wcross)/det(tcross) names(wilks) <- "Wilks' Lambda" names(group.means) <- names(x) dimnames(group.means) <- list(lev, dimnames(x)[[2]]) list(nk=counts, wilks=wilks, W=wcross, T=tcross, group.means=group.means) } rrcov/R/Qda.R0000644000176200001440000000564212763517421012455 0ustar liggesuserssetMethod("show", "Qda", function(object){ if(!is.null(cl <- object@call)) { names(cl)[2] <- "" cat("Call:\n") dput(cl) } digits = max(3, getOption("digits") - 3) cat("\nPrior Probabilities of Groups:\n") print(object@prior) cat("\nGroup means:\n") print(object@center) ng <- length(object@prior) for(i in 1:ng){ cat("\nGroup: ",levels(object@grp)[i], "\n") print(object@cov[,,i]) } # cat("\nLinear Coeficients:\n") # print(object@ldf) # cat("\nConstants:\n") # print(object@ldfconst) # svd <- x$svd # names(svd) <- dimnames(x$scaling)[[2]] # if(length(svd) > 1) { # cat("\nProportion of trace:\n") # print(round(svd^2/sum(svd^2), 4), ...) # } invisible(object) }) setMethod("predict", "Qda", function(object, newdata){ ct <- FALSE if(missing(newdata)) { newdata <- object@X # use the training sample ct <- TRUE # perform cross-validation } x <- as.matrix(newdata) if(ncol(x) != ncol(object@center)) stop("wrong number of variables") ret <- .mypredictQda(object@prior, levels(object@grp), object@center, object@covinv, object@covdet, x) if(ct) ret@ct <- mtxconfusion(object@grp, ret@classification) ret }) .mypredictQda <- function(prior, lev, center, covinv, covdet, x){ ng <- length(prior) nm <- names(prior) if(is.null(nm)) nm <- lev xx <- matrix(0, nrow=nrow(x), ncol=ng) posterior <- xx for(j in 1:nrow(x)){ for(i in 1:ng){ xx[j,i] <- (x[j,]-center[i,]) %*% covinv[,,i] %*% (x[j,]-center[i,]) + log(covdet[i]) - 2*log(prior[i]) xx[j,i] <- -0.5*xx[j,i] } } for(i in 1:nrow(xx)){ tmp <- sum(exp(xx[i,])) for(j in 1:ncol(xx)) posterior[i,j] <- exp(xx[i,j])/tmp } cl <- factor(nm[max.col(xx)], levels = lev) new("PredictQda", classification=cl, posterior=posterior, x = xx) } setMethod("show", "PredictQda", function(object){ if(!is.null(object@ct)) { tab <- object@ct acctab <- t(apply(tab, 1, function(x) x/sum(x))) dimnames(acctab) <- dimnames(tab) AER <- 1 - sum(diag(tab))/sum(tab) prt <- as.matrix(round(c("Apparent error rate" = AER),4)) colnames(prt) <- "" print(prt) cat("\nClassification table", "\n") print(tab) cat("\nConfusion matrix", "\n") print(round(acctab, 3)) } else print(object@classification) ## print(object@posterior) ## print(object@x) invisible(object) }) setMethod("summary", "Qda", function(object, ...){ new("SummaryQda", qdaobj=object) }) setMethod("show", "SummaryQda", function(object){ show(object@qdaobj) invisible(object) }) rrcov/R/dets.R0000644000176200001440000002616512763517421012712 0ustar liggesusers## ## Input: ## x - a data matrix of size (n,p) ## hsets.init ## scalefn ## k - number of refining iterations in each subsample (default=2) ## best.r - number of "best betas" to remember from the subsamples. ## These will be later iterated until convergence (default=5) ## kp, cc - tunning constants for the S-estimator with Tukey's biweight ## function given the breakdown point (bdp) and the dimension p ## ## Output: a list with components ## center - robust estimate of location (vector: length) ## cov - robust estimate of scatter (matrix: p,p) ## crit - value of the objective function (number) ## ..detSloc <- function(x, hsets.init=NULL, save.hsets=missing(hsets.init), full.h=save.hsets, scalefn, maxisteps = 200, warn.nonconv.csteps = FALSE, ## k=0, # no need of preliminary refinement ## best.r=6, # iterate till convergence on all 6 sets kp, cc, trace=as.integer(trace)) { ## NOTES: ## - in the functions rho, psi, and scaledpsi=psi/u (i.e. the weight function) ## is used |x| <= c1 ## ## - function resdis() to compute the distances is used instead of ## mahalanobis() - slightly faster ## The bisquare rho function: ## ## | x^2/2 - x^4/2*c1^2 + x^6/6*c1^4 |x| <= c1 ## rho(x) = | ## | c1^2/6 |x| > c1 ## rho <- function(u, cc) { w <- abs(u) <= cc v <- (u^2/2 * (1 - u^2/cc^2 + u^4/(3*cc^4))) * w + (1-w) * (cc^2/6) v } ## The corresponding psi function: psi = rho' ## ## | x - 2x^3/c1^2 + x^5/c1^4 |x| <= c1 ## psi(x) = | ## | 0 |x| > c1 ## ## using ifelse is 3 times slower psi <- function(u, c1) { ##ifelse(abs(u) < c1, u - 2 * u^3/c1^2 + u^5/c1^4, 0) pp <- u - 2 * u^3/c1^2 + u^5/c1^4 pp*(abs(u) <= c1) } ## weight function = psi(u)/u scaledpsi <- function(u, cc) { ##ifelse(abs(xx) < c1, xx - 2 * xx^3/c1^2 + xx^5/c1^4, 0) pp <- (1 - (u/cc)^2)^2 pp <- pp * cc^2/6 pp*(abs(u) <= cc) } ## the objective function, we solve loss.S(u, s, cc) = b for "s" loss.S <- function(u, s, cc) mean(rho(u/s, cc)) norm <- function(x) sqrt(sum(x^2)) ## Returns square root of the mahalanobis distances of x with respect to mu and sigma ## Seems to be somewhat more efficient than sqrt(mahalanobis()) - by factor 1.4! resdis <- function(x, mu, sigma) { central <- t(x) - mu sqdis <- colSums(solve(sigma, central) * central) dis <- sqdis^(0.5) dis } ## Computes Tukey's biweight objective function (scale) ## (respective to the mahalanobis distances u) using the ## rho() function and the konstants kp and c1 scaleS <- function(u, kp, c1, initial.sc=median(abs(u))/.6745) { ## find the scale, full iterations maxit <- 200 eps <- 1e-20 sc <- initial.sc for(i in 1:maxit) { sc2 <- sqrt(sc^2 * mean(rho(u/sc, c1)) / kp) if(abs(sc2/sc - 1) <= eps) break sc <- sc2 } return(sc) } ## ## Do "k" iterative reweighting refining steps from "initial.mu, initial.sigma" ## ## If "initial.scale" is present, it's used, o/w the MAD is used ## ## k = number of refining steps ## conv = 0 means "do k steps and don't check for convergence" ## conv = 1 means "stop when convergence is detected, or the ## maximum number of iterations is achieved" ## kp and cc = tuning constants of the equation ## re.s <- function(x, initial.mu, initial.sigma, initial.scale, k, conv, maxisteps=200, kp, cc) { n <- nrow(x) p <- ncol(x) rdis <- resdis(x, initial.mu, initial.sigma) if(missing(initial.scale)) { initial.scale <- scale <- median(abs(rdis))/.6745 } else { scale <- initial.scale } ## if conv == 1 then set the max no. of iterations to 50 magic number alert!!! if(conv == 1) k <- maxisteps mu <- initial.mu sigma <- initial.sigma for(i in 1:k) { ## do one step of the iterations to solve for the scale scale.super.old <- scale scale <- sqrt(scale^2 * mean(rho(rdis/scale, cc)) / kp) ## now do one step of reweighting with the "improved scale" weights <- scaledpsi(rdis/scale, cc) W <- weights %*% matrix(rep(1,p), ncol=p) xw <- x * W/mean(weights) mu.1 <- apply(xw,2,mean) res <- x - matrix(rep(1,n),ncol=1) %*% mu.1 sigma.1 <- t(res) %*% ((weights %*% matrix(rep(1,p), ncol=p)) * res) sigma.1 <- (det(sigma.1))^(-1/p) * sigma.1 if(.isSingular(sigma.1)) { mu.1 <- initial.mu sigma.1 <- initial.sigma scale <- initial.scale break } if(conv == 1) { ## check for convergence if(norm(mu - mu.1) / norm(mu) < 1e-20) break ## magic number alert!!! } rdis <- resdis(x,mu.1,sigma.1) mu <- mu.1 sigma <- sigma.1 if(i >= k & warn.nonconv.csteps) warning("Convergence not reached up to max.number of iterations: ", k) } iter <- i rdis <- resdis(x,mu,sigma) ## get the residuals from the last beta ## return the number of iterations return(list(mu.rw = mu.1, sigma.rw=sigma.1, scale.rw = scale, iter=iter)) } ################################################################################################ n <- nrow(x) p <- ncol(x) h <- h.alpha.n(0.5, n, p) ## Center and scale the data z <- doScale(x, center=median, scale=scalefn) z.center <- z$center z.scale <- z$scale z <- z$x ## Assume that 'hsets.init' already contains h-subsets: the first h observations each if(is.null(hsets.init)) { hsets.init <- r6pack(z, h=h, full.h=full.h, scaled=TRUE, scalefn=scalefn) dh <- dim(hsets.init) } else { ## user specified, (even just *one* vector): if(is.vector(hsets.init)) hsets.init <- as.matrix(hsets.init) dh <- dim(hsets.init) if(!is.matrix(hsets.init) || dh[1] < h || dh[2] < 1) stop("'hsets.init' must be a h' x L matrix (h' >= h) of observation indices") if(full.h && dh[1] != n) stop("When 'full.h' is true, user specified 'hsets.init' must have n rows") } ## Construction of h-subset: take the first h observations hsets <- hsets.init[1:h, , drop=FALSE] ## select the first h ranked observations nsets <- NCOL(hsets) hset.csteps <- integer(nsets) best.r <- nsets k <- 0 best.mus <- matrix(0, best.r, p) best.sigmas <- matrix(0,best.r*p,p) best.scales <- rep(1e20, best.r) s.worst <- 1e20 n.ref <- 1 ## Iterate now through the initial h-subsets for(i in 1:nsets) { if(trace) { if(trace >= 2) cat(sprintf("H-subset %d = observations c(%s):\n-----------\n", i, paste(hsets.init[1:h,i], collapse=", "))) else cat(sprintf("H-subset %d: ", i)) } indices <- hsets[, i] # start with the i-th initial set xs <- x[indices,] mu <- colMeans(xs) sigma <- cov(xs) singular <- .isSingular(sigma) sigma <- det(sigma)^(-1/p) * sigma ## Perform k steps of iterative reweighting on the elemental set if(k > 0) { ## do the refining tmp <- re.s(x=x, initial.mu=mu, initial.sigma=sigma, k=k, conv=0, kp=kp, cc=cc) mu.rw <- tmp$mu.rw sigma.rw <- tmp$sigma.rw scale.rw <- tmp$scale.rw rdis.rw <- resdis(x, mu.rw, sigma.rw) } else { ## k = 0 means "no refining" mu.rw <- mu sigma.rw <- sigma rdis.rw <- resdis(x, mu.rw, sigma.rw) scale.rw <- median(abs(rdis.rw))/.6745 } if(i > 1) { ## if this isn't the first iteration.... ## check whether new mu/sigma belong to the top best results; if so keep ## mu and sigma with corresponding scale. scale.test <- loss.S(rdis.rw, s.worst, cc) if(scale.test < kp) { s.best <- scaleS(rdis.rw, kp, cc, scale.rw) ind <- order(best.scales)[best.r] best.scales[ind] <- s.best best.mus[ind,] <- mu.rw bm1 <- (ind-1)*p; best.sigmas[(bm1+1):(bm1+p),] <- sigma.rw s.worst <- max(best.scales) } } else { ## if this is the first iteration, then this is the best solution anyway... best.scales[best.r] <- scaleS(rdis.rw, kp, cc, scale.rw) best.mus[best.r,] <- mu.rw bm1 <- (best.r-1)*p; best.sigmas[(bm1+1):(bm1+p),] <- sigma.rw } } ## do the complete refining step until convergence (conv=1) starting ## from the best subsampling candidate (possibly refined) super.best.scale <- 1e20 for(i in best.r:1) { index <- (i-1)*p tmp <- re.s(x=x, initial.mu=best.mus[i,], initial.sigma=best.sigmas[(index+1):(index+p),], initial.scale=best.scales[i], k=0, conv=1, maxisteps=maxisteps, kp=kp, cc=cc) if(tmp$scale.rw < super.best.scale) { super.best.scale <- tmp$scale.rw super.best.mu <- tmp$mu.rw super.best.sigma <- tmp$sigma.rw ind.best <- i # to determine which subset gives best results. } hset.csteps[i] <- tmp$iter # how many I-steps necessary to converge. if(trace) cat(sprintf("%3d csteps, scale=%g", tmp$iter, tmp$scale.rw)) } super.best.sigma <- super.best.scale^2*super.best.sigma return(list( center=as.vector(super.best.mu), cov=super.best.sigma, crit=super.best.scale, iter=hset.csteps[ind.best], iBest = ind.best, hset.csteps = hset.csteps, initHsets=if(save.hsets) hsets.init, kp=kp, cc=cc, method="S-estimates: DET-S")) } rrcov/R/CovMve.R0000644000176200001440000001605012763517421013142 0ustar liggesusersCovMve <- function(x, alpha=1/2, nsamp=500, seed=NULL, trace=FALSE, control) { use.correction <- FALSE ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. defcontrol <- CovControlMcd() # default control if(!missing(control)){ if(alpha == defcontrol@alpha) alpha <- control@alpha if(nsamp == defcontrol@nsamp) nsamp <- control@nsamp if(is.null(seed) || seed == defcontrol@seed) seed <- control@seed if(trace == defcontrol@trace) trace <- control@trace } tolSolve <- defcontrol@tolSolve xcall <- match.call() if(length(seed) > 0) { if(exists(".Random.seed", envir=.GlobalEnv, inherits=FALSE)) { seed.keep <- get(".Random.seed", envir=.GlobalEnv, inherits=FALSE) on.exit(assign(".Random.seed", seed.keep, envir=.GlobalEnv)) } assign(".Random.seed", seed, envir=.GlobalEnv) } ## Options "best" and "exact" for nsamp ## nsamp will be further analized in the wrapper .fastmcd() if(!missing(nsamp) && is.numeric(nsamp) && nsamp <= 0) stop("Invalid number of trials nsamp = ",nsamp, "!") if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] h <- h.alpha.n(alpha, n, p) # h(alpha) , the size of the subsamples ######## h <- floor(n/2) if(n <= p + 1) # ==> floor((n+p+1)/2) > n - 1 -- not Ok stop(if (n <= p) # absolute barrier! "n <= p -- you can't be serious!" else "n == p+1 is too small sample size for MCD") ## else if(n < 2 * p) { ## p+1 < n < 2p warning("n < 2 * p, i.e., possibly too small sample size") } if(h > n) stop("Sample size n < h(alpha; n,p) := size of \"good\" subsample") else if(alpha > 1) stop("alpha must be <= 1") ## VT::29.07.2008 - raw.cnp2 and cnp2 are vectors of size 2 and will ## contain the correction factors (concistency and finite sample) ## for the raw and reweighted estimates respectively. Set them ## initially to 1. If use.correction is set to FALSE ## (default=FALSE), the finite sample correction factor will not ## be used (neither for the raw estimates nor for the reweighted) ## ## The finite sample correction factors for MVE are not known, except ## for the very old cnp2=(1 + 15/(n - p))^2 (Rousseeuw&van Zomeren, 1988) ## therefore will remain always 1. ## ## The consistancy factor for the raw covariance is ## cf <- median(dist)/qchisq(0.5, p) ## ## FIXME: should be ## cf <- quantile(dist, alpha)/qchisq(alpha, p) ## raw.cnp2 <- cnp2 <- c(1,1) ## Case: alpha==1 ## ... ## ... ## Case p == 1 method <- "Minimum volume ellipsoid estimator" mve <- .fastmve(x, h, nsamp) ## Compute the consistency correction factor for the raw MCD ## (see calfa in Croux and Haesbroeck) ## calpha <- .MCDcons(p, h/n) ## VT::19.3.2007 mvecov <- cov.wt(x[mve$best,]) rcenter <- mvecov$center rcov <- mvecov$cov mah <- mahalanobis(x, rcenter, rcov, tol = tolSolve) calpha <- quantile(mah, h/n)/qchisq(h/n, p) # as in MASS names(calpha) <- NULL correct <- if(use.correction) (1 + 15/(n - p))^2 else 1. raw.cnp2 <- c(calpha, correct) rcov <- calpha * correct * rcov ## Again consider p == 1 ## else, i.e. p >= 2 ## handle exact fit, i.e. not general position situtations ## ## OK, in general position and mve$cov is not singular ## do reweighting ## FIXME: here we assume that mve$cov is not singular ## ----- but it could be! quantiel <- qchisq(0.975, p) mah <- mahalanobis(x, rcenter, rcov, tol = tolSolve) weights <- as.numeric(mah < quantiel) sum.w <- sum(weights) ## Compute and apply the consistency correction factor for ## the reweighted cov if(sum.w == n) { cdelta.rew <- 1 correct.rew <- 1 }else { cdelta.rew <- .MCDcons(p, sum.w/n) ## VT::: 19.07.2008 correct.rew <- if(use.correction) 1 else 1. cnp2 <- c(cdelta.rew, correct.rew) } xcov <- cov.wt(x, wt = weights) xcov$cov <- cdelta.rew * correct.rew * xcov$cov raw.mah <- mah raw.weights <- weights ## Check if the reweighted scatter matrix is singular and ## compute distances and weights based on it if( - (determinant(xcov$cov, logarithm = TRUE)$modulus[1] - 0)/p > 50) { ## ans$singularity <- list(kind = "reweighted.MCD") if(trace) cat("The reweighted MCD scatter matrix is singular.\n") mah <- raw.mah } else { mah <- mahalanobis(x, xcov$center, xcov$cov, tol = tolSolve) weights <- as.numeric(mah < quantiel) } ## ans <- new("CovMve", call=xcall, iter=nsamp, crit=mve$scale, cov=xcov$cov, center=xcov$center, mah=mah, wt=weights, n.obs=n, X=x, method=method, best=mve$best, alpha=alpha, quan=h, raw.center=rcenter, raw.cov=rcov, raw.mah=raw.mah, raw.wt=raw.weights, raw.cnp2=raw.cnp2, cnp2=cnp2 ) ans } .fastmve <- function(x, h, nsamp) { dx <- dim(x) n <- dx[1] p <- dx[2] nind <- p+1 tmp <- .C('r_fast_mve', x = if(is.double(x)) x else as.double(x), as.integer(n), as.integer(p), as.integer(nsamp), nsing = as.integer(0), ctr = as.double(rep(0,p)), cov = as.double(rep(0,p*p)), scale = as.double(0), best=as.integer(rep(0,n)), as.integer(nind), as.integer(h), as.double(qchisq(0.5, p)), PACKAGE="rrcov") mve.cov <- matrix(tmp$cov, p, p) return(list(center= tmp$ctr, cov=mve.cov, scale=tmp$scale, best=tmp$best[1:h], nsamp=nsamp, nsing = tmp$nsing)) } rrcov/R/CovRobust.R0000644000176200001440000002271313566601425013674 0ustar liggesusers## control can be a character specifying the name of the estimate, one of: ## auto, mcd, ogk, m, mve, sfast, surreal, bisquare, rocke ## If no control object is given or 'auto' is selected, the choice of the ## estimator will depend on the size of the data: ## - Stahel-Donoho: n < 1000 and p < 10 or n < 5000 and p < 5 ## - MCD: n < 50000 and p < 20 ## - OGK: otherwise ## CovRobust <- function(x, control, na.action = na.fail) { x <- na.action(x) if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) n <- nrow(x) p <- ncol(x) control <- .covRobustControl(control, n, p) restimate(control, x) } .covRobustControl <- function(method, n, p) { mm <- NULL if(missing(method)) mm <- "auto" else if(is.character(method)) mm <- casefold(method) ## either no control specified or the estimator is given by a character name - ## create the necessary control object. if(!is.null(mm)){ control <- switch(mm, auto = { if(missing(n) || missing(p)) CovControlMcd() else if(n < 1000 && p < 10 || n < 5000 && p < 5) CovControlSde() else if(n < 50000 && p < 10) CovControlSest(method="bisquare") else if(n < 50000 && p < 20) CovControlSest(method="rocke") else CovControlOgk(smrob="s_mad", svrob="qc") }, sde = CovControlSde(), mcd = CovControlMcd(), ogk = CovControlOgk(), m = CovControlMest(), mve = CovControlMve(), sfast = CovControlSest(method="sfast"), surreal = CovControlSest(method="surreal"), bisquare = CovControlSest(method="bisquare"), rocke = CovControlSest(method="rocke")) ## this is the 'default' option of the switch if(is.null(control)) stop(paste("Undefined estimator: ", method)) } else control <- method control } setMethod("isClassic", "CovRobust", function(obj) FALSE) setMethod("isClassic", "SummaryCovRobust", function(obj) FALSE) setMethod("getMeth", "CovRobust", function(obj) obj@method) setMethod("getRaw", "CovRobust", function(obj){ if(is(obj, "CovMcd") | is(obj, "CovMve") | is(obj, "CovOgk")) { obj@center <- obj@raw.center obj@cov <- obj@raw.cov obj@mah <- obj@raw.mah obj@wt <- obj@raw.wt } if(is(obj, "CovMcd") | is(obj, "CovMve")) { obj@cnp2 <- obj@raw.cnp2 } invisible(obj) }) ## ## Follow the standard methods: show, summary, plot ## setMethod("show", "CovRobust", function(object){ cat("\nCall:\n") print(object@call) cat("-> Method: ", object@method, "\n") if(is.list(object@singularity)) cat(strwrap(.MCDsingularityMsg(object@singularity, object@n.obs)), sep ="\n") digits = max(3, getOption("digits") - 3) cat("\nRobust Estimate of Location: \n") print.default(format(getCenter(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nRobust Estimate of Covariance: \n") print.default(format(getCov(object), digits = digits), print.gap = 2, quote = FALSE) invisible(object) }) setMethod("summary", "CovRobust", function(object, ...){ new("SummaryCovRobust", covobj=object, evals=eigen(object@cov)$values) }) setMethod("show", "SummaryCovRobust", function(object){ cat("\nCall:\n") print(object@covobj@call) digits = max(3, getOption("digits") - 3) cat("\nRobust Estimate of Location: \n") print.default(format(getCenter(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nRobust Estimate of Covariance: \n") print.default(format(getCov(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nEigenvalues of covariance matrix: \n") print.default(format(getEvals(object), digits = digits), print.gap = 2, quote = FALSE) cat("\nRobust Distances: \n") print.default(format(as.vector(getDistance(object)), digits = digits), print.gap = 2, quote = FALSE) }) ## VT::17.06.2008 ##setMethod("plot", "CovRobust", function(x, y="missing", setMethod("plot", signature(x="CovRobust", y="missing"), function(x, y="missing", which=c("dd", "all", "distance", "qqchi2", "tolEllipsePlot", "pairs", "screeplot", "xydistance", "xyqqchi2"), classic= FALSE, ask = (which=="all" && dev.interactive(TRUE)), cutoff, id.n, labels.id = rownames(x$X), tol = 1e-7, ...) { data <- getData(x) ## parameters and preconditions if(is.vector(data) || is.matrix(data)) { if(!is.numeric(data)) stop( "x is not a numeric dataframe or matrix.") } else if(is.data.frame(data)) { if(!all(sapply(data,data.class) == "numeric")) stop( "x is not a numeric dataframe or matrix.") } n <- dim(data)[1] p <- dim(data)[2] if(length(getCenter(x)) == 0 || length(getCov(x)) == 0) stop( "Invalid object: attributes center and cov missing!") if(length(getCenter(x)) != p) stop( "Data set and provided center have different dimensions!") ## Check for singularity of the cov matrix if(isSingular(x)) stop("The covariance matrix is singular!") if(missing(cutoff)) cutoff <- sqrt(qchisq(0.975, p)) if(!missing(id.n) && !is.null(id.n)) { id.n <- as.integer(id.n) if(id.n < 0 || id.n > n) stop(sQuote("id.n")," must be in {1,..,",n,"}") } ## VT::12.11.2018 - In case of MRCD we can use also classic regularized estimate if(inherits(x, "CovMrcd")) { ccov <- CovMrcd(data, alpha=1) md <- sqrt(getDistance(ccov)) rd <- sqrt(getDistance(x)) } else { ccov <- CovClassic(data) md <- rd <- NULL if(!isSingular(ccov)) md <- sqrt(getDistance(ccov)) if(!isSingular(x)) rd <- sqrt(getDistance(x)) } which <- match.arg(which) op <- if (ask) par(ask = TRUE) else list() on.exit(par(op)) ## distance-distance plot: here we need both robust and mahalanobis distances if((which == "all" || which == "dd") && !is.null(md) && !is.null(rd)) { .myddplot(md, rd, cutoff=cutoff, id.n=id.n, ...) # distance-distance plot } ## index plot of mahalanobis distances if((which == "all" || which == "distance") && !is.null(rd)) { ylim <- NULL if(classic && !is.null(md)) { opr <- if(prod(par("mfrow")) == 1) par(mfrow=c(1,2), pty="m") else list() ##VT::10.11.2007 - set same scale on both plots ylim <- c(min(rd,md), max(md,rd)) } .mydistplot(rd, cutoff=cutoff, id.n=id.n, ...) # index plot of robust distances if(classic && !is.null(md)) { .mydistplot(md, cutoff=cutoff, classic=TRUE, id.n=id.n, ylim=ylim, ...) # index plot of mahalanobis distances par(opr) } } ## lattice: index plot of mahalanobis distances if(which == "xydistance" && !is.null(rd)) { print(.xydistplot(x, cutoff=cutoff, ...)) # lattice: index plot of robust distances } ## qq-plot of the mahalanobis distances versus the ## quantiles of the chi-squared distribution if((which == "all" || which == "qqchi2") && !is.null(rd)) { if(classic && !is.null(md)) { opr <- if(prod(par("mfrow")) == 1) par(mfrow=c(1,2), pty="m") else list() } .qqplot(rd, p, cutoff=cutoff, id.n=id.n, ...) # qq-plot of the robust distances versus the # quantiles of the chi-squared distribution if(classic && !is.null(md)) { .qqplot(md, p, cutoff=cutoff, classic=TRUE, id.n=id.n, ...) # qq-plot of the mahalanobis distances par(opr) } } ## lattice: qq-plot of the mahalanobis distances versus the ## quantiles of the chi-squared distribution if(which == "xyqqchi2" && !is.null(rd)) { print(.xyqqchi2(x, cutoff=cutoff, ...)) # lattice: qq-plot of the distances versus } if(which == "tolEllipsePlot" || which == "pairs") { if(which == "tolEllipsePlot" & length(dim(data)) >= 2 && dim(data)[2] == 2){ if(!is.null(rd)){ if(classic && !is.null(md)) .tolellipse(rcov=x, ccov = ccov, cutoff=cutoff, id.n=id.n, tol=tol, ...) else .tolellipse(rcov=x, cutoff=cutoff, id.n=id.n, tol=tol, ...) } }else if(length(dim(data)) >= 2 && dim(data)[2] <= 10) { .rrpairs(x, ...) }else if(which != "all") warning("Warning: For tolerance ellipses the dimension must be less than 10!") } if(which == "all" || which == "screeplot") { myscreeplot(ccov=ccov, rcov=x) } }) ## end { plot("CovRobust") } rrcov/R/LdaPP.R0000644000176200001440000002422512763517421012706 0ustar liggesusers## The S3 version LdaPP <- function (x, ...) UseMethod("LdaPP") LdaPP.formula <- function(formula, data, subset, na.action, ...) { m <- match.call(expand.dots = FALSE) m$... <- NULL m[[1]] <- as.name("model.frame") m <- eval.parent(m) Terms <- attr(m, "terms") grouping <- model.response(m) x <- model.matrix(Terms, m) xint <- match("(Intercept)", colnames(x), nomatch=0) if(xint > 0) x <- x[, -xint, drop=FALSE] res <- LdaPP.default(x, grouping, ...) ## res$terms <- Terms ## fix up call to refer to the generic, but leave arg name as 'formula' cl <- match.call() cl[[1]] <- as.name("LdaPP") res@call <- cl ## res$contrasts <- attr(x, "contrasts") ## res$xlevels <- .getXlevels(Terms, m) ## res$na.action <- attr(m, "na.action") res } LdaPP.default <- function(x, grouping, prior = proportions, tol = 1.0e-4, method = c("huber", "mad", "sest", "class"), optim = FALSE, trace=FALSE, ...) { if(is.null(dim(x))) stop("x is not a matrix") method <- match.arg(method) xcall <- match.call() x <- as.matrix(x) n <- nrow(x) p <- ncol(x) if(length(grouping) == 1) { ## this is the number of groups and the groups are of equal size ng = grouping ni = n/ng if(ng*ni < n) stop("nrow(x) is not divisible by the number of groups") grouping <- rep(0,0) for(i in 1:ng) grouping <- c(grouping, rep(i,ni)) }else if(length(grouping) > 1 && length(grouping) < n) { ## grouping contains a vector with the group sizes ng <- length(grouping) if(sum(grouping) != n) stop("nrow(x) is not equal to n1+n2+...+nn") gx <- rep(0,0) for(i in 1:ng) gx <- c(gx, rep(i,grouping[i])) grouping <- gx } if(n != length(grouping)) stop("nrow(x) and length(grouping) are different") g <- as.factor(grouping) lev <- lev1 <- levels(g) counts <- as.vector(table(g)) if(!missing(prior)) { if(any(prior < 0) || round(sum(prior), 5) != 1) stop("invalid prior") if(length(prior) != nlevels(g)) stop("prior is of incorrect length") prior <- prior[counts > 0] } if(any(counts == 0)) { warning(paste("group(s)", paste(lev[counts == 0], collapse=" "),"are empty")) lev1 <- lev[counts > 0] g <- factor(g, levels=lev1) counts <- as.vector(table(g)) } proportions <- counts/n ng <- length(proportions) names(g) <- NULL names(prior) <- levels(g) ############################################################# mrob <- if(method == "huber") .mrob.huber else if(method == "mad") .mrob.mad else if(method == "sest") .mrob.s else if(method == "class") .mrob.sd ## We have only two groups! n1 <- counts[1] n2 <- counts[2] ## a1 <- (n1-1)/(n-2) a1 <- n1/n a2 <- 1 - a1 raw.ldf <- ldf <- matrix(0, nrow=2, ncol=p) raw.ldfconst <- ldfconst <- rep(0,2) alpha <- .projpp(x, grp=g, a1, a2, mrob) dx <- .det.a0(alpha, x, grp=g, a1=a1, a2=a2, mrob=mrob, prior=prior) raw.ldf[1,] <- dx$alpha raw.ldfconst[1] <- dx$alpha0 ldf <- raw.ldf ldfconst <- raw.ldfconst if(optim) { sol.1 <- optim(dx$alpha, .auxPP, x=x, grp=g, a1=a1, a2=a2, mrob=mrob) if(sol.1$convergence != 0) sol.1 <- optim(sol.1$par, .auxPP, x=x, grp=g, a1=a1, a2=a2, mrob=mrob) dx <- .det.a0(sol.1$par, x, grp=g, a1=a1, a2=a2, mrob=mrob, prior=prior) ldf[1,] <- dx$alpha ldfconst[1] <- dx$alpha0 } return (new("LdaPP", call=xcall, prior=prior, counts=counts, raw.ldf=raw.ldf, raw.ldfconst=raw.ldfconst, ldf=ldf, ldfconst=ldfconst, method=method, X=x, grp=g)) } .projpp <- function(x, grp, a1, a2, mrob) { lev <- levels(grp) counts <- as.vector(table(grp)) p <- ncol(x) n1 <- counts[1] n2 <- counts[2] X1 <- x[grp == lev[1],] X2 <- x[grp == lev[2],] inull <- 0 dmax <- 0 alpha <- NULL imax <- 0 jmax <- 0 for(i in 1:n1) { for(j in 1:n2) { aux <- sqrt(sum((X1[i,] - X2[j,])**2)) dx <- (X1[i,] - X2[j,])/aux px1 <- as.vector(t(X1%*%dx)) px2 <- as.vector(t(X2%*%dx)) m1 <- mrob(px1) m2 <- mrob(px2) if(is.null(m1$mu) | is.null(m1$s) | is.null(m2$mu) | is.null(m2$s)) { inull <- inull + 1 if(inull > 10) stop("Too many unsuccessful S-estimations!") }else { xdist <- (m1$mu - m2$mu)**2/(m1$s**2*a1 + m2$s**2*a2) if(xdist > dmax) { dmax <- xdist alpha <- dx imax <- i jmax <- j } } } } alpha } .det.a0 <- function(alpha, x, grp, a1, a2, mrob, prior) { lev <- levels(grp) counts <- as.vector(table(grp)) p <- ncol(x) n1 <- counts[1] n2 <- counts[2] n <- n1 + n2 alpha <- alpha/sqrt(sum(alpha**2)) px <- as.vector(t(x%*%alpha)) m1 <- mrob(px[grp == lev[1]]) m2 <- mrob(px[grp == lev[2]]) if(m1$mu < m2$mu) { alpha <- -1*alpha m1$mu <- -1*m1$mu m2$mu <- -1*m2$mu } alpha0 <- -((m1$mu + m2$mu)/2 + log(prior[2]/prior[1])/(m1$mu - m2$mu)*(a1*m1$s**2 + a2*m2$s**2)) names(alpha0) <- NULL list(alpha=alpha, alpha0=alpha0) } ## ## A function to be maximized by Nelder and Mead algorithm in optim(), ## with first argument the vector of parameters over which ## maximization is to take place. It returns a scalar result. ## ## The initial values are from the projection algorithm ## .auxPP <- function(alpha, x, grp, a1, a2, mrob) { lev <- levels(grp) counts <- as.vector(table(grp)) p <- ncol(x) n1 <- counts[1] n2 <- counts[2] n <- n1 + n2 px <- as.vector(t(x%*%alpha)) m1 <- mrob(px[grp == lev[1]]) m2 <- mrob(px[grp == lev[2]]) ret <- -(m1$mu - m2$mu)**2/(m1$s**2*a1 + m2$s**2*a2) if(is.null(ret)) ret <- NA if(length(ret) == 0) { cat("\nERROR: length of distance for 'optim' equal to 0: ", ret, "\n") ret <- NA } ret } .mrob.sd <- function(y) { list(mu=mean(y, na.rm=TRUE), s=sd(y, na.rm=TRUE)) } .mrob.mad <- function(y) { list(mu=median(y, na.rm=TRUE), s=mad(y, na.rm=TRUE)) } .mrob.s <- function(y) { aux <- lmrob(y ~ 1) mu <- aux$init.S$coef names(mu) <- NULL s <- aux$init.S$scale ## mm=CovSest(as.matrix(y)) ## list(mu=mm@center, s=mm@cov[1,1]) list(mu=mu, s=s) } .mrob.huber <- function(y, k1=1.5, k2=2, tol=1e-06, iter=8) { if(any(i <- is.na(y))) y <- y[!i] n <- length(y) ## replicate the huberM() function from robustbase and add an ## iter parameter to be able to reproduce Ana's results # mx1 <- huberM(y, k=k1, tol=tol) mx1 <- .huberM(y, k=k1, tol=tol, iter=iter) k <- k2 mu <- median(y) s0 <- mx1$s th <- 2 * pnorm(k) - 1 beta <- th + k^2 * (1 - th) - 2 * k * dnorm(k) it <- 0:0 repeat { it <- it + 1:1 yy <- pmin(pmax(mu - k * s0, y), mu + k * s0) ss <- sum((yy - mu)^2)/n s1 <- sqrt(ss/beta) ## if(abs(s0-s1) < tol || (iter > 0 & it > iter)) if(it > iter) break s0 <- s1 } list(mu=mx1$mu, s=s0, it1=mx1$it, it2=it) } ## ## This is from robustbase - I added 'iter' parameter, ## only to be able to reproduce exactly na Pires' LdaPP ## FIXME: remove later ## .huberM <- function (x, k = 1.5, weights = NULL, tol = 1e-06, mu = if (is.null(weights)) median(x) else wgt.himedian(x, weights), s = if (is.null(weights)) mad(x, center = mu) else wgt.himedian(abs(x - mu), weights), warn0scale = getOption("verbose"), iter=8) { if (any(i <- is.na(x))) { x <- x[!i] if (!is.null(weights)) weights <- weights[!i] } n <- length(x) sum.w <- if (!is.null(weights)) { stopifnot(is.numeric(weights), weights >= 0, length(weights) == n) sum(weights) } else n it <- 0:0 if (sum.w == 0) return(list(mu = NA, s = NA, it = it)) if (s <= 0) { if (s < 0) stop("negative scale 's'") if (warn0scale && n > 1) warning("scale 's' is zero -- returning initial 'mu'") } else { wsum <- if (is.null(weights)) sum else function(u) sum(u * weights) repeat { it <- it + 1:1 y <- pmin(pmax(mu - k * s, x), mu + k * s) mu1 <- wsum(y)/sum.w ## if (abs(mu - mu1) < tol * s) if (it > iter) break mu <- mu1 } } list(mu = mu, s = s, it = it) } ## ## Predict method for LdaPP - additional parameter raw=FALSE. ## If set to TRUE, the prediction will be done using the raw estimates ## (obtained by the first approximation algorithm). ## setMethod("predict", "LdaPP", function(object, newdata, raw=FALSE){ ct <- FALSE if(missing(newdata)) { newdata <- object@X # use the training sample ct <- TRUE # perform cross-validation } x <- as.matrix(newdata) if(length(object@center)>0 & ncol(x) != ncol(object@center) | ncol(x) != ncol(object@ldf)) stop("wrong number of variables") ldf <- if(raw) object@raw.ldf else object@ldf ldfconst <- if(raw) object@raw.ldfconst else object@ldfconst ret <- .mypredictLda(object@prior, levels(object@grp), ldf, ldfconst, x) if(ct) ret@ct <- mtxconfusion(object@grp, ret@classification) ret }) rrcov/R/covMest3.R0000644000176200001440000000510712763517421013447 0ustar liggesuserscovMest <- function(x, cor=FALSE, r = 0.45, arp = 0.05, eps=1e-3, maxiter=120, control, t0, S0) { .Deprecated(new="CovMest") ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. if(!missing(control)){ defcontrol <- rrcov.control() # default control # if(r == defcontrol$r) r <- control$r # if(arp == defcontrol$arp) arp <- control$arp # if(eps == defcontrol$eps) eps <- control$eps # if(maxiter == defcontrol$maxiter) maxiter <- control$maxiter } if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] if(n < 2 * p) stop("Need at least 2*(number of variables) observations ") ans <- list(method = "M-Estimates", call = match.call()) ## If not provided initial estimates, compute them as MVE ## Take the raw estimates and standardise the covariance ## matrix to determinant=1 if(missing(t0) || missing(S0)){ mcd <- CovMve(x) t0 <- mcd@raw.center S0 <- mcd@raw.cov detS0 <-det(S0) detS02 <- detS0^(1.0/p) S0 <- S0/detS02 } ## calculate the constants M and c ## for the translated biweight function psix <- new("PsiBwt", n=n, p=p, r=r, alpha=arp) psix <- csolve(psix) mest <- iterM(psix, x, t0, S0, eps=1e-3, maxiter=maxiter) ## this was the version without OO ##const <- csolve.bt(n, p, r, arp) ##mest <- .iterM(x, t0, S0, const$c1, const$M, eps, maxiter) ans$n.obs <- n ##ans$c1 <- const$c1 ##ans$M <- const$M ans$c1 <- psix@c1 ans$M <- psix@M ans$iter <- mest$iter ans$cov <- mest$s ans$center <- mest$t1 ans$mah <- mahalanobis(x, mest$t1, mest$s) ans$crit <- determinant(mest$s, logarithm = TRUE)$modulus[1] if(cor && !is.null(ans$cov)) cor <- cov2cor(ans$cov) class(ans) <- c("mest", "mcd") attr(ans, "call") <- sys.call() ans$method <- paste("M-Estimator.") ans$X <- x return(ans) } rrcov/R/CovMMest.R0000644000176200001440000002022212763517421013434 0ustar liggesusersCovMMest <- function(x, bdp=0.5, eff=0.95, eff.shape=TRUE, maxiter=50, trace=FALSE, tolSolve=1e-7, control ) { ## NOTES: ## - in the functions rho, psi, and scaledpsi=psi/u (i.e. the weight function) ## is used |x| <= c1 ## ## The bisquare rho function: ## ## | x^2/2 - x^4/2*c1^2 + x^6/6*c1^4 |x| <= c1 ## rho(x) = | ## | c1^2/6 |x| > c1 ## rho <- function(u, cc) { w <- abs(u) <= cc v <- (u^2/2 * (1 - u^2/cc^2 + u^4/(3*cc^4))) * w + (1-w) * (cc^2/6) v } ## The corresponding psi function: psi = rho' ## ## | x - 2x^3/c1^2 + x^5/c1^4 |x| <= c1 ## psi(x) = | ## | 0 |x| > c1 ## ## using ifelse is 3 times slower psi <- function(u, c1) { ##ifelse(abs(u) < c1, u - 2 * u^3/c1^2 + u^5/c1^4, 0) pp <- u - 2 * u^3/c1^2 + u^5/c1^4 pp*(abs(u) <= c1) } ## weight function = psi(u)/u scaledpsi <- function(u, cc) { ##ifelse(abs(xx) < c1, xx - 2 * xx^3/c1^2 + xx^5/c1^4, 0) pp <- (1 - (u/cc)^2)^2 pp <- pp * cc^2/6 pp*(abs(u) <= cc) } ## the objective function, we solve loss.S(u, s, cc) = b for "s" loss <- function(u, s, cc) mean(rho(u/s, cc)) ## Returns square root of the mahalanobis distances of x with respect to mu and sigma ## Seems to be somewhat more efficient than sqrt(mahalanobis()) - by factor 1.4! resdis <- function(x, mu, sigma) { central <- t(x) - mu sqdis <- colSums(solve(sigma, central) * central) dis <- sqdis^(0.5) dis } ## ## Compute weighted mean and covariance matrix ## The covariance is scaled to have det=1 ## covw <- function(x, wt=rep(1, nrow(x))) { if (is.data.frame(x)) x <- as.matrix(x) else if (!is.matrix(x)) stop("'x' must be a matrix or a data frame") if (!all(is.finite(x))) stop("'x' must contain finite values only") n <- nrow(x) p <- ncol(x) if(with.wt <- !missing(wt)) { if(length(wt) != n) stop("length of 'wt' must equal the number of rows in 'x'") if(any(wt < 0) || (s <- sum(wt)) == 0) stop("weights must be non-negative and not all zero") } center <- colSums(wt * x)/s x <- sqrt(wt) * sweep(x, 2, center, check.margin = FALSE) cov <- crossprod(x) cov <- det(cov)^(-1/p) * cov ret <- list(cov = cov, center = center, n.obs = n) ret } ## Analize and validate the input parameters ... ## if a control object was supplied, take the option parameters from it, ## but if single parameters were passed (not defaults) they will override the ## control object. scontrol <- CovControlSest() if(!missing(control)){ defcontrol <- CovControlMMest() # default control if(bdp == defcontrol@bdp) bdp <- control@bdp # if(eff == defcontrol@eff) eff <- control@eff # if(maxiter == defcontrol@maxiter) maxiter <- control@maxiter # for bisquare and rocke if(trace == defcontrol@trace) trace <- control@trace if(tolSolve == defcontrol@tolSolve) tolSolve <- control@tolSolve scontrol <- control@sest scontrol@bdp = bdp } if(is.data.frame(x)) x <- data.matrix(x) else if (!is.matrix(x)) x <- matrix(x, length(x), 1, dimnames = list(names(x), deparse(substitute(x)))) xcall <- match.call() ## drop all rows with missing values (!!) : na.x <- !is.finite(x %*% rep(1, ncol(x))) ok <- !na.x x <- x[ok, , drop = FALSE] dx <- dim(x) if(!length(dx)) stop("All observations have missing values!") dimn <- dimnames(x) n <- dx[1] p <- dx[2] ## compute the constant c1 for the rho function of the MM-estimates c1 <- .csolve.bw.MM(p, eff, eff.shape=eff.shape) if(trace) cat("\nMM-EST...: bdp, eff, eff.shape, p, c1=", bdp, eff, eff.shape, p, c1, "\n") ## Compute the initial S-estimate ss <- CovSest(x, control=scontrol, trace=trace) if(trace) { cat("\nInitial S-estimates. Scale=", ss@crit, "\n") print(ss) } scale <- ss@crit cova <- getShape(ss) center <- getCenter(ss) rdis <- resdis(x, center, cova) keep <- ocrit <- crit <- loss(rdis, scale, c1) if(trace) { cat("\nInitial robust distances:\n") print(rdis) } ## Compute M-estimate with auxiliary scale. ## Start from an S-estimate and perform reweighted ## location/covariance steps for(iter in 1:maxiter) { if(trace) cat("\nITER=", iter,"\n") w <- scaledpsi(rdis/scale, c1) center <- as.vector(crossprod(w, x) / sum(w)) ccc <- covw(x, w) center <- ccc$center cova <- ccc$cov rdis <- resdis(x, center, cova) crit <- loss(rdis, scale, c1) ## cat("\noldobj, newobj, iter:",oldobj, newobj, oldobj-newobj, oldobj - newobj > tolSolve, iter,"\n") if(ocrit - crit <= tolSolve) break ocrit <- crit } cova <- cova*scale^2 ## Check if the loss function was at all reduced by ## the M-iterations. If not (which should never happen) ## simply return the S-estimate if(crit > keep) { center <- ss@center cova <- ss@cov } ans <- new("CovMMest", call = xcall, iter=iter, crit=ss@crit, cov=cova, center=center, c1=c1, n.obs=n, X = as.matrix(x), sest=ss, method="MM-estimates") ans } ## ## Compute the constant for the second Tukey Biweight rho-function for MM ## with for fixed shape-efficiency ## ## Adapted from Gert Willems: ## http://users.ugent.be/~svaelst/software/MMPCAboot.html ## .csolve.bw.MM <- function(p, eff, eff.shape=TRUE) { ## (taken from Claudia Becker's Sstart0 program) chi.int <- function(p, a, c1) { ## partial expectation d in (0,c1) of d^a under chi-squared p return(exp(lgamma((p + a) /2) - lgamma(p/2)) * 2^{a/2} * pchisq(c1^2, p + a)) } loceff.bw <- function(p, c1) { # called by csolve.bw.MM(); computes location efficiency corresponding to c1 alpha1 <- 1/p * (chi.int(p,2,c1) - 4*chi.int(p,4,c1)/(c1^2) + 6*chi.int(p,6,c1)/(c1^4) - 4*chi.int(p,8,c1)/(c1^6) + chi.int(p,10,c1)/(c1^8)) beta1.1 <- chi.int(p,0,c1) - 2*chi.int(p,2,c1)/(c1^2) + chi.int(p,4,c1)/(c1^4) beta1.2 <- chi.int(p,0,c1) - 6*chi.int(p,2,c1)/(c1^2) + 5*chi.int(p,4,c1)/(c1^4) beta1 <- (1-1/p)*beta1.1 + 1/p*beta1.2 return( beta1^2 / alpha1 ) } sigma1.bw <- function(p, c1) { gamma1.1 <- chi.int(p,2,c1) - 6*chi.int(p,4,c1)/(c1^2) + 5*chi.int(p,6,c1)/(c1^4) gamma1.2 <- chi.int(p,2,c1) - 2*chi.int(p,4,c1)/(c1^2) + chi.int(p,6,c1)/(c1^4) gamma1 <- (gamma1.1 + (p+1)*gamma1.2) / (p+2) sigma1.0 <- chi.int(p,4,c1) - 4*chi.int(p,6,c1)/(c1^2) + 6*chi.int(p,8,c1)/(c1^4) - 4*chi.int(p,10,c1)/(c1^6) + chi.int(p,12,c1)/(c1^8) return(sigma1.0 / (gamma1^2) * p/(p+2)) } maxit <- 1000 eps <- 1e-8 ## ctest <- csolve.bw.asymp(p,.5) cold <- ctest <- -.4024 + 2.2539 * sqrt(p) # very precise approximation for c corresponding to 50% bdp for(iter in 1:maxit) { ctest <- if(eff.shape) ctest * eff * sigma1.bw(p, ctest) else ctest * eff / loceff.bw(p, ctest) if(abs(cold-ctest) <= eps) break cold <- ctest } return(ctest) } rrcov/MD50000644000176200001440000002557713610127007011732 0ustar liggesusers3e58c27a78717694ed6588866cff6485 *ChangeLog c71c126ed1f8ffd11cb2278a7cc9f78f *DESCRIPTION 45bdb0c2375c6fdf31a4c222a649f551 *NAMESPACE ce701b02810d7e088273e45ada6b9010 *R/AllClasses.R 2621b703a070a9cd1b9ca2b755e763d4 *R/AllGenerics.R 89ef1ac3a66741a805398b182367e500 *R/Cov.R 60b5c1fc509c2a1b3dc42703a58f22e9 *R/CovClassic.R a251d2fd0a1a2832a49eb128ae24783f *R/CovControl.R d5213b624b9c2424aa706d1600a87c34 *R/CovMMest.R f67189295e5bc982dc78ccfa6655e443 *R/CovMcd.R 7e71f38495389ced9e788151c196fe4a *R/CovMest.R 0bfe6fd9084c3f46acd7d80fd1f6aaad *R/CovMrcd.R 9544d6ab30f55290886cffe34b6ea3b5 *R/CovMve.R e37a6bf70cfc6570731adafd7a6e8105 *R/CovOgk.R 0c633130bb04693e28191981e929f732 *R/CovRobust.R 574a90e594f83533862c70c3fb1e1ff9 *R/CovSde.R 3c54ba7ac0de81bcb7773ae3cbf240a3 *R/CovSest.R 68c34b29dbfcf037efb45906f24b0f2c *R/Lda.R 6e9c08123c0cfb08471de32222065527 *R/LdaClassic.R 79e8c4f4ace04e529a247dc34aaa8178 *R/LdaPP.R 4a0e6f8505ec511da801a64a7de59a92 *R/Linda.R d4b1e54205a5ff8e93f81b646e54ca64 *R/Pca.R 0d309301e37d516bef369d9f36cebfb9 *R/PcaClassic.R 75d874c217f0135057c99e74465e6a52 *R/PcaCov.R 139fcd1d9e94a6c479452fcf85652158 *R/PcaGrid.R 5a06f0ce83acbf982fe3a9e75200bc86 *R/PcaHubert.R 11689ed5e05d9c267bbb940dbaf9d312 *R/PcaLocantore.R cb1cc2658afac0ad584e9bfdbd4145dd *R/PcaProj.R 16c1b7d22de82739325c854e1237a0b4 *R/Qda.R 182e11977a3de4ea9a69183eee31a082 *R/QdaClassic.R a1959e4b3c1dfe604f6af39d6aed6da5 *R/QdaCov.R 87c98f445f110cee96b8a72ea2a86d78 *R/T2.test.R 8d653e5da779ecacdd895945c377abf1 *R/Wilks.test.R 2dc89d15454adf96bdf3091bc436bf17 *R/covMest3.R 64fe6f0d948e281b7047b4921786b59c *R/da-utils.R 25a5fe6f3c0bc42acd775034eb6f006d *R/detmrcd.R 0c36abbd8796244b63400966be36ccd2 *R/dets.R 649f519e49932382f68de71ef9cbe6ba *R/donostah.R 2c32c789484733397237e62ae9bb6760 *R/plot-utils.R 6731799ffde9689f52b53bd45a8273c2 *R/psibwt.R dcebffecd8cbf489cede75c6813eabed *R/psifun.R 3762b8071c38856c5fba22f1f17797f3 *R/transform.R bd6c4b899751d5a2e3c456fec562af91 *R/utils.R 5752f99eceda48e21d5743fe05c7c9b6 *R/zzz.R cc24b09b10214fb9e6c9a5ebf62ef0f8 *build/vignette.rds dc91e66b24be42e13e05e3350738de29 *data/Appalachia.rda 256379df09041b35cf1a53bed3e12508 *data/Cascades.rda eb7908cee2761979204dfe7d874024d6 *data/OsloTransect.rda 55c4dbe0994cdbe1d7119eec05a88595 *data/bus.rda c251d4fa7c86728d0a8cd2add1d96f55 *data/bushmiss.rda 84e917e512e1971ed66be0da1c5c15c5 *data/diabetes.rda 7dda4e2445d8611c50fc9953d5455da0 *data/fish.rda 21d630ce08ee4990f9466a21a9a140ca *data/hemophilia.rda a2d2593e5b03fb02aeb37d1cfdc09ead *data/lmom32.rda 171ba99239511c684b3f713cfa8df3ae *data/lmom33.rda b0c5464dee98e459569e67ea872fb500 *data/maryo.rda a1b793e942830518205c3519a05cae3f *data/octane.rda b700c5b357c7fee11f05f3593204c928 *data/olitos.rda dc09e8c9eb2d5326bc88da9901b00176 *data/pottery.rda a7da5d7c60bff2461388fe79a519d9b2 *data/rice.rda 43e1c28901a77b8dcf0b6be6ad2379ca *data/salmon.rda 36a95bdc17395bffa23901ddc84f24f0 *data/soil.rda 67b1c79477732c5d666d2d580c7259cc *data/un86.rda e7ad7ea33c9a5bd91d0c46dc35f07324 *data/wages.rda 51596f6a6749b1ee72b6842750f159b8 *inst/CITATION 12a680c422ccf7f8b1d95f68f55791d0 *inst/NEWS.Rd 0cd7cf2b0f3e787248341b7eb7415973 *inst/doc/rrcov.R 58ccdfd29ee1d1c42b759226e480a68c *inst/doc/rrcov.Rnw 16f8c7a28ae70565b7f96db9c220f529 *inst/doc/rrcov.pdf 0f5844b638361c83e2a90f4605d3c0a9 *inst/examples/bm/bm_lts.m ce8cc65f5ce8e9aedf1ac45c3f408022 *inst/examples/bm/bm_mcd.m 1cb5f88839eb05cd065e67c2c3415252 *inst/examples/bm/bmlts.S 3f9ec6b75cdbdee68324fe6907a0214d *inst/examples/bm/bmmcd.S f955d6936d3cde8a1bd825938601c0ae *inst/examples/test-ellipse.R f8797fb11a1081c4cab7610a31a36540 *man/Appalachia.Rd 00f1a7e08ed0c0b4d9e033edde7696e9 *man/Cascades.Rd ea3270717d98ab23f80fd65fa5057c93 *man/Cov-class.Rd bc81fb026d0aff35f38e64207dab50a4 *man/CovClassic-class.Rd 64ed005bab64d405da0b528892f2e2f0 *man/CovClassic.Rd 7557f4f58dd284e10c0ae7628fe86099 *man/CovControl-class.Rd 03bda239ddf17f74f5bc9cf4decceea4 *man/CovControlMMest-class.Rd a221652eea7f80cf9b623e0fab7bc645 *man/CovControlMMest.Rd 1f0f1e0908796f5dd6f069650839b154 *man/CovControlMcd-class.Rd ae54307f189eb254eb5c56d670b4dbd0 *man/CovControlMcd.Rd cae5493a3a8d4f1665cc9dd33abc590c *man/CovControlMest-class.Rd 6e6610f425aa57b4359d78e0eaa5dad3 *man/CovControlMest.Rd f6e4a0b3e1830ea91610e2730ee8eb3a *man/CovControlMrcd-class.Rd 2949d230823566a6926a22747c359b2e *man/CovControlMrcd.Rd fc726592d142d95e6d7e56a75519809c *man/CovControlMve-class.Rd f70460f41ca1cd5ebc3cb1ad575b9ea6 *man/CovControlMve.Rd 2c330f792167eefe8fb96ce1da90dc3c *man/CovControlOgk-class.Rd 44f3269b2f540cecb2048044974a9cfa *man/CovControlOgk.Rd bf695d067fbd82ea3ab35208bf8b3f3d *man/CovControlSde-class.Rd 3cf0765a8a9467f8ab52e9d2602023e9 *man/CovControlSde.Rd e3db88a200d21e64bff4af4cadcbfb06 *man/CovControlSest-class.Rd 4ebe546600e212b9169f144ecba35f17 *man/CovControlSest.Rd 37e3944eaff41e9269266f9972a14da2 *man/CovMMest-class.Rd 22f63b325a2ed71c6d440fad46b201dd *man/CovMMest.Rd ef8f7bbf9651f66bbcbc8d3165b0818a *man/CovMcd-class.Rd c11ced3dcd5767eecb5704341b4f9e8f *man/CovMcd.Rd e2462115012b677de2d3f6e8f5284d9a *man/CovMest-class.Rd fb05c1721802e33228f49898f57c4cc5 *man/CovMest.Rd ce75c053d666c3e105efc619a4a3df4c *man/CovMrcd-class.Rd 62f7244a88ee510b13c3dc2c9ec2cf30 *man/CovMrcd.Rd 214b1d482349897483c72dadf08f1240 *man/CovMve-class.Rd 68ec7aeb6bc754420220fd38da851808 *man/CovMve.Rd b2511ad54d872a26964cc9b7f572c0c6 *man/CovOgk-class.Rd 1897d27b35b584ce1dfee01823b014c9 *man/CovOgk.Rd 009b6df7f7aee9be009c970e455577e7 *man/CovRobust-class.Rd 13a1dd9ac0639413aed46bb4d235d873 *man/CovRobust.Rd 4ebfbef8eceff78f05851423fd18fd2a *man/CovSde-class.Rd af60d2298911070e5ba60bc6ce01322b *man/CovSde.Rd 31cf6056e111b23671d91beab15ca8c5 *man/CovSest-class.Rd 074e270e474b6327320968482ab0577c *man/CovSest.Rd b27b03971d57fa764675f022138a853c *man/Lda-class.Rd fe1d2c9d129c31598528df570b12be9b *man/LdaClassic-class.Rd 789044269a5f8fe57087a339b2d55826 *man/LdaClassic.Rd f7e7c90f0de6bd5e4336e787effe8c79 *man/LdaPP-class.Rd bcbe0810b203eea03e55b9ea1d7d196a *man/LdaPP.Rd 141ca26d78379f308894f7ab535933e1 *man/LdaRobust-class.Rd d1c62854b8e801eb57bfb3f107783b26 *man/Linda-class.Rd 49ecdbc687144bc6ad792f083a14962b *man/Linda.Rd cc67d7827bb2fba6f87b8efa284a8712 *man/OsloTransect.Rd b9e9188030c56c34d6308216294d82e1 *man/Pca-class.Rd b147c1b1d09c0bc578c4ac42a68d6703 *man/PcaClassic-class.Rd 0648dd62fdfb49dec771d82d90f20627 *man/PcaClassic.Rd d2cecf213dc05e90ae9d0ecd0c08bb2e *man/PcaCov-class.Rd fb4045c0361d77b774cf9e61f3d936d4 *man/PcaCov.Rd 1fabea3ed6d3dbd840e592a613babac8 *man/PcaGrid-class.Rd 1804a798bdcaeb84d97d8cf2eb05b3f3 *man/PcaGrid.Rd 719a579e50966e599182df7144781582 *man/PcaHubert-class.Rd 0bb2252c56aed5c539b351e348b32b17 *man/PcaHubert.Rd f539c75731c52bf6af1e30cbb76dbd3c *man/PcaLocantore-class.Rd fc505a223772ac1d6c507478076aaf80 *man/PcaLocantore.Rd c38b71ca7411ee01eb77b32383296054 *man/PcaProj-class.Rd 71f68b874da803f95749205b8533ad47 *man/PcaProj.Rd c2ea12dc9e65a5fcd65447b74787f29f *man/PcaRobust-class.Rd 6ca96bde32ed91f5fab5d756538780da *man/PredictLda-class.Rd aca666b0e900a4142430aa91053272b8 *man/PredictQda-class.Rd e3a0360e6421cd3346edea09a32baa04 *man/Qda-class.Rd eaa1fc392616389742fc2e2840ee723b *man/QdaClassic-class.Rd c132c4380a80da3f9a2f58dc04d1b10c *man/QdaClassic.Rd 1c6ef724a9f16b89d9f49b21f1f03cb1 *man/QdaCov-class.Rd 634126ea79485b60639df94898a2edad *man/QdaCov.Rd 8a52db0c5a8a81210ce42d38209c71c1 *man/QdaRobust-class.Rd 4b200566846a03e65dce2ce803b15feb *man/SummaryCov-class.Rd edf54728e048fa30052ef71852c450df *man/SummaryCovRobust-class.Rd 7b1597738ba25f7e0f1450b267ff3995 *man/SummaryLda-class.Rd e81f51906ce40b164419f62241222eda *man/SummaryPca-class.Rd 77f18ad3bc032b999a1f340a139c7cff *man/SummaryQda-class.Rd bae130fddaf77578da28c08bfdcbd7f3 *man/T2.test.Rd abdc9ad43607a75f9920dff95f553aea *man/Wilks.test.Rd b28604a0236f656c5c245515fe9f63f5 *man/biplot.Rd a758ab85fb1d78002f8d73e1c9cf7b55 *man/bus.Rd d58dc6ce4cedaf8b7d01e975f31c2c17 *man/bushmiss.Rd e799ef92d2bfb8a001f950ae98cb171d *man/covMest-deprecated.Rd 97b94ed5353326339b7344b2935aee2c *man/diabetes.Rd 7d2eb1cde344729acf65313b4c7825f8 *man/estimate-methods.Rd 7322ab3422db504f857740fc27581836 *man/fish.Rd 88285f8bf5c759de3cb014ee5ca89a45 *man/getCenter-methods.Rd 0a1637528257278a749e71178cbe4a9f *man/getEllipse.Rd cd32b6c3686ec967354fc017a406626b *man/getLoadings-methods.Rd 19c9220469d7db644eb7f885179cdb41 *man/hemophilia.Rd 37cb7c180bf6563504366391de15c8cc *man/isSingular.Rd ecb227b0175ac8201e93c194637f425f *man/lmom32.Rd 1ff419d2ca28076ea6461fa07698bf8b *man/lmom33.Rd deb2edecbfed78502752bbf1dcd6bb5a *man/maryo.Rd 93b3d8c62a7190909c7decb1b1b1aa9c *man/octane.Rd 06670e7a6424ba39012a590e33eb558d *man/olitos.Rd b2b9c47b1ea1fe6016fa630088926789 *man/pca.distances.Rd a3e20931c238a56342e17a56a159866d *man/pca.scoreplot.Rd aac6d52c9f15aa0bce14fe38eaa2a95b *man/plot-methods.Rd 151be8e11289e21dcfd0a4f1b74800b6 *man/pottery.Rd 3f586ec9a2ad87757bd9ef8d0399303d *man/rice.Rd 1e98c02d000874c986e78b9c00412cb4 *man/rrcov-utils.Rd fe6e17df1f5d0e88e34643a97ed36809 *man/salmon.Rd a0797202c93734adab394939c77f02a0 *man/scorePlot.Rd 7444d705777158155f3388c7d0e99bf1 *man/soil.Rd 8bd94e84fd2ff99d7d4f158feab1b324 *man/un86.Rd 4aba21bade7daced3ed3e4825cd6dc6d *man/wages.Rd 3996e7c16bfb96fad295ee425815cb4d *src/Makevars eac4382f7dd2ec1ccf389af98314f557 *src/R-rng4ftn.c 018dffcfdf331831f9b2514e1ec0745d *src/covOPW.c 1b8952950f86d526b7e849e28e644f36 *src/ds11.f c1e732bb49768c40a41f3d196ed921d2 *src/fast-mve.c ccf4857d53fdada76dfd725ef84d9683 *src/fsada.f c6d3916e13986bd0e2bc0ea73bf278a3 *src/rrcov_init.c b4aaedc4fce50b5ec8b420c789ff6c1a *src/sest.c ce128c182f1d80545b9d52713dfd288d *tests/thubert.R 1e2270032cf419f3f4791e341d5f4814 *tests/thubert.Rout.save 9cac3a2e6e170e167cbf8de9c7c19edf *tests/tlda.R f3469fe82bd70b8c6fbaca6f0239d770 *tests/tlda.Rout.save b438bcce32bc72667d5f353a77e32655 *tests/tldapp.R 439f62ef842f1025f2b8f1f98bb1be9d *tests/tldapp.Rout.save 81f8599fa2320b93acc1e48740f26f8b *tests/tmcd4.R a71176296cedc1a24d5cc4c92867d56a *tests/tmcd4.Rout.save fd5a16efc040e56acd8fd8f6773d1c0f *tests/tmest4.R d5ff4f4b4772061f3ca09d7b8d38161b *tests/tmest4.Rout.save 543589de1df4a8c5b354ea5d5ee2e24e *tests/tmve4.R dc6c9dd3fd406040a54a837b446079b0 *tests/tmve4.Rout.save 2a1e5911d4a26366e9b85d36921bca12 *tests/togk4.R ab8ec7cc06f8af195f662a7554de148f *tests/togk4.Rout.save 7ed52ca35c24fabd3aca1bac54afcc21 *tests/tqda.R 2e476434e296c3aeda6be662671aeabb *tests/tqda.Rout.save 0c3037618a637218348efe2ee6c03a3c *tests/tsde.R 9aca13b7c175ce86211515f3e335e521 *tests/tsde.Rout.save daa61a69be367325ffaa0571f087e489 *tests/tsest.R acbd791215a22638c46e97fb453af143 *tests/tsest.Rout.save 61b47716bbd35dcb43bf00439b6fdd4a *vignettes/AModel.pdf 6c269eb8f8375446b5f07ff3bafa6a4f *vignettes/CovControl.pdf d61b698be02405589908a619da0d94fa *vignettes/CovModel.pdf e1819cded497f38e9876caa0459050e6 *vignettes/DAModel.pdf dec446e0ee4dd1b225ed4acdde0db212 *vignettes/PcaModel.pdf d946e97b6973ed43e19342116c303508 *vignettes/Structure.pdf ee7105297f444b994c3eab45e42de035 *vignettes/mybiblio.bib 58ccdfd29ee1d1c42b759226e480a68c *vignettes/rrcov.Rnw rrcov/inst/0000755000176200001440000000000013607362205012366 5ustar liggesusersrrcov/inst/examples/0000755000176200001440000000000013607362223014204 5ustar liggesusersrrcov/inst/examples/bm/0000755000176200001440000000000013607354177014613 5ustar liggesusersrrcov/inst/examples/bm/bmmcd.S0000644000176200001440000000606512763517421016023 0ustar liggesusers##### bm_lts ##### # Benchmark for rrcov::covMcd() and MASS::cov.mcd() on several n and p. # # V.Todorov: 16.08.2004 # # For each n and p (specified by the arrays and ) a data set # is generated (see the function gendata() for description of the model) # and MCD is computed by calling covMcd(). All defaults are accepted # # Each test (for given n and p) is performed several times (specified # by the parameter ) and the result is averaged. # # Input argument: # nrep: Number of times the tests are executed (defaults to 3) # eps: contamination proportion - see function gendata() (defaults to 0.4) # method: "rrcov" or "MASS" # bmmcd <- function(nrep=1, eps=0.40, method=c("rrcov", "MASS", "S", "Smcd")){ method <- match.arg(method) if(method == "rrcov"){ library(rrcov) } if(method == "S" || method == "Smcd"){ library(Robust) } library(MASS) ap <- c(2, 5, 10, 20, 30) an <- c(100, 500, 1000, 10000, 50000) set.seed(0) btime <- proc.time() cat("\n*** Benchmark for R/S MCD estimators ***") cat("\nImplementation=",method) cat("\nThe results are averaged on nrep = ",nrep," runs.\n") tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- as.integer(an[i]) p <- as.integer(ap[j]) if(5*p <= n){ xx <- gendataMCD(n, p, eps) X <- as.data.frame(xx$X) ptm <- proc.time() for(k in 1:nrep){ if(method == "MASS") cov.mcd(X) else if(method == "rrcov") covMcd(X) else if(method == "S") covRob(X) else if(method == "Smcd") covRob(X,estim="mcd") else stop("No method specified") } xtime <- proc.time() - ptm xtime <- xtime[1]/nrep # cat(sprintf("%6d %3d %10.2f\n", n, p, xtime)) cat(format(n), format(p), format(xtime, nsmall=2),"\n") } } } tottime <- proc.time() - btime cat("=====================\n") cat("Total time: ", tottime[1], "\n") } #### gendata() #### # Generates a location contaminated multivariate # normal sample of n observations in p dimensions # (1-eps)*Np(0,Ip) + eps*Np(m,Ip) # where # m = (b,b,...,b) # Defaults: eps=0 and b=10 # gendataMCD <- function(n,p,eps=0,b=10){ if(missing(n) || missing(p)) stop("Please specify (n,p)") if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") X <- mvrnorm(n,rep(0,p),diag(1,nrow=p,ncol=p)) nbad <- as.integer(eps * n) if(nbad > 0){ Xbad <- mvrnorm(nbad,rep(b,p),diag(1,nrow=p,ncol=p)) xind <- sample(n,nbad) X[xind,] <- Xbad } list(X=X, xind=xind) } rrcov/inst/examples/bm/bmlts.S0000644000176200001440000000612312763517421016055 0ustar liggesusers##### bm_lts ##### # Benchmark for rrcov::ltsReg() and MASS::ltsreg() on several n and p. # # V.Todorov: 16.08.2004 # # For each n and p (specified by the arrays and ) a data set # is generated (see the function gendata() for description of the model) # and LTS is computed by calling ltsReg(). All defaults are accepted. # # Each test (for given n and p) is performed several times (specified # by the parameter ) and the result is averaged. # # Input argument: # nrep: Number of times the tests are executed (defaults to 3) # eps: contamination proportion - see function gendata() (defaults to 0.4) # method: "rrcov" or "MASS" # bmlts <- function(nrep=1, eps=0.4, method=c("rrcov","MASS", "S")){ method <- match.arg(method) if(method == "rrcov") library(rrcov) library(MASS) ap <- c(2, 3, 5, 10) an <- c(100, 500, 1000, 10000, 50000) set.seed(0) btime <- proc.time() cat("*** Benchmark for R/S: LTS ***") cat("\nThe results are averaged on nrep = ", nrep, "\n") tmp <- sys.call() cat("\nCall: ", deparse(substitute(tmp)),"\n") cat(" n p Time\n") cat("=====================\n") for(i in 1:length(an)) { for(j in 1:length(ap)) { n <- as.integer(an[i]) p <- as.integer(ap[j]) if(5*p <= n){ a <- gendataLTS(n, p, eps) X <- a$x Y <- a$y # set mcd=FALSE - we want to time only the LTS algorithm ptm <- proc.time() for(k in 1:nrep){ if(method == "MASS") ltsreg(X,Y) else if(method == "rrcov") ltsReg(X, Y, mcd = FALSE) else ltsreg(X, Y, mcd = FALSE) } xtime <- proc.time() - ptm xtime <- xtime[1]/nrep # cat(sprintf("%6d %3d %10.2f\n", n, p, xtime)) cat(n, p, format(xtime, nsmall=2), "\n") } } } tottime <- proc.time() - btime cat("=====================\n") cat("Total time: ", tottime[1], "\n") } #### gendata() #### # Generates a data set with bad leverage points (outliers in x-space) # n observations in p dimensions acording to the model: # yi = Xi1+Xi2+...+ei # where ei - N(0,1) is the error term, Xi,j for j=1...p-1 - N(0,100) are # the non-trivial explanatory variables and xip is the intercept term. # The outliers in the x-space are introduced by replacing eps. percent of # xi1 by values distributed as N(100,100). # # Defaults: eps=0 # gendataLTS <- function(n, p, eps=0){ if(eps < 0 || eps >= 0.5) stop(message="eps must be in [0,0.5)") p <- p-1 x <- matrix(data=rnorm(n*p,0,100), nrow=n, ncol=p) y <-rowSums(x) + 1 + rnorm(n, 0, 1) nbad <- as.integer(eps * n) xind <- sort(sample(n,nbad)) xbad <- rnorm(nbad,100,100) for(i in 1:nbad){ x[xind[i],1] <- xbad[i] } list(x=x, y=y, xind=xind) } rrcov/inst/examples/bm/bm_mcd.m0000644000176200001440000000435612763517421016215 0ustar liggesusers%%%%% bm_mcd %%%%% % Benchmark for LIBRA::mcdcov() on several n and p. % % V.Todorov: 16.08.2004 % % For each n and p (specified by the arrays and ) a data set % is generated (see the function gendata() for description of the model) % and MCD is computed by calling mcdcov(). All defaults are accepted. % % Each test (for given n and p) is performed several times (specified % by the parameter ) and the result is averaged. % % Required input argument: % nrep : Number of times the tests are executed % function bm_mcd(nrep) if(nrep <= 0) nrep = 1; end disp('*** Benchmark for LIBRA: mcdcov() ***') disp(sprintf('\nThe results are averaged on nrep = %d runs.\n', nrep)) disp(' N P TIME (sec.)') eps = 0.4; b = 10; an = [ 100 500 1000 10000 50000]; ap = [2 5 10 20 30]; ttime = 0; for(i = 1:length(an)) n = an(i); for(j = 1:length(ap)) p = ap(j); if(5*p <= n) x = gendata(n, p, eps, b); tic; for(k = 1:nrep) mcdcov(x, 'plots', 0); end tt = toc; ttime = ttime + tt; tt=tt/nrep; disp(sprintf('%8d %4d %10.2f', n, p, tt)) end end end disp(sprintf('\nTotal elapsed time (nrep=%d): %8.0f sec.\n', nrep, ttime)) %-------------------------------------------------- % gendata() % Generates a location contaminated multivariate % normal sample of n observations in p dimensions % (1-eps)*Np(0,Ip) + eps*Np(m,Ip) % where % m = (b,b,...,b) % Defaults: eps=0 and b=10 % function result = gendata(n, p, eps, b) if(eps < 0 | eps >= 0.5) error('eps must be in [0,0.5)') end mu = zeros(p,1); sigma = diag(ones(p,1)); x = mvnrnd(mu, sigma, n); % generate now the outliers if(eps > 0) mubad = b + mu; nbad = floor(eps * n); xind = randperm(n); xind = sort(xind(1:nbad)); xbad = mvnrnd(mubad, sigma, nbad); for(i = 1:nbad) x(xind(i),:) = xbad(i,:); end end result = x; rrcov/inst/examples/bm/bm_lts.m0000644000176200001440000000507312763517421016251 0ustar liggesusers%%%%% bm_lts %%%%% % Benchmark for LIBRA::ltsreg() on several n and p. % % V.Todorov: 16.08.2004 % % For each n and p (specified by the arrays and ) a data set % is generated (see the function gendata() for description of the model) % and LTS is computed by calling ltsregress(). All defaults are accepted, % except the trimming proportion alpha - it is set to 0,5 % % Each test (for given n and p) is performed several times (specified % by the parameter ) and the result is averaged. % % Required input argument: % nrep : Number of times the tests are executed % function bm_lts(nrep) if(nrep <= 0) nrep = 1; end disp('*** Benchmark for LIBRA: ltsreg() ***') disp(sprintf('\nThe results are averaged on nrep = %d runs.\n', nrep)) disp(' N P TIME (sec.)') eps = 0.4; an = [ 100 500 1000 10000 50000]; ap = [2 3 5 10]; ttime = 0; for(i = 1:length(an)) n = an(i); for(j = 1:length(ap)) p = ap(j); [x, y] = gendata(n, p, eps); tic; for(k = 1:nrep) ltsregres(x, y, 'alpha', 0.50, 'plots', 0); end tt=toc; ttime = ttime + tt; tt=tt/nrep; disp(sprintf('%8d %4d %10.2f', n, p, tt)) end end disp(sprintf('\nTotal elapsed time (nrep=%d): %8.0f sec.\n', nrep, ttime)) %-------------------------------------------------- % gendata() % Generates a data set with bad leverage points (outliers in x-space), % n observations in p dimensions acording to the model: % % yi = Xi1 + Xi2 + ... + ei % % where ei - N(0,1) is the error term, Xi,j for j=1...p-1 - N(0,100) are % the non-trivial explanatory variables and Xip is the intercept term. % The outliers in the x-space are introduced by replacing eps percent of % Xi1 by values distributed as N(100,100). % % Defaults: eps=0 % function [x, y] = gendata(n, p, eps); if(eps < 0 | eps >= 0.5) error('eps must be in [0,0.5)') end p = p-1; x = randn(n,p); y = zeros(n,1); for(i = 1:n) y(i) = sum(x(i,:)) + 1 + rand(1); end if(eps > 0) nbad = floor(eps * n); xind = randperm(n); xind = sort(xind(1:nbad)); % generate nbad observations distributed as % N(m, s^2) = N(100,100) => = m + s*rand(nbad) xbad = 100 + 10*randn(nbad,1); for(i = 1:nbad) x(xind(i),1) = xbad(i,1); end end result = [x, y]; rrcov/inst/examples/test-ellipse.R0000644000176200001440000000311213607355027016742 0ustar liggesuserslibrary(rrcov) data(pottery) x <- pottery[,c("MG", "CA")] grp <- pottery$origin ## ## Compute robust location and covariance matrix and ## plot the tolerance ellipses library(rrcov) (mcd <- CovMcd(x)) col <- c(3,4) gcol <- ifelse(grp == "Attic", col[1], col[2]) gpch <- ifelse(grp == "Attic", 16, 1) plot(mcd, which="tolEllipsePlot", class=TRUE, col=gcol, pch=gpch) ## ## Perform classical LDA and plot the data, 0.975 tolerance ellipses ## and LDA separation line ## x <- pottery[,c("MG", "CA")] grp <- pottery$origin lda <- LdaClassic(x, grp) lda ## Calculate the ellipses using the package 'ellipse' require(ellipse) e1 <- ellipse(x=lda@cov, centre=lda@center[1,], level=0.975) e2 <- ellipse(x=lda@cov, centre=lda@center[2,], level=0.975) ## Calculate the ellipses using the package 'rrcov' e3 <- getEllipse(loc=lda@center[1,], cov=lda@cov) e4 <- getEllipse(loc=lda@center[2,], cov=lda@cov) ## Calculate the ellipses using the package 'cluster' require(cluster) e5 <- ellipsoidPoints(lda@cov, qchisq(0.975, 2), lda@center[1,]) e6 <- ellipsoidPoints(lda@cov, qchisq(0.975, 2), lda@center[2,]) plot(CA~MG, data=pottery, col=gcol, pch=gpch, xlim=c(min(MG,e1[,1], e2[,1]), max(MG,e1[,1], e2[,1])), ylim=c(min(CA,e1[,2], e2[,2]), max(CA,e1[,2], e2[,2]))) ab <- lda@ldf[1,] - lda@ldf[2,] cc <- lda@ldfconst[1] - lda@ldfconst[2] abline(a=-cc/ab[2], b=-ab[1]/ab[2], col=2, lwd=2) lines(e1, type="l", col=1) lines(e2, type="l", col=1) lines(e3, type="l", col=2) lines(e4, type="l", col=2) lines(e3, type="l", col=3) lines(e4, type="l", col=3) rrcov/inst/doc/0000755000176200001440000000000013607354177013144 5ustar liggesusersrrcov/inst/doc/rrcov.R0000644000176200001440000003052313607365240014416 0ustar liggesusers### R code from vignette source 'rrcov.Rnw' ################################################### ### code chunk number 1: rrcov.Rnw:471-473 ################################################### ## set the prompt to "R> " and the continuation to "+ " options(prompt="R> ", continue="+ ") ################################################### ### code chunk number 2: intro ################################################### ## ## Load the 'rrcov' package and the first two data sets to be ## used throughout the examples ## library("rrcov") data("delivery") delivery.x <- delivery[,1:2] # take only the X part data("hbk") hbk.x <- hbk[,1:3] # take only the X part ################################################### ### code chunk number 3: intro-mcd ################################################### ## ## Compute MCD estimates for the delivery data set ## - show() and summary() examples ## mcd <- CovMcd(delivery.x) mcd summary(mcd) ################################################### ### code chunk number 4: intro-plot ################################################### ## ## Example plot of the robust against classical ## distances for the delivery data set ## plot(mcd, which="dd") ################################################### ### code chunk number 5: intro-S ################################################### ## ## Compute the S-estimates for the delivery data set ## and provide the standard and extended output ## est <- CovSest(delivery.x, method="bisquare") est summary(est) ################################################### ### code chunk number 6: intro-CovRobust ################################################### ## ## Automatically select the appropriate estimator according ## to the problem size - in this example the Stahel-Donoho estimates ## will be selected. ## est <- CovRobust(delivery.x) est ################################################### ### code chunk number 7: rrcov.Rnw:1019-1020 ################################################### set.seed(1234) ################################################### ### code chunk number 8: CovControl ################################################### ## ## Controlling the estimation options with a control object ## control <- CovControlSest(method="biweight") PcaCov(hbk.x, cov.control=control) ################################################### ### code chunk number 9: CovControl-loop ################################################### ## ## Controlling the estimation options: example ## of looping through several estimators ## cc <- list(CovControlMcd(), CovControlMest(), CovControlOgk(), CovControlSest(), CovControlSest(method="rocke")) clist <- sapply(cc, restimate, x=delivery.x) sapply(clist, data.class) sapply(clist, getMeth) ################################################### ### code chunk number 10: CovRobust ################################################### ## ## Automatically select the appropriate estimator according ## to the problem size. ## getMeth(CovRobust(matrix(rnorm(40), ncol=2))) # 20x2 - SDE getMeth(CovRobust(matrix(rnorm(16000), ncol=8))) # 2000x8 - bisquare S getMeth(CovRobust(matrix(rnorm(20000), ncol=10))) # 2000x10 - Rocke S getMeth(CovRobust(matrix(rnorm(200000), ncol=2))) # 100000x2 - OGK ################################################### ### code chunk number 11: CovControl-S ################################################### ## ## Rocke-type S-estimates ## getMeth(CovRobust(matrix(rnorm(40), ncol=2), control="rocke")) ################################################### ### code chunk number 12: CovControl-CovRobust ################################################### ## ## Specify some estimation parameters through a control object. ## The last command line illustrates the accessor method ## for getting the correlation matrix of the estimate ## as well as a nice formatting method for covariance ## matrices. ## data("toxicity") ctrl <- CovControlOgk(smrob = "s_mad", svrob = "qc") est <- CovRobust(toxicity, ctrl) round(getCenter(est),2) as.dist(round(getCorr(est), 2)) ################################################### ### code chunk number 13: ex-cov-plot-lattice ################################################### ## ## Distance plot and Chi-square Q-Q plot of the robust and classical distances ## Lattice plots (currently not available in rrcov) ## library("lattice") library("grid") library("rrcov") data("delivery") X <- delivery[,1:2] myPanel.dd <- function(x, y, subscripts, cutoff, ...) { panel.xyplot(x, y, ...) panel.abline(h=cutoff,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] xrange<-range(y) adj <- (xrange[2]-xrange[1])/20 ltext(x[ind] + adj, y[ind] + adj, ind, cex=1.0) } } myPanel.qchi <- function(x, y, subscripts, cutoff, ...) { y <- sort(y, index.return=TRUE) iy <- y$ix y <- y$x panel.xyplot(x, y, ...) panel.abline(0,1,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- (n-id.n+1):n xrange<-range(y) adj <- (xrange[2]-xrange[1])/50 ltext(x[ind] + adj, y[ind] + adj, iy[ind], cex=1.0) } } n<-nrow(X) p <- ncol(X) cutoff <- sqrt(qchisq(0.975, p)) mm <- covMcd(X) dd1 <- sqrt(mm$mah) # robust distances vv<-cov.wt(X) dd2 <- sqrt(mahalanobis(X,vv$center,vv$cov)) # classical distances dd<-c(dd1,dd2) # both robust and classical distances gr <- as.factor(c(rep(1,n), rep(2,n))) levels(gr)[1] <- "Robust" levels(gr)[2] <- "Classical" qq <- sqrt(qchisq(((1:n)-1/3)/(n+1/3), p)) ind.dd <- c(1:n, 1:n) ind.qchi <- c(qq, qq) dplot <- xyplot(dd~ind.dd|gr, cutoff=cutoff, panel = myPanel.dd, xlab="Index", ylab="Mahalanobis distance", main="Distance Plot", col = "darkred", scales=list(cex=1.0)) qplot <- xyplot(dd~ind.qchi|gr, cutoff=cutoff, panel = myPanel.qchi, xlab="Quantiles of the chi-squared distribution", ylab="Mahalanobis distance", main="Chi-Square QQ-Plot", col = "darkred", scales=list(cex=1.0)) plot(dplot, split = c(1, 1, 2, 1), more = TRUE) plot(qplot, split = c(2, 1, 2, 1), more = FALSE) ################################################### ### code chunk number 14: ex-cov-plot-ellipse ################################################### ## ## a) scatter plot of the data with robust and classical confidence ellipses. ## b) screeplot presenting the robust and classical eigenvalues ## data("milk") usr<-par(mfrow=c(1,2)) plot(CovMcd(delivery[,1:2]), which="tolEllipsePlot", classic=TRUE) plot(CovMcd(milk), which="screeplot", classic=TRUE) par(usr) ################################################### ### code chunk number 15: pca-ex-hbk ################################################### ## ## Principal Component Analysis example: ## Plot of the first two principal components of the ## Hawkins, Bradu and Kass data set: classical and robust ## par(mfrow=c(1,2)) pca <- PcaClassic(hbk.x, k=2) cpca <- list(center=c(0,0), cov=diag(pca@eigenvalues), n.obs=pca@n.obs) rrcov:::.myellipse(pca@scores, xcov=cpca, main="Classical", xlab="PC1", ylab="PC2", ylim=c(-30,30), id.n=0) abline(v=0) abline(h=0) text(-29,6,labels="1-10", cex=0.8) text(-37,-13,labels="14", cex=0.8) text(-31,-5,labels="11-13", cex=0.8) hub <- PcaHubert(hbk.x, k=2, mcd=TRUE) chub <- list(center=c(0,0), cov=diag(hub@eigenvalues), n.obs=hub@n.obs) rrcov:::.myellipse(hub@scores, xcov=chub, main="Robust (MCD)", xlab="PC1", ylab="PC2", xlim=c(-10,45), ylim=c(-25,15), id.n=0) abline(v=0) abline(h=0) text(30,-9,labels="1-10", cex=0.8) text(36,-11,labels="11", cex=0.8) text(42,-4,labels="12", cex=0.8) text(41,-11,labels="13", cex=0.8) text(44,-15,labels="14", cex=0.8) ################################################### ### code chunk number 16: pca-classic ################################################### ## ## Classical PCA ## pca <- PcaClassic(~., data=hbk.x) pca summary(pca) plot(pca) getLoadings(pca) ################################################### ### code chunk number 17: pca-robust ################################################### ## ## Robust PCA ## rpca <- PcaGrid(~., data=hbk.x) rpca summary(rpca) ################################################### ### code chunk number 18: ex-pca-plot-screeplot ################################################### ## ## Screeplot for classical and robust PCA of the milk data set. ## usr <- par(mfrow=c(1,2)) screeplot(PcaClassic(milk), type="lines", main="Screeplot: classical PCA", sub="milk data") screeplot(PcaHubert(milk), type="lines", main="Screeplot: robust PCA", sub="milk data") par(usr) ################################################### ### code chunk number 19: ex-pca-plot-biplot ################################################### ## ## Robust biplot for the UN86 data ## data("un86") set.seed(9) usr<-par(mfrow=c(1,2)) biplot(PcaCov(un86, corr=TRUE, cov.control=NULL), main="Classical biplot", col=c("gray55", "red")) biplot(PcaCov(un86, corr=TRUE), main="Robust biplot", col=c("gray55", "red")) par(usr) ################################################### ### code chunk number 20: ex-pca-plot-diagplot ################################################### ## ## An example of the classical and robust diagnostic ## plot for the hbk data set ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=2), sub="data set: hbk, k=2") plot(PcaHubert(hbk.x, k=2), sub="data set: hbk, k=2") par(usr) ################################################### ### code chunk number 21: ex-pca-plot-distplot ################################################### ## ## If k=p the orthogonal distances are not meaningful and ## simple distance plot of the score distances will be shown ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=3), sub="data set: hbk.x, k=3") plot(PcaHubert(hbk.x, k=3), sub="data set: hbk.x, k=3") par(usr) ################################################### ### code chunk number 22: lda-prelim ################################################### data("diabetes") ################################################### ### code chunk number 23: lda-cloud ################################################### library("lattice") # load the graphical library ## set different plot symbols - important for black-and-white print sup.sym <- trellis.par.get("superpose.symbol") sup.sym$pch <- c(1,2,3,4,5) trellis.par.set("superpose.symbol", sup.sym) cloud.plt <- cloud(insulin ~ glucose + sspg, groups = group, data = diabetes, auto.key=TRUE) ################################################### ### code chunk number 24: lda-cloud-fig ################################################### print(cloud.plt) ################################################### ### code chunk number 25: lda-classic ################################################### lda <- LdaClassic(group~glucose+insulin+sspg, data=diabetes) lda ################################################### ### code chunk number 26: lda-classic-predict ################################################### predict(lda) ################################################### ### code chunk number 27: lda-robust ################################################### rlda <- Linda(group~glucose+insulin+sspg, data=diabetes) rlda rlda.predict <- predict(rlda) cat("\nApparent error rate: ", round(rrcov:::.AER(rlda.predict@ct),4)) ################################################### ### code chunk number 28: qda-robust ################################################### rqda <- QdaCov(group~glucose+insulin+sspg, data=diabetes) rqda rqda.predict <- predict(rqda) cat("\nApparent error rate: ", round(rrcov:::.AER(rqda.predict@ct),4)) rrcov/inst/doc/rrcov.Rnw0000644000176200001440000033555713565037277015013 0ustar liggesusers% -*- TeX -*- -*- Soft -*- \documentclass[article,shortnames,nojss]{jss} %\VignetteIndexEntry{An Object-Oriented Framework for Robust Multivariate Analysis} %\VignetteKeywords{robustness, multivariate analysis, MCD, R, statistical design patterns} %\VignettePackage{rrcov} \usepackage{amsmath} %% need for subequations \usepackage{amssymb} \usepackage{amsfonts} \usepackage[english]{babel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% declarations for jss.cls %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\vv}[1]{\mbox{\boldmath$#1$}} \newcommand{\xv}{\mbox{\boldmath$x$}} \newcommand{\yv}{\mbox{\boldmath$y$}} \newcommand{\zv}{\mbox{\boldmath$z$}} \newcommand{\mv}{\mbox{\boldmath$m$}} \newcommand{\tv}{\mbox{\boldmath$t$}} \newcommand{\xbarv}{\mbox{\boldmath$\bar x$}} \newcommand{\uv}{\mbox{\boldmath$u$}} \newcommand{\muv}{\mbox{\boldmath$\mu$}} \newcommand{\nuv}{\mbox{\boldmath$\nu$}} \newcommand{\deltav}{\mbox{\boldmath$\delta$}} \newcommand{\chiv}{\mbox{\boldmath$\chi$}} \newcommand{\ov}{\mbox{\boldmath$0$}} \newcommand\MCD{\mathit{MCD}} \newcommand\MVE{\mathit{MVE}} \newcommand\OGK{\mathit{OGK}} \newcommand\diag{\mathrm{diag}} %\newcommand\det{\mathrm{det}} \newcommand{\class}[1]{``\code{#1}''} \newcommand{\fct}[1]{\code{#1()}} %% almost as usual \author{Valentin Todorov\\UNIDO \And Peter Filzmoser\\Vienna University of Technology} \title{An Object Oriented Framework for Robust Multivariate Analysis} %% for pretty printing and a nice hypersummary also set: \Plainauthor{Valentin Todorov, Peter Filzmoser} %% comma-separated \Plaintitle{Object Oriented Framework for Robust Multivariate Analysis} %% without formatting \Shorttitle{OOF for Robust Multivariate Analysis} %% a short title (if necessary) %% an abstract and keywords \Abstract{ \noindent This introduction to the \proglang{R} package \pkg{rrcov} is a (slightly) modified version of \cite{todorov-oof}, published in the \emph{Journal of Statistical Software}. \noindent Taking advantage of the \proglang{S}4 class system of the programming environment \proglang{R}, which facilitates the creation and maintenance of reusable and modular components, an object oriented framework for robust multivariate analysis was developed. The framework resides in the packages \pkg{robustbase} and \pkg{rrcov} and includes an almost complete set of algorithms for computing robust multivariate location and scatter, various robust methods for principal component analysis as well as robust linear and quadratic discriminant analysis. The design of these methods follows common patterns which we call statistical design patterns in analogy to the design patterns widely used in software engineering. The application of the framework to data analysis as well as possible extensions by the development of new methods is demonstrated on examples which themselves are part of the package \pkg{rrcov}. } \Keywords{robustness, multivariate analysis, MCD, \proglang{R}, statistical design patterns} \Plainkeywords{robustness, multivariate analysis, MCD, R, statistical design patterns} %% without formatting %% at least one keyword must be supplied %% publication information %% NOTE: Typically, this can be left commented and will be filled out by the technical editor %% \Volume{13} %% \Issue{9} %% \Month{September} %% \Year{2004} %% \Submitdate{2004-09-29} %% \Acceptdate{2004-09-29} %% The address of (at least) one author should be given %% in the following format: \Address{ Valentin Todorov\\ Research and Statistics Branch\\ United Nations Industrial Development Organization (UNIDO)\\ Vienna International Centre\\ P.O.Box 300, 1400, Vienna, Austria\\ E-mail: \email{valentin.todorov@chello.at}\\ % URL: \url{http://statmath.wu-wien.ac.at/~zeileis/} } %% It is also possible to add a telephone and fax number %% before the e-mail in the following format: %% Telephone: +43/1/31336-5053 %% Fax: +43/1/31336-734 %% for those who use Sweave please include the following line (with % symbols): %% need no \usepackage{Sweave.sty} %% end of declarations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\bi}{\begin{itemize}} \newcommand{\ei}{\end{itemize}} \newcommand{\be}{\begin{enumerate}} \newcommand{\ee}{\end{enumerate}} \renewcommand{\v}[1]{\mathbf{#1}} %% Sweave options for the complete document %%\SweaveOpts{keep.source=TRUE} %%\SweaveOpts{prefix.string=images/oofgen/oof} \SweaveOpts{prefix.string=ooframework} \begin{document} %% include your article here, just as usual %% Note that you should use the \pkg{}, \proglang{} and \code{} commands. %\section[About Java]{About \proglang{Java}} \section[Introduction]{Introduction} %% Note: If there is markup in \(sub)section, then it has to be escape as above. Outliers are present in virtually every data set in any application domain, and the identification of outliers has a hundred years long history. Many researchers in science, industry and economics work with huge amounts of data and this even increases the possibility of anomalous data and makes their (visual) detection more difficult. Taking into account the multivariate aspect of the data, the outlyingness of the observations can be measured by the Mahalanobis distance which is based on location and scatter estimates of the data set. In order to avoid the masking effect, robust estimates of these parameters are called for, even more, they must possess a positive breakdown point. The estimates of the multivariate location vector $\muv$ and the scatter matrix $\v{\Sigma}$ are also a cornerstone in the analysis of multidimensional data, since they form the input to many classical multivariate methods. The most common estimators of multivariate location and scatter are the sample mean $\xbarv$ and the sample covariance matrix $\v{S}$, i.e., the corresponding MLE estimates. These estimates are optimal if the data come from a multivariate normal distribution but are extremely sensitive to the presence of even a few outliers (atypical values, anomalous observations, gross errors) in the data. If outliers are present in the input data they will influence the estimates $\xbarv$ and $\v{S}$ and subsequently worsen the performance of the classical multivariate procedure based on these estimates. Therefore it is important to consider robust alternatives to these estimators and actually in the last two decades much effort was devoted to the development of affine equivariant estimators possessing a high breakdown point. The most widely used estimators of this type are the minimum covariance determinant (MCD) estimator of \citet{rousseeuw:85} for which also a fast computing algorithm was constructed---\citet{rousseeuw-vandriessen}, the S~estimators \citep{davies:87} and the Stahel-Donoho estimator introduced by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} and studied by \citet{maronna:95}. If we give up the requirement for affine equivariance, estimators like the one of \citet{maronna:2002} are available and the reward is an extreme gain in speed. Substituting the classical location and scatter estimates by their robust analogues is the most straightforward method for robustifying many multivariate procedures like principal components, discriminant and cluster analysis, canonical correlation, etc. The reliable identification of multivariate outliers which is an important task in itself, is another approach to robustifying many classical multivariate methods. Some of these estimates and procedures became available in the popular statistical packages like \proglang{S-PLUS}, \proglang{SAS}, \proglang{MATLAB} as well as in \proglang{R} but nevertheless it is recognized that the robust methods have not yet replaced the ordinary least square techniques as it could be expected \citep{morgenthaler:2007, stromberg:2004}. One reason is the lack of easily accessible and easy to use software, that is software which presents the robust procedures as extensions to the classical ones---similar input and output, reasonable defaults for most of the estimation options and visualization tools. As far as the easiness of access is concerned, the robust statistical methods should be implemented in the freely available statistical software package \proglang{R}, \citep{RLanguage}, which provides a powerful platform for the development of statistical software. These requirements have been defined in the project ``Robust Statistics and \proglang{R}'', see \url{http://www.statistik.tuwien.ac.at/rsr/}, and a first step in this direction was the initial development of the collaborative package \pkg{robustbase}, \citep{robustbase}, with the intention that it becomes the \textit{essential robust statistics} \proglang{R} package covering the methods described in the recent book \citet{maronna:2006}. During the last decades the object oriented programming paradigm has revolutionized the style of software system design and development. A further step in the software reuse are the object oriented frameworks \citep[see][]{gamma} which provide technology for reusing both the architecture and the functionality of software components. Taking advantage of the new \proglang{S}4 class system \citep{chambers:98} of \proglang{R} which facilitate the creation of reusable and modular components an object oriented framework for robust multivariate analysis was implemented. The goal of the framework is manyfold: \be \item{to provide the end-user with a flexible and easy access to newly developed robust methods for multivariate data analysis;} \item{to allow the programming statisticians an extension by developing, implementing and testing new methods with minimum effort, and } \item{to guarantee the original developers and maintainer of the packages a high level of maintainability.} \ee The framework includes an almost complete set of algorithms for computing robust multivariate location and scatter, such as minimum covariance determinant, different S~estimators (SURREAL, FAST-S, Bisquare, Rocke-type), orthogonalized Gnanadesikan--Kettenring (OGK) estimator of \citet{maronna:2002}. The next large group of classes are the methods for robust principal component analysis (PCA) including ROBPCA of \citet{hubert-ROBPCA:2005}, spherical principal components (SPC) of \citet{locantore:1999}, the projection pursuit algorithms of \citet{croux-Ruiz-Gazen:2005} and \citet{croux-filzmoser-oliveira-pppca}. Further applications implemented in the framework are linear and quadratic discriminant analysis \citep[see][for a review]{todorov-roblda}, multivariate tests \citep{rousseeuw-willems:2002, todorov-manova} and outlier detection tools. The application of the framework to data analysis as well as the development of new methods is illustrated on examples, which themselves are part of the package. Some issues of the object oriented paradigm as applied to the \proglang{R} object model (naming conventions, access methods, coexistence of \proglang{S}3 and \proglang{S}4 classes, usage of UML, etc.) are discussed. The framework is implemented in the \proglang{R} packages \pkg{robustbase} and \pkg{rrcov}, \citep{todorov-rrcov}, which are available from Comprehensive \proglang{R} Archive Network (CRAN) at \url{http://CRAN.R-project.org} under the GNU General Public License. The rest of the paper is organized as follows. In the next Section~\ref{oof-sec:objmodel} the design principles and the structure of the framework is presented as well as some related object oriented concepts are discussed. As a main tool for modeling of the robust estimation methods a statistical design pattern is proposed. Section~\ref{oof-sec:ex-intro} facilitates the quick start by an example session giving a brief overview of the framework. Section~\ref{oof-sec:multi} describes the robust multivariate methods, their computation and implementation. The Sections~\ref{oof-sec:cov}, \ref{oof-sec:pca} and \ref{oof-sec:lda} are dedicated to the estimation of multivariate location and scatter, principal component analysis and discriminant analysis, respectively. For each domain the object model, the available visualization tools, an example, and other relevant information are presented. We conclude in Section~\ref{oof-sec:conclusions} with discussion and outline of the future work. \section{Design approach and structure of the framework} \label{oof-sec:objmodel} In classical multivariate statistics we rely on parametric models based on assumptions about the structural and the stochastic parts of the model for which optimal procedures are derived, like the least squares estimators and the maximum likelihood estimators. The corresponding robust methods can be seen as extensions to the classical ones which can cope with deviations from the stochastic assumptions thus mitigating the dangers for classical estimators. The developed statistical procedures will remain reliable and reasonably efficient even when such deviations are present. For example in the case of location and covariance estimation the classical theory yields the sample mean $\xbarv$ and the sample covariance matrix $\v{S}$, i.e., the corresponding MLE estimates as an optimal solution. One (out of many) robust alternatives is the minimum covariance determinant estimator. When we consider this situation from an object oriented design point of view we can think of an abstract base class representing the estimation problem, a concrete realization of this object---the classical estimates, and a second concrete derivative of the base class representing the MCD estimates. Since there exist many other robust estimators of multivariate location and covariance which share common characteristics we would prefer to add one more level of abstraction by defining an abstract ``robust'' object from which all other robust estimators are derived. We encounter a similar pattern in most of the other multivariate statistical methods like principal component analysis, linear and quadratic discriminant analysis, etc. and we will call it a \textit{statistical design pattern}. A schematic representation as an \textit{UML diagram} is shown in Figure~\ref{oof-fig:objmodel}. \begin{figure}[h!] \begin{center} \includegraphics[width=1.0\textwidth]{AModel} \label{oof-fig:objmodel} \caption{Class diagram of the statistical design pattern for robust estimation methods.} \end{center} \end{figure} The following simple example demonstrates the functionality. We start with a generic object model of a robust and the corresponding classical multivariate method with all the necessary interfaces and functionalities and then concretize it to represent the desired class hierarchy. The basic idea is to define an abstract \proglang{S}4 class which has as slots the common data elements of the result of the classical method and its robust counterparts (e.g., \code{Pca}). For this abstract class we can implement the standard in \proglang{R} generic functions like \code{print()}, \code{summary()}, \code{plot()} and maybe also \code{predict()}. Now we can derive and implement a concrete class which will represent the classical method, say \code{PcaClassic}. Further we derive another abstract class which represents a potential robust method we are going to implement, e.g., \code{PcaRobust}---it is abstract because we want to have a ``placeholder'' for the robust methods we are going to develop next. The generic functions that we implemented for the class \code{Pca} are still valid for \code{PcaRobust} but whenever necessary we can override them with new functionality. Now we have the necessary platform and of course we have had diligently documented everything we have implemented so far---this is our investment in the future development of robust methods from this family. The framework at its current expansion stage provides such platform for several important families of multivariate methods. It is time to dedicate our effort to the development and implementation of our new robust method/class, say \code{PcaHubert} and only to this---here comes the first obvious benefit from the framework---we do not need to care for the implementation of \code{print()}, \code{summary()}, \code{plot()} and \code{predict()} neither for their documentation or testing. In contrast to the \proglang{S}3 class system the \proglang{S}4 system requires the creation of objects to be done by the \code{new()} function which will perform the necessary validity checks. We go one step further and require that the \code{new()} function is not used directly but only through special functions known in \proglang{R} as \textit{generating functions} or as \textit{constructors} in the conventional object oriented programming languages. A constructor function has the same name as the corresponding class, takes the estimation options as parameters, organizes the necessary computations and returns an object of the class containing the results of the computation. It can take as a parameter also a \textit{control object} which itself is an \proglang{S}4 object and contains the estimation options. More details on the generating functions and their application for structuring the user interface can be found in \citet{todorov-constructors}. The main part of the framework is implemented in the package \pkg{rrcov} but it relies on code in the packages \pkg{robustbase} and \pkg{pcaPP} \citep{filzmoser-pcaPP}. The structure of the framework and its relation to other \proglang{R} packages is shown in Figure~\ref{oof-fig:structure}. \begin{figure}[h!] \begin{center} \includegraphics[width=0.8\textwidth]{Structure} \label{oof-fig:structure} \caption{Class diagram: structure of the framework and relation to other \proglang{R} packages.} \end{center} \end{figure} The framework can be used by other packages, like for example by \pkg{robust} \citep[see][]{konis-robust} or can be further extended. In Figure~\ref{oof-fig:structure} a hypothetical package \pkg{rrcovNA} is shown, which could extend the available robust multivariate methods with options for dealing with missing values. In the rest of this section some object-oriented programming (OOP) concepts will be discussed which are essential for understanding the framework. \newpage \subsection{UML diagrams} \label{oof-sec:UML} Throughout this paper we exploit UML class diagrams to give a clear picture of the framework and its components. UML stands for \textit{Unified Modeling Language}---an object-oriented system of notation which has evolved from previous works of Grady Booch, James Rumbaugh and Ivar Jacobson to become a tool accepted by the Object Management Group (OMG) as the standard for modeling object oriented programs \citep[see][]{umlInfra, umlSuper}. A class diagram models the structure and contents of a system by depicting classes, packages, objects and the relations among them with the aim to increase the ease of understanding the considered application. A class is denoted by a box with three compartments which contain the name, the attributes (slots) and operations (methods) of the class, respectively. The class name in italics indicates that the class is abstract. The bottom two compartments could be omitted or they can contain only the key attributes and operations which are useful for understanding the particular diagram. Each attribute is followed by its type and each operation---by the type of its return value. We use the \proglang{R} types like \code{numeric}, \code{logical}, \code{vector}, \code{matrix}, etc. but the type can be also a name of an \proglang{S}4 class. Relationships between classes are denoted by lines or arrows with different form. The inheritance relationship is depicted by a large empty triangular arrowhead pointing to the base class. Composition means that one class contains another one as a slot (not to be mistaken with the keyword ``contains'' signalling inheritance in \proglang{R}). This relation is represented by an arrow with a solid diamond on the side of the composed class. If a class ``uses'' another one or depends on it, the classes are connected by a dashed arrow (dependence relation). Packages can also be present in a class diagram---in our case they correspond more or less to \proglang{R} packages---and are shown as tabbed boxes with the name of the package written in the tab (see Figure~\ref{oof-fig:structure}). All UML diagrams of the framework were created with the open source UML tool \pkg{ArgoUML} \citep{argo:phd, argo:2000} which is available for download from \url{http://argouml.tigris.org/}. \subsection{Design patterns} \label{oof-sec:patterns} Design patterns are usually defined as general solutions to recurring design problems and refer to both the description of a solution and an instance of that solution solving a particular problem. The current use of the term design patterns originates in the writings of the architect Christopher Alexander devoted to urban planning and building architecture \citep{alexander} but it was brought to the software development community by the seminal book of \citet{gamma}. A design pattern can be seen as a template for how to solve a problem which can be used in many different situations. Object-Oriented design patterns are about classes and the relationships between classes or objects at abstract level, without defining the final classes or objects of the particular application. In order to be usable, design patterns must be defined formally and the documentation, including a preferably evocative name, describes the context in which the pattern is used, the pattern structure, the participants and collaboration, thus presenting the suggested solution. Design patterns are not limited to architecture or software development but can be applied in any domain where solutions are searched for. During the development of the here presented framework several design patterns were identified, which we prefer to call \textit{statistical design patterns}. The first one was already described earlier in this section and captures the relations among a classical and one or more alternative robust multivariate estimators. Another candidate is the control object encapsulating the estimation parameters and a third one is the factory-like construct which suggests selection of a robust estimation method and creation of the corresponding objects based on the data set characteristics (see Section~\ref{oof-sec:cov}). The formal description of these design patterns is beyond the scope of this work and we will limit the discussion to several examples. \subsection{Accessor methods} \label{oof-sec:accessors} One of the major characteristics and advantages of object oriented programming is the encapsulation. Unfortunately real encapsulation (information hiding) is missing in \proglang{R}, but as far as the access to the member variables is concerned this could be mitigated by defining accessor methods (i.e., methods used to examine or modify the slots (member variables) of a class) and ``advising'' the users to use them instead of directly accessing the slots. The usual way of defining accessor functions in \proglang{R} is to use the same name as the name of the corresponding slot. For example for the slot \code{a} these are: \begin{Scode} R> cc <- a(obj) R> a(obj) <- cc \end{Scode} In many cases this is not possible, because of conflicts with other existing functions. For example it is not possible to define an accessor function \code{cov()} for the slot \code{cov} of class \code{Cov}, since the function \code{cov()} already exists in the \code{base} \proglang{R}. Also it is not immediately seen if a slot is ``read only'' or can be modified by the user (unfortunately, as already mentioned, every slot in \proglang{R} can be modified by simply using \code{obj@a <- cc}). In \pkg{rrcov} a notation was adopted, which is usual in \proglang{Java}: the accessors are defined as \code{getXxx()} and \code{setXxx()} (if a \code{setXxx()} method is missing, we are ``not allowed'' to change the slot). The use of accessor methods allows to perform computations on demand (\code{getMah(mcd)} computes the Mahalanobis distances, stores them into the object and returns them) or even have ``virtual'' slots which are not at all stored in the object (e.g., \code{getCorr(mcd)} computes each time and returns the correlation matrix without storing it). \subsection{Naming conventions} \label{oof-sec:naming} %% %From Sun: "Class names should be nouns, in mixed case with the first letter of each %internal word capitalized. Methods should be verbs, in mixed case with the first %letter lowercase, with the first letter of each internal word capitalized." %% %No coding rules in R: the R Internals manual that is shipped with R %also has a section on coding standards: %http://cran.r-project.org/doc/manuals/R-ints.html#R-coding-standards %though this is quite short and does not go much beyond the basic indentation %% There is no agreed naming convention (coding rules) in \proglang{R} but to facilitate the framework usage several simple rules are in order, following the recommended Sun's \proglang{Java} coding style (see \url{http://java.sun.com/docs/codeconv/}): \bi \item{Class, function, method and variable names are alphanumeric, do not contain ``-'' or ``.'' but rather use interchanging lower and upper case.} \item{Class names start with an uppercase letter.} \item{Methods, functions, and variables start with a lowercase letter.} \item{Exceptions are functions returning an object of a given class (i.e., generating functions or constructors)---they have the same name as the class.} \item{Variables and methods which are not intended to be seen by the user---i.e., private members---start with ``.''.} \item{Violate these rules whenever necessary to maintain compatibility.} \ei \section{Example session} \label{oof-sec:ex-intro} In this section we will introduce the base functionalities of the framework by an example session. First of all we have to load the package \pkg{rrcov} which will cause all necessary packages to be loaded too. The framework includes many example data sets but here we will load only those which will be used throughout the following examples. For the rest of the paper it will be assumed that the package has been loaded already. <>= ## set the prompt to "R> " and the continuation to "+ " options(prompt="R> ", continue="+ ") @ <>= ## ## Load the 'rrcov' package and the first two data sets to be ## used throughout the examples ## library("rrcov") data("delivery") delivery.x <- delivery[,1:2] # take only the X part data("hbk") hbk.x <- hbk[,1:3] # take only the X part @ Most of the multivariate statistical methods are based on estimates of multivariate location and covariance, therefore these estimates play a central role in the framework. We will start with computing the robust \textit{minimum covariance determinant} estimate for the data set \code{delivery} from the package \pkg{robustbase}. The data set \citep[see][Table~23, p.~155]{rousseeuw-leroy} contains delivery time data in 25 observations with 3 variables. The aim is to explain the time required to service a vending machine \code{(Y)} by means of the number of products stocked \code{(X1)} and the distance walked by the route driver \code{(X2)}. For this example we will consider only the $\v{X}$ part of the data set. After computing its robust location and covariance matrix using the MCD method implemented in the function \code{CovMcd()} we can print the results by calling the default \code{show()} method on the returned object \code{mcd} as well as summary information by the \code{summary()} method. The standard output contains the robust estimates of location and covariance. The summary output contains additionally the eigenvalues of the covariance matrix and the robust distances of the data items (Mahalanobis type distances computed with the robust location and covariance instead of the sample ones). <>= ## ## Compute MCD estimates for the delivery data set ## - show() and summary() examples ## mcd <- CovMcd(delivery.x) mcd summary(mcd) @ <>= ## ## Example plot of the robust against classical ## distances for the delivery data set ## plot(mcd, which="dd") @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=0.8\textwidth} \includegraphics{ooframework-intro-plot} \caption{Example plot of the robust against classical distances for the \code{delivery} data set.} \label{oof-fig:intro} \end{figure} \end{center} Now we will show one of the available plots by calling the \code{plot()} method---in Figure~\ref{oof-fig:intro} the Distance-Distance plot introduced by \citet{Rousseeuw-van-Zomeren} is presented, which plots the robust distances versus the classical Mahalanobis distances and allows to classify the observations and identify the potential outliers. The description of this plot as well as examples of more graphical displays based on the covariance structure will be shown in Section~\ref{oof-sec:cov}. Apart from the demonstrated MCD method the framework provides many other robust estimators of multivariate location and covariance, actually almost all of the well established estimates in the contemporary robustness literature. The most fascinating feature of the framework is that one will get the output and the graphs in the same format, whatever estimation method was used. For example the following code lines will compute the S~estimates for the same data set and provide the standard and extended output (not shown here). <>= ## ## Compute the S-estimates for the delivery data set ## and provide the standard and extended output ## est <- CovSest(delivery.x, method="bisquare") est summary(est) @ Nevertheless, this variety of methods could pose a serious hurdle for the novice and could be quite tedious even for the experienced user. Therefore a shortcut is provided too---the function \code{CovRobust()} can be called with a parameter set specifying any of the available estimation methods, but if this parameter set is omitted the function will decide on the basis of the data size which method to use. As we see in the example below, in this case it selects the Stahel-Donoho estimates. For details and further examples see Section~\ref{oof-sec:cov}. <>= ## ## Automatically select the appropriate estimator according ## to the problem size - in this example the Stahel-Donoho estimates ## will be selected. ## est <- CovRobust(delivery.x) est @ \section{Robust multivariate methods} \label{oof-sec:multi} \subsection{Multivariate location and scatter} \label{oof-sec:cov} The framework provides an almost complete set of estimators for multivariate location and scatter with high breakdown point. The first such estimator was proposed by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} and it is recommended for small data sets, but the most widely used high breakdown estimator is the minimum covariance determinant estimate \citep{rousseeuw:85}. Several algorithms for computing the S~estimators \citep{davies:87} are provided \citep{ruppert:1992, rocke:94, rocke:96a, salibian:2005}. The minimum volume ellipsoid (MVE) estimator \citep{rousseeuw:85} is also included since it has some desirable properties when used as initial estimator for computing the S~estimates \citep[see][p. 198]{maronna:2006}. In the rest of this section the definitions of the different estimators of location and scatter will be briefly reviewed and the algorithms for their computation will be discussed. Further details can be found in the relevant references. The object model is presented and examples of its usage, as well as further examples of the graphical displays are given. \subsubsection{The Minimum covariance determinant estimator and its computation} \label{oof-sec:cov-mcd} The MCD estimator for a data set $\{\xv_1, \ldots, \xv_n\}$ in $\Re^p$ is defined by that subset $\{\xv_{i_1}, \ldots, \xv_{i_h}\}$ of $h$ observations whose covariance matrix has the smallest determinant among all possible subsets of size $h$. The MCD location and scatter estimate $\v{T}_{\MCD}$ and $\v{C}_{\MCD}$ are then given as the arithmetic mean and a multiple of the sample covariance matrix of that subset \begin{eqnarray} \label{oof-eq:mcd} \v{T}_{\MCD} &=& \frac{1}{h}\sum^{h}_{j=1} \xv_{i_j} \nonumber\\ \v{C}_{MCD} &=& c_{ccf}c_{sscf}\frac{1}{h-1}\sum^{h}_{j=1} (\xv_{i_j}-\v{T}_{\MCD})(\xv_{i_j}-\v{T}_{\MCD})^{\top}. \end{eqnarray} The multiplication factors $c_{ccf}$ (consistency correction factor) and $c_{sscf}$ (small sample correction factor) are selected so that $\v{C}$ is consistent at the multivariate normal model and unbiased at small samples \citep[see][]{butler:1993, croux-haesbroeck:99, pison:2002, todorov-cf}. A recommendable choice for $h$ is $\lfloor(n+p+1)/2\rfloor$ because then the BP of the MCD is maximized, but any integer $h$ within the interval $[(n + p + 1)/2,n]$ can be chosen, see \citet{rousseeuw-leroy}. Here $\lfloor z\rfloor$ denotes the integer part of $z$ which is not less than $z$. If $h = n$ then the MCD location and scatter estimate $\v{T}_{\MCD}$ and $\v{C}_{\MCD}$ reduce to the sample mean and covariance matrix of the full data set. The computation of the MCD estimator is far from being trivial. The naive algorithm would proceed by exhaustively investigating all subsets of size $h$ out of $n$ to find the subset with the smallest determinant of its covariance matrix, but this will be feasible only for very small data sets. Initially MCD was neglected in favor of MVE because the simple resampling algorithm was more efficient for MVE. Meanwhile several heuristic search algorithms \citep[see][]{todorov:92, rocke:94, hawkins:94} and exact algorithms \citep[][]{agullo:96} were proposed but now a very fast algorithm due to \citet{rousseeuw-vandriessen} exists and this algorithm is usually used in practice. The algorithm is based on the C-step which moves from one approximation $(\v{T}_1, \v{C}_1)$ of the MCD estimate of a data set $\v{X}=\{\xv_1, \ldots, \xv_n\}$ to the next one $(\v{T}_2, \v{C}_2)$ with possibly lower determinant $\det(\v{C}_2) \le \det(\v{C}_1)$ by computing the distances $d_1, \ldots, d_n$ relative to $(\v{T}_1, \v{C}_1)$, i.e., \begin{equation} \label{oof-eq:mah} d_i=\sqrt{(\xv_i-\v{T}_1)^{\top}\v{C}_1^{-1}(\xv_i-\v{T}_1)} \end{equation} and then computing $(\v{T}_2, \v{C}_2)$ for those $h$ observations which have smallest distances. ``C'' in C-step stands for ``concentration'' since we are looking for a more ``concentrated'' covariance matrix with lower determinant. \citet{rousseeuw-vandriessen} have proven a theorem stating that the iteration process given by the C-step converges in a finite number of steps to a (local) minimum. Since there is no guarantee that the global minimum of the MCD objective function will be reached, the iteration must be started many times from different initial subsets, to obtain an approximate solution. The procedure is very fast for small data sets but to make it really ``fast'' also for large data sets several computational improvements are used. \bi \item{\textit{initial subsets}: It is possible to restart the iterations from randomly generated subsets of size $h$, but in order to increase the probability of drawing subsets without outliers, $p+1$ points are selected randomly. These $p+1$ points are used to compute ($\v{T}_0,\v{C}_0)$. Then the distances $d_1,\ldots, d_n$ are computed and sorted in increasing order. Finally the first $h$ are selected to form the initial $h-$subset $H_0$.} \item{\textit{reduced number of C-steps}: The C-step involving the computation of the covariance matrix, its determinant and the relative distances, is the most computationally intensive part of the algorithm. Therefore instead of iterating to convergence for each initial subset only two C-steps are performed and the 10 subsets with lowest determinant are kept. Only these subsets are iterated to convergence. } \item{\textit{partitioning}: For large $n$ the computation time of the algorithm increases mainly because all $n$ distances given by Equation~(\ref{oof-eq:mah}) have to be computed at each iteration. An improvement is to partition the data set into a maximum of say five subsets of approximately equal size (but not larger than say 300) and iterate in each subset separately. The ten best solutions for each data set are kept and finally only those are iterated on the complete data set. } \item{\textit{nesting}: Further decrease of the computational time can be achieved for data sets with $n$ larger than say 1500 by drawing 1500 observations without replacement and performing the computations (including the partitioning) on this subset. Only the final iterations are carried out on the complete data set. The number of these iterations depends on the actual size of the data set at hand.} \ei The MCD estimator is not very efficient at normal models, especially if $h$ is selected so that maximal BP is achieved. To overcome the low efficiency of the MCD estimator, a reweighed version can be used. For this purpose a weight $w_i$ is assigned to each observation $\xv_i$, defined as $w_i=1$ if $(\xv_i-\v{T}_{\MCD})^{\top}\v{C}_{\MCD}^{-1}(\xv_i-\v{T}_{\MCD}) \le \chi^2_{p,0.975}$ and $w_i=0$ otherwise, relative to the raw MCD estimates $(\v{T}_{\MCD}, \v{C}_{\MCD})$. Then the reweighted estimates are computed as \begin{eqnarray} \label{oof-eq:mcd-rew} \v{T}_R &=& \frac{1}{\nu}\sum^{n}_{i=1}{w_i\xv_i},\nonumber\\ \v{C}_R &=& c_{r.ccf}c_{r.sscf}\frac{1}{\nu-1}\sum^n_{i=1}{w_i(\xv_i-\v{T}_R)(\xv_i-\v{T}_R)^{\top}}, \end{eqnarray} where $\nu$ is the sum of the weights, $\nu =\sum^n_{i=1}{w_i}$. Again, the multiplication factors $c_{r.ccf}$ and $c_{r.sscf}$ are selected so that $\v{C}_R$ is consistent at the multivariate normal model and unbiased at small samples \citep[see][and the references therein]{pison:2002, todorov-cf}. These reweighted estimates $(\v{T}_R,\v{C}_R)$ which have the same breakdown point as the initial (raw) estimates but better statistical efficiency are computed and used by default. \subsubsection{The Minimum volume ellipsoid estimates} \label{oof-sec:cov-mve} The minimum volume ellipsoid estimator searches for the ellipsoid of minimal volume containing at least half of the points in the data set $\v{X}$. Then the location estimate is defined as the center of this ellipsoid and the covariance estimate is provided by its shape. Formally the estimate is defined as these $\v{T}_{\MVE},\v{C}_{\MVE}$ that minimize $\det(\v{C})$ subject to \begin{equation} \label{oof-eq:mve} \#\{i:(\xv_i - \v{T})^{\top}\v{C}^{-1}(\xv_i - \v{T}) \le c^2\} \ge \left \lfloor \frac{n+p+1}{2} \right \rfloor, \end{equation} where \# denotes the cardinality. The constant $c$ is chosen as $\chi^2_{p,0.5}$. The search for the approximate solution is made over ellipsoids determined by the covariance matrix of $p+1$ of the data points and by applying a simple but effective improvement of the sub-sampling procedure as described in \citet{maronna:2006}, p. 198. Although there exists no formal proof of this improvement (as for MCD and LTS), simulations show that it can be recommended as an approximation of the MVE. The MVE was the first popular high breakdown point estimator of location and scatter but later it was replaced by the MCD, mainly because of the availability of an efficient algorithm for its computation \citep{rousseeuw-vandriessen}. Recently the MVE gained importance as initial estimator for S~estimation because of its small maximum bias \citep[see][Table~6.2, p.~196]{maronna:2006}. \subsubsection{The Stahel-Donoho estimator} \label{oof-sec:cov-sde} The first multivariate equivariant estimator of location and scatter with high breakdown point was proposed by \citet{stahel:81, stahel-phd:81} and \citet{donoho:82} but became better known after the analysis of \citet{maronna:95}. For a data set $\v{X}=\{\xv_1,\ldots,\xv_n\}$ in $\Re^p$ it is defined as a weighted mean and covariance matrix of the form given by Equation~(\ref{oof-eq:mcd-rew}) where the weight $w_i$ of each observation is inverse proportional to the ``outlyingness'' of the observation. Let the univariate outlyingness of a point $\xv_i$ with respect to the data set $\v{X}$ along a vector $\v{a} \in \Re^p, ||\v{a}|| \ne \v{0}$ be given by \begin{equation} \label{oof-eq:sde1} r(\xv_i,\v{a}) = \frac{|\xv^{\top}\v{a}-m(\v{a}^{\top}\v{X})|}{s(\v{a}^{\top}\v{X})}~~~i=1,\ldots,n \end{equation} where $(\v{a}^{\top}\v{X})$ is the projection of the data set $\v{X}$ on $\v{a}$ and the functions $m()$ and $s()$ are robust univariate location and scale statistics, for example the median and MAD, respectively. Then the multivariate outlyingness of $\xv_i$ is defined by \begin{equation} \label{oof-eq:sde2} r_i=r(\xv_i) = \max_{\v{a}} r(\xv_i,\v{a}). \end{equation} The weights are computed by $w_i=w(r_i)$ where $w(r)$ is a nonincreasing function of $r$ and $w(r)$ and $w(r)r^2$ are bounded. \citet{maronna:95} use the weights \begin{equation} \label{oof-eq:sde-weight} w(r)=\min \left ( 1,\left (\frac{c}{t} \right )^2 \right ) \end{equation} with $c=\sqrt{\chi^2_{p,\beta}}$ and $\beta=0.95$, that are known in the literature as ``Huber weights''. Exact computation of the estimator is not possible and an approximate solution is found by subsampling a large number of directions $\v{a}$ and computing the outlyingness measures $r_i, i=1,\ldots,n$ for them. For each subsample of $p$ points the vector $\v{a}$ is taken as the norm 1 vector orthogonal to the hyperplane spanned by these points. It has been shown by simulations \citep{maronna:2006} that one step reweighting does not improve the estimator. \subsubsection{Orthogonalized Gnanadesikan/Kettenring} \label{oof-sec:cov-ogk} The MCD estimator and all other known affine equivariant high-breakdown point estimates are solutions to a highly non-convex optimization problem and as such pose a serious computational challenge. Much faster estimates with high breakdown point can be computed if one gives up the requirements of affine equivariance of the covariance matrix. Such an algorithm was proposed by \citet{maronna:2002} which is based on the very simple robust bivariate covariance estimator $s_{jk}$ proposed by \citet{Gnanadesikan-Kettenring:1972} and studied by \citet{devlin:81}. For a pair of random variables $Y_j$ and $Y_k$ and a standard deviation function $\sigma()$, $s_{jk}$ is defined as \begin{equation} \label{oof-eq:GK} s_{jk}=\frac{1}{4}\left(\sigma \left(\frac{Y_j}{\sigma(Y_j)}+\frac{Y_k}{\sigma(Y_k)}\right)^2 - \sigma \left(\frac{Y_j}{\sigma(Y_j)}-\frac{Y_k}{\sigma(Y_k)}\right)^2\right). \end{equation} If a robust function is chosen for $\sigma()$ then $s_{jk}$ is also robust and an estimate of the covariance matrix can be obtained by computing each of its elements $s_{jk}$ for each $j=1,\ldots,p$ and $k=1,\ldots,p$ using Equation~(\ref{oof-eq:GK}). This estimator does not necessarily produce a positive definite matrix (although symmetric) and it is not affine equivariant. \citet{maronna:2002} overcome the lack of positive definiteness by the following steps: \bi \item{Define $\yv_i=\vv{D}^{-1}\xv_i, i=1,\ldots,n$ with $\v{D}=\diag(\sigma(X_1),\ldots,\sigma(X_p))$ where $X_l, l=1,\ldots,p$ are the columns of the data matrix $\vv{X}=\{\xv_1, \ldots, \xv_n\}$. Thus a normalized data matrix $\vv{Y}=\{\yv_1, \ldots, \yv_n\}$ is computed.} \item{Compute the matrix $\vv{U}=(u_{jk})$ as $u_{jk}= s_{jk}=s(Y_j, Y_k)$ if $j \ne k$ or $u_{jk}= 1$ otherwise. Here $Y_l, l=1,\ldots,p$ are the columns of the transformed data matrix $\vv{Y}$ and $s(.,.)$ is a robust estimate of the covariance of two random variables like the one in Equation~(\ref{oof-eq:GK}).} \item{Obtain the ``principal component decomposition'' of $\vv{Y}$ by decomposing $\vv{U}=\vv{E}\vv{\Lambda}\vv{E}^{\top}$ where $\vv{\Lambda}$ is a diagonal matrix $\vv{\Lambda}=\diag(\lambda_1,\ldots,\lambda_p)$ with the eigenvalues $\lambda_j$ of $\vv{U}$ and $\vv{E}$ is a matrix with columns the eigenvalues $\vv{e}_j$ of $\vv{U}$.} \item{Define $\zv_i=\vv{E}^{\top}\yv_i=\vv{E}^{\top}\vv{D}^{-1}\xv_i$ and $\vv{A}=\vv{D}\vv{E}$. Then the estimator of $\vv{\Sigma}$ is $\vv{C}_{\OGK}=\vv{A}\vv{\Gamma}\vv{A}^{\top}$ where $\vv{\Gamma}=\diag(\sigma(Z_j)^2), j=1,\ldots,p$} and the location estimator is $\vv{T}_{\OGK}=\vv{A}\mv$ where $\mv=m(\zv_i) = (m(Z_1),\ldots,m(Z_p))$ is a robust mean function. \ei This can be iterated by computing $\vv{C}_{\OGK}$ and $\vv{T}_{\OGK}$ for $\vv{Z}=\{\zv_1, \ldots, \zv_n\}$ obtained in the last step of the procedure and then transforming back to the original coordinate system. Simulations \citep{maronna:2002} show that iterations beyond the second did not lead to improvement. Similarly as for the MCD estimator a one-step reweighting can be performed using Equations~(\ref{oof-eq:mcd-rew}) but the weights $w_i$ are based on the 0.9 quantile of the $\chi^2_p$ distribution (instead of 0.975) and the correction factors $c_r.ccf$ and $c_r.sscf$ are not used. In order to complete the algorithm we need a robust and efficient location function $m()$ and scale function $\sigma()$, and one proposal is given in \citet{maronna:2002}. Further, the robust estimate of covariance between two random vectors $s()$ given by Equation~(\ref{oof-eq:GK}) can be replaced by another one. In the framework two such functions are predefined but the user can provide as a parameter an own function. \subsubsection{S estimates} \label{oof-sec:cov-s} S~estimators of $\muv$ and $\v{\Sigma}$ were introduced by \citet{davies:87} and further studied by \citet{lopuhaa:1989} \citep[see also][p. 263]{rousseeuw-leroy}. For a data set of $p$-variate observations $\{\xv_1, \ldots, \xv_n\}$ an S~estimate $(\v{T},\v{C})$ is defined as the solution of $\sigma(d_1,\ldots,d_n)= \min$ where $d_i=(\xv-\v{T})^{\top}\v{C}^{-1}(\xv-\v{T})$ and $\det(\v{C})=1$. Here $\sigma=\sigma(\zv)$ is the M-scale estimate of a data set $\zv=\{z_1,\ldots,z_n\}$ defined as the solution of $\frac{1}{n}\Sigma\rho(z/\sigma)=\delta$ where $\rho$ is nondecreasing, $\rho(0)=0$ and $\rho(\infty)=1$ and $\delta \in(0,1)$. An equivalent definition is to find the vector $\v{T}$ and a positive definite symmetric matrix $\v{C}$ that minimize $\det(\v{C})$ subject to \begin{equation} \label{oof-eq:s-def} \frac{1}{n}\sum_{i=1}^{n}\rho(d_i)=b_0 \end{equation} with the above $d_i$ and $\rho$. As shown by \citet{lopuhaa:1989} S~estimators have a close connection to the M~estimators and the solution $(\v{T},\v{C})$ is also a solution to an equation defining an M~estimator as well as a weighted sample mean and covariance matrix: \begin{eqnarray} \label{oof-eq:s-iter} d_i^{j}&=&[(\xv_i-\v{T}^{(j-1)})^{\top}\v{(C}^{(j-1)})^{-1}(\xv-\v{T}^{(j-1)})]^{1/2} \nonumber\\ \v{T}^{(j)} &=& \frac{\Sigma w(d_i^{(j)})\xv_i}{\Sigma w(d_i^{(j)})} \nonumber\\ \v{C}^{(j)} &=& \frac{\Sigma w(d_i^{(j)})(\xv_i-\v{T}^{(j)})(\xv_i-\v{T}^{(j)})^{\top}}{\Sigma w(d_i^{(j)})} \end{eqnarray} The framework implements the S~estimates in the class \code{CovSest} and provides four different algorithms for their computation. \be \item{\emph{SURREAL}: This algorithm was proposed by \citet{ruppert:1992} as an analog to the algorithm proposed by the same author for computing S~estimators of regression.} \item{\emph{Bisquare S~estimation with HBDP start}: S~estimates with the biweight $\rho$ function can be obtained using the Equations~(\ref{oof-eq:s-iter}) by a reweighted sample covariance and reweighted sample mean algorithm as described in \citet{maronna:2006}. The preferred approach is to start the iteration from a bias-robust but possibly inefficient estimate which is computed by some form of sub-sampling. Since \citet{maronna:2006} have shown that the MVE has smallest maximum bias (Table~6.2, p.~196) it is recommended to use it as initial estimate.} \item{\emph{Rocke type S~estimates}: In \citet{rocke:96a} it is shown that S~estimators in high dimensions can be sensitive to outliers even if the breakdown point is set to 50\%. Therefore they propose a modified $\rho$ function called translated biweight (or t-biweight) and replace the standardization step given in Equation~(\ref{oof-eq:s-def}) with a standardization step consisting of equating the median of $\rho(d_i)$ with the median under normality. The estimator is shown to be more outlier resistant in high dimensions than the typical S~estimators. The specifics of the iteration are given in \citet{rocke:96}, see also \citet{maronna:2006}. As starting values for the iteration any of the available methods in the framework can be used. The recommended (and consequently the default) one is the MVE estimator computed by \code{CovMve()}.} \item{\emph{Fast~S~estimates}: \citet{salibian:2005} proposed a fast algorithm for regression S~estimates similar to the FAST-LTS algorithm of \citet{rousseeuw-vandriessen:LTS} and borrowing ideas from the SURREAL algorithm of \citet{ruppert:1992}. Similarly, the FAST-S algorithm for multivariate location and scatter is based on modifying each candidate to improve the S-optimality criterion thus reducing the number of the necessary sub-samples required to achieve desired high breakdown point with high probability.} \ee \subsubsection{Object model for robust location and scatter estimation} \label{oof-sec:cov-objmodel} The object model for the \proglang{S}4 classes and methods implementing the different multivariate location and scatter estimators follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-cov}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{CovModel} \caption{Object model for robust location and scatter estimation.} \label{fig:uml-cov} \end{center} \end{figure} The abstract class \code{Cov} serves as a base class for deriving all classes representing classical and robust location and scatter estimation methods. It defines the common slots and the corresponding accessor methods, provides implementation for the general methods like \code{show()}, \code{plot()} and \code{summary()}. The slots of \code{Cov} hold some input or default parameters as well as the results of the computations: the location, the covariance matrix and the distances. The \code{show()} method presents brief results of the computations and the \code{summary()} method returns an object of class \code{SummaryCov} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new data (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. The classical location and scatter estimates are represented by the class \code{CovClassic} which inherits directly from \code{Cov} (and uses all slots and methods defined there). The function \code{CovClassic()} serves as a constructor (generating function) of the class. It can be called by providing a data frame or matrix. As already demonstrated in Section~\ref{oof-sec:ex-intro} the methods \code{show()} and \code{summary()} present the results of the computations. The \code{plot()} method draws different diagnostic plots which are shown in one of the next sections. The accessor functions like \code{getCenter()}, \code{getCov()}, etc. are used to access the corresponding slots. Another abstract class, \code{CovRobust} is derived from \code{Cov}, which serves as a base class for all robust location and scatter estimators. The classes representing robust estimators like \code{CovMcd}, \code{CovMve}, etc. are derived from \code{CovRobust} and provide implementation for the corresponding methods. Each of the constructor functions \code{CovMcd()}, \code{CovMve()},\code{CovOgk()}, \code{CovMest()} and \code{CovSest()} performs the necessary computations and returns an object of the class containing the results. Similarly as the \code{CovClassic()} function, these functions can be called either with a data frame or a numeric matrix. \subsubsection{Controlling the estimation options} \label{oof-sec:cov-control} Although the different robust estimators of multivariate location and scatter have some controlling options in common, like the tracing flag \code{trace} or the numeric tolerance \code{tolSolve} to be used for inversion (\code{solve}) of the covariance matrix in \code{mahalanobis()}, each of them has more specific options. For example, the MCD and MVE estimators (\code{CovMcd()} and \code{CovMve()}) can specify \code{alpha} which controls the size of the subsets over which the determinant (the volume of the ellipsoid) is minimized. The allowed values are between 0.5 and 1 and the default is 0.5. Similarly, these estimators have parameters \code{nsamp} for the number of subsets used for initial estimates and \code{seed} for the initial seed for \proglang{R}'s random number generator while the M and S~estimators (\code{CovMest} and \code{CovSest}) have to specify the required breakdown point (allowed values between $(n - p)/(2*n)$ and 1 with default 0.5) as well as the asymptotic rejection point, i.e., the fraction of points receiving zero weight \citep{rocke:96}. These parameters can be passed directly to the corresponding constructor function but additionally there exists the possibility to use a control object serving as a container for the parameters. The object model for the control objects shown in Figure~\ref{oof-fig:cov-control} follows the proposed class hierarchy---there is a base class \code{CovControl} which holds the common parameters and from this class all control classes holding the specific parameters of their estimators are derived. These classes have only a constructor function for creating new objects and a method \code{restimate()} which takes a data frame or a matrix, calls the corresponding estimator to perform the calculations and returns the created class with the results. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{CovControl} \caption{Object model of the control classes for robust location and scatter estimation.} \label{oof-fig:cov-control} \end{center} \end{figure} Apart from providing a structured container for the estimation parameters this class hierarchy has the following additional benefits: \bi \item{the parameters can be passed easily to another multivariate method, for example the principal components analysis based on a covariance matrix \code{PcaCov()} (see Section~\ref{oof-sec:pca}) can take a control object which will be used to estimate the desired covariance (or correlation) matrix. In the following example a control object holding the parameters for S~estimation will be created and then \code{PcaCov()} will be called with this object.} <>= set.seed(1234) @ <>= ## ## Controlling the estimation options with a control object ## control <- CovControlSest(method="biweight") PcaCov(hbk.x, cov.control=control) @ \item{the class hierarchy of the control objects allows to handle different estimator objects using a uniform interface thus leveraging one of the most important features of the object oriented programming, the polymorphism. In the following example we create a list containing different control objects and then via \code{sapply} we call the generic function \code{restimate()} on each of the objects in the list. The outcome will be a list containing the objects resulting from these calls (all are derived from \code{CovRobust}). This looping over the different estimation methods is very useful for implementing simulation studies.} <>= ## ## Controlling the estimation options: example ## of looping through several estimators ## cc <- list(CovControlMcd(), CovControlMest(), CovControlOgk(), CovControlSest(), CovControlSest(method="rocke")) clist <- sapply(cc, restimate, x=delivery.x) sapply(clist, data.class) sapply(clist, getMeth) @ \ei \subsubsection[A generalized function for robust location and covariance estimation: CovRobust()]{A generalized function for robust location and covariance estimation: \code{CovRobust()}} \label{oof-sec:cov-covrobust} The provided variety of estimation methods, each of them with different parameters as well as the object models described in the previous sections can be overwhelming for the user, especially for the novice who does not care much about the technical implementation of the framework. Therefore a function is provided which gives a quick access to the robust estimates of location and covariance matrix. This function is loosely modeled around the \textit{abstract factory design pattern} \citep[see][page 87]{gamma} in the sense that it creates concrete objects of derived classes and returns the result over a base class interface. The class \code{CovRobust} is abstract (defined as \textit{VIRTUAL}) and no objects of it can be created but any of the classes derived from \code{CovRobust}, such as \code{CovMcd} or \code{CovOgk}, can act as an object of class \code{CovRobust}. The function \code{CovRobust()} which is technically not a constructor function can return an object of any of the classes derived from \code{CovRobust} according to the user request. This request can be specified in one of three forms: \bi \item{If only a data frame or matrix is provided and the control parameter is omitted, the function decides which estimate to apply according to the size of the problem at hand. If there are less than 1000 observations and less than 10 variables or less than 5000 observations and less than 5 variables, Stahel-Donoho estimator will be used. Otherwise, if there are less than 50000 observations, either bisquare S~estimates (in case of less than 10 variables) or Rocke type S~estimates (for 10 to 20 variables) will be used. In both cases the S iteration starts at the initial MVE estimate. And finally, if there are more than 50000 observations and/or more than 20 variables the Orthogonalized Quadrant Correlation estimator (\code{CovOgk} with the corresponding parameters) is used. This is illustrated by the following example.} <>= ## ## Automatically select the appropriate estimator according ## to the problem size. ## getMeth(CovRobust(matrix(rnorm(40), ncol=2))) # 20x2 - SDE getMeth(CovRobust(matrix(rnorm(16000), ncol=8))) # 2000x8 - bisquare S getMeth(CovRobust(matrix(rnorm(20000), ncol=10))) # 2000x10 - Rocke S getMeth(CovRobust(matrix(rnorm(200000), ncol=2))) # 100000x2 - OGK @ \item{The simplest way to choose an estimator is to provide a character string with the name of the estimator---one of \code{"mcd"}, \code{"ogk"}, \code{"m"}, \code{"s-fast"}, \code{"s-rocke"}, etc.} <>= ## ## Rocke-type S-estimates ## getMeth(CovRobust(matrix(rnorm(40), ncol=2), control="rocke")) @ \item{If it is necessary to specify also some estimation parameters, the user can create a control object (derived from \code{CovControl}) and pass it to the function together with the data. For example to compute the OGK estimator using the median absolute deviation (MAD) as a scale estimate and the quadrant correlation (QC) as a pairwise correlation estimate we create a control object \code{ctrl} passing the parameters \code{s_mad} and \code{s_qc} to the constructor function and then call \code{CovRobust} with this object. The last command line illustrates the accessor method for getting the correlation matrix of the estimate as well as a nice formatting method for covariance matrices.} <>= ## ## Specify some estimation parameters through a control object. ## The last command line illustrates the accessor method ## for getting the correlation matrix of the estimate ## as well as a nice formatting method for covariance ## matrices. ## data("toxicity") ctrl <- CovControlOgk(smrob = "s_mad", svrob = "qc") est <- CovRobust(toxicity, ctrl) round(getCenter(est),2) as.dist(round(getCorr(est), 2)) @ \ei \subsubsection{Visualization of the results} \label{oof-sec:cov-vis} The default plot accessed through the method \code{plot()} of class \code{CovRobust} is the Distance-Distance plot introduced by \citet{Rousseeuw-van-Zomeren}. An example of this graph, which plots the robust distances versus the classical Mahalanobis distances is shown in Figure~\ref{oof-fig:intro}. The dashed line represents the points for which the robust and classical distances are equal. The horizontal and vertical lines are drawn at values $x=y=\sqrt{\chi_{p,0.975}^2}$. Points beyond these lines can be considered as outliers and are identified by their labels. The other available plots are accessible either interactively or through the \code{which} parameter of the \code{plot()} method. The left panel of Figure~\ref{oof-fig:cov-lattice} shows an example of the distance plot in which robust and classical Mahalanobis distances are shown in parallel panels. The outliers have large robust distances and are identified by their labels. The right panel of Figure~\ref{oof-fig:cov-lattice} shows a Quantile-Quantile comparison plot of the robust and the classical Mahalanobis distances versus the square root of the quantiles of the chi-squared distribution. <>= ## ## Distance plot and Chi-square Q-Q plot of the robust and classical distances ## Lattice plots (currently not available in rrcov) ## library("lattice") library("grid") library("rrcov") data("delivery") X <- delivery[,1:2] myPanel.dd <- function(x, y, subscripts, cutoff, ...) { panel.xyplot(x, y, ...) panel.abline(h=cutoff,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- sort(y, index.return=TRUE)$ix ind <- ind[(n-id.n+1):n] xrange<-range(y) adj <- (xrange[2]-xrange[1])/20 ltext(x[ind] + adj, y[ind] + adj, ind, cex=1.0) } } myPanel.qchi <- function(x, y, subscripts, cutoff, ...) { y <- sort(y, index.return=TRUE) iy <- y$ix y <- y$x panel.xyplot(x, y, ...) panel.abline(0,1,lty="dashed") n <- length(y) id.n <- length(which(y>cutoff)) if(id.n > 0){ ind <- (n-id.n+1):n xrange<-range(y) adj <- (xrange[2]-xrange[1])/50 ltext(x[ind] + adj, y[ind] + adj, iy[ind], cex=1.0) } } n<-nrow(X) p <- ncol(X) cutoff <- sqrt(qchisq(0.975, p)) mm <- covMcd(X) dd1 <- sqrt(mm$mah) # robust distances vv<-cov.wt(X) dd2 <- sqrt(mahalanobis(X,vv$center,vv$cov)) # classical distances dd<-c(dd1,dd2) # both robust and classical distances gr <- as.factor(c(rep(1,n), rep(2,n))) levels(gr)[1] <- "Robust" levels(gr)[2] <- "Classical" qq <- sqrt(qchisq(((1:n)-1/3)/(n+1/3), p)) ind.dd <- c(1:n, 1:n) ind.qchi <- c(qq, qq) dplot <- xyplot(dd~ind.dd|gr, cutoff=cutoff, panel = myPanel.dd, xlab="Index", ylab="Mahalanobis distance", main="Distance Plot", col = "darkred", scales=list(cex=1.0)) qplot <- xyplot(dd~ind.qchi|gr, cutoff=cutoff, panel = myPanel.qchi, xlab="Quantiles of the chi-squared distribution", ylab="Mahalanobis distance", main="Chi-Square QQ-Plot", col = "darkred", scales=list(cex=1.0)) plot(dplot, split = c(1, 1, 2, 1), more = TRUE) plot(qplot, split = c(2, 1, 2, 1), more = FALSE) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-cov-plot-lattice} \caption{Distance plot and Chi-square Q-Q plot of the robust and classical distances.} \label{oof-fig:cov-lattice} \end{figure} \end{center} The next plot shown in Figure~\ref{oof-fig:cov-ellipse} presents a scatter plot of the data on which the 97.5\% robust and classical confidence ellipses are superimposed. Currently this plot is available only for bivariate data. The observations with distances larger than $\sqrt{\chi_{p,0.975}^2}$ are identified by their subscript. In the right panel of Figure~\ref{oof-fig:cov-ellipse} a \code{screeplot} of the \code{milk} data set is shown, presenting the robust and classical eigenvalues. <>= ## ## a) scatter plot of the data with robust and classical confidence ellipses. ## b) screeplot presenting the robust and classical eigenvalues ## data("milk") usr<-par(mfrow=c(1,2)) plot(CovMcd(delivery[,1:2]), which="tolEllipsePlot", classic=TRUE) plot(CovMcd(milk), which="screeplot", classic=TRUE) par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-cov-plot-ellipse} \caption{Robust and classical tolerance ellipse for the \code{delivery} data and robust and classical screeplot for the \code{milk} data.} \label{oof-fig:cov-ellipse} \end{figure} \end{center} \subsection{Principal component analysis} \label{oof-sec:pca} Principal component analysis is a widely used technique for dimension reduction achieved by finding a smaller number $q$ of linear combinations of the originally observed $p$ variables and retaining most of the variability of the data. Thus PCA is usually aiming at a graphical representation of the data in a lower dimensional space. The classical approach to PCA measures the variability through the empirical variance and is essentially based on computation of eigenvalues and eigenvectors of the sample covariance or correlation matrix. Therefore the results may be extremely sensitive to the presence of even a few atypical observations in the data. These discrepancies will carry over to any subsequent analysis and to any graphical display related to the principal components such as the biplot. %%% Example - hbk data The following example in Figure~\ref{oof-fig:pca-hbk} illustrates the effect of outliers on the classical PCA. The data set \code{hbk} from the package \pkg{robustbase} consists of 75 observations in 4 dimensions (one response and three explanatory variables) and was constructed by Hawkins, Bradu and Kass in 1984 for illustrating some of the merits of a robust technique \citep[see][]{rousseeuw-leroy}. The first 10 observations are bad leverage points, and the next four points are good leverage points (i.e., their $\xv$ are outlying, but the corresponding $y$ fit the model quite well). We will consider only the X-part of the data. The left panel shows the plot of the scores on the first two classical principal components (the first two components account for more than 98\% of the total variation). The outliers are identified as separate groups, but the regular points are far from the origin (where the mean of the scores should be located). Furthermore, the ten bad leverage points 1--10 lie within the 97.5\% tolerance ellipse and influence the classical estimates of location and scatter. The right panel shows the same plot based on robust estimates. We see that the estimate of the center is not shifted by the outliers and these outliers are clearly separated by the 97.5\% tolerance ellipse. \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} <>= ## ## Principal Component Analysis example: ## Plot of the first two principal components of the ## Hawkins, Bradu and Kass data set: classical and robust ## par(mfrow=c(1,2)) pca <- PcaClassic(hbk.x, k=2) cpca <- list(center=c(0,0), cov=diag(pca@eigenvalues), n.obs=pca@n.obs) rrcov:::.myellipse(pca@scores, xcov=cpca, main="Classical", xlab="PC1", ylab="PC2", ylim=c(-30,30), id.n=0) abline(v=0) abline(h=0) text(-29,6,labels="1-10", cex=0.8) text(-37,-13,labels="14", cex=0.8) text(-31,-5,labels="11-13", cex=0.8) hub <- PcaHubert(hbk.x, k=2, mcd=TRUE) chub <- list(center=c(0,0), cov=diag(hub@eigenvalues), n.obs=hub@n.obs) rrcov:::.myellipse(hub@scores, xcov=chub, main="Robust (MCD)", xlab="PC1", ylab="PC2", xlim=c(-10,45), ylim=c(-25,15), id.n=0) abline(v=0) abline(h=0) text(30,-9,labels="1-10", cex=0.8) text(36,-11,labels="11", cex=0.8) text(42,-4,labels="12", cex=0.8) text(41,-11,labels="13", cex=0.8) text(44,-15,labels="14", cex=0.8) @ \caption{Plot of the first two principal components of the Hawkins, Bradu and Kass data set: classical and robust.} \label{oof-fig:pca-hbk} \end{figure} \end{center} PCA was probably the first multivariate technique subjected to robustification, either by simply computing the eigenvalues and eigenvectors of a robust estimate of the covariance matrix or directly by estimating each principal component in a robust manner. Different approaches to robust PCA are briefly presented in the next subsections with the emphasis on those methods which are available in the framework. Details about the methods and algorithms can be found in the corresponding references. The object model is described and examples are given. \subsubsection{PCA based on robust covariance matrix (MCD, OGK, MVE, etc.)} The most straightforward and intuitive method to obtain robust PCA is to replace the classical estimates of location and covariance by their robust analogues. In the earlier works M~estimators of location and scatter were used for this purpose \citep[see][]{devlin:81, campbell:80} but these estimators have the disadvantage of low breakdown point in high dimensions. To cope with this problem \citet{naga:1990} used the MVE estimator and \citet{todorov-compstat:94} used the MCD estimator. \citet{croux-Haesbroeck:2000} investigated the properties of the MCD estimator and computed its influence function and efficiency. The package \pkg{stats} in base \proglang{R} contains the function \code{princomp()} which performs a principal components analysis on a given numeric data matrix and returns the results as an object of \proglang{S}3 class \code{princomp}. This function has a parameter \code{covmat} which can take a covariance matrix, or a covariance list as returned by \code{cov.wt}, and if supplied, it is used rather than the covariance matrix of the input data. This allows to obtain robust principal components by supplying the covariance matrix computed by \code{cov.mve} or \code{cov.mcd} from the package \pkg{MASS}. One could ask why is it then necessary to include such type of function in the framework (since it already exists in the base package). The essential value added of the framework, apart from implementing many new robust multivariate methods is the unification of the interfaces by leveraging the object orientation provided by the \proglang{S}4 classes and methods. The function \code{PcaCov()} computes robust PCA by replacing the classical covariance matrix with one of the robust covariance estimators available in the framework---MCD, OGK, MVE, M, S or Stahel-Donoho, i.e., the parameter \code{cov.control} can be any object of a class derived from the base class \code{CovControl}. This control class will be used to compute a robust estimate of the covariance matrix. If this parameter is omitted, MCD will be used by default. Of course any newly developed estimator following the concepts of the framework can be used as input to the function \code{PcaCov()}. \subsubsection{Projection pursuit methods} The second approach to robust PCA uses \textit{projection pursuit} (PP) and calculates directly the robust estimates of the eigenvalues and eigenvectors. Directions are seeked for, which maximize the variance (classical PCA) of the data projected onto them. Replacing the variance with a robust measure of spread yields robust PCA. Such a method was first introduced by \citet{li:1985} using an M~estimator of scale $S_n$ as a \textit{projection index (PI)}. They showed that the PCA estimates inherit the robustness properties of the scale estimator $S_n$. Unfortunately, in spite of the good statistical properties of the method, the algorithm they proposed was too complicated to be used in practice. A more tractable algorithm in these lines was first proposed by \citet{croux-Ruiz-Gazen:1996} and later improved by \citet{croux-Ruiz-Gazen:2005}. To improve the performance of the algorithm for high dimensional data a new improved version was proposed by \citet{croux-filzmoser-oliveira-pppca}. The latter two algorithms are available in the package \pkg{pcaPP} \citep[see][]{filzmoser-pcaPP} as functions \code{PCAproj()} and \code{PCAgrid()}. In the framework these methods are represented by the classes \code{PcaProj} and \code{PcaGrid}. Their generating functions provide simple wrappers around the original functions from \pkg{pcaPP} and return objects of the corresponding class, derived from \code{PcaRobust}. A major advantage of the PP-approach is that it searches for the eigenvectors consecutively and in case of high dimensional data when we are interested in only the first one or two principal components this results in reduced computational time. Even more, the PP-estimates cope with the main drawback of the covariance-based estimates---they can be computed for data matrices with more variables than observations. \subsubsection{Hubert method (ROBPCA)} The PCA method proposed by \citet{hubert-ROBPCA:2005} tries to combine the advantages of both approaches---the PCA based on a robust covariance matrix and PCA based on projection pursuit. A brief description of the algorithm follows, for details see the relevant references \citep{hubert:2008}. Let $n$ denote the number of observations, and $p$ the number of original variables in the input data matrix $\v{X}$. The ROBPCA algorithm finds a robust center $\mv$ of the data and a loading matrix $\v{P}$ of dimension $p \times k$. Its columns are orthogonal and define a new coordinate system. The scores $\v{T}$, an $n \times k$ matrix, are the coordinates of the centered observations with respect to the loadings: \begin{equation} \label{oof-eq:pca-scores} \v{T}=(\v{X}-\v{1}\mv^{\top})\v{P} \end{equation} where $\v{1}$ is a column vector with all $n$ components equal to 1. The ROBPCA algorithm yields also a robust covariance matrix (often singular) which can be computed as \begin{equation} \label{oof-eq:pca-S} \v{S}=\v{PLP}^{\top} \end{equation} where $\v{L}$ is the diagonal matrix with the eigenvalues $l_1, \dots, l_k$. This is done in the following three main steps: \paragraph{Step 1:} The data are preprocessed by reducing their data space to the subspace spanned by the $n$ observations. This is done by singular value decomposition of the input data matrix. As a result the data are represented in a space whose dimension is $rank(\v{X})$, being at most $n-1$ without loss of information. \paragraph{Step 2:} In this step a measure of outlyingness is computed for each data point. For this purpose the data points are projected on the $n(n-1)/2$ univariate directions through each two points. If $n$ is too large, \code{maxdir} directions are chosen at random (\code{maxdir} defaults to 250 but can be changed by the user). On every direction the univariate MCD estimator of location and scale is computed and the standardized distance to the center is measured. The largest of these distances (over all considered directions) is the outlyingness measure of the data point. The $h$ data points with smallest outlyingness measure are used to compute the covariance matrix $\v{\Sigma}_h$ and to select the number $k$ of principal components to retain. This is done by finding $k$ such that $l_k/l_1 \ge 10^{-3}$ and $\Sigma_{j=1}^k l_j/\Sigma_{j=1}^r l_j \ge 0.8$. Alternatively the number of principal components $k$ can be specified by the user after inspecting the scree plot. \paragraph{Step 3:} The data points are projected on the $k$-dimensional subspace spanned by the $k$ eigenvectors corresponding to the largest $k$ eigenvalues of the matrix $\v{\Sigma}_h$. The location and scatter of the projected data are computed using the reweighted MCD estimator, and the eigenvectors of this scatter matrix yield the robust principal components. \subsubsection{Spherical principal components (SPC)} The spherical principal components procedure was first proposed by \cite{locantore:1999} as a method for functional data analysis. The idea is to perform classical PCA on the data, projected onto a unit sphere. The estimates of the eigenvectors are consistent if the data are elliptically distributed \cite[see][]{boente-fraiman:1999} and the procedure is extremely fast. Although not much is known about the efficiency of this method, the simulations of \cite{maronna:2005} show that it has very good performance. If each coordinate of the data is normalized using some kind of robust scale, like for example the MAD, and then SPC is applied, we obtain ``elliptical PCA'', but unfortunately this procedure is not consistent. \subsubsection{Object model for robust PCA and examples} \label{oof-sec:pca-objmodel} The object model for the \proglang{S}4 classes and methods implementing the principal component analysis methods follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-pca}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{PcaModel} \caption{Object model for robust Principal Component Analysis.} \label{fig:uml-pca} \end{center} \end{figure} The abstract class \code{Pca} serves as a base class for deriving all classes representing classical and robust principal components analysis methods. It defines the common slots and the corresponding accessor methods, provides implementation for the general methods like \code{show()}, \code{plot()}, \code{summary()} and \code{predict()}. The slots of \code{Pca} hold some input or default parameters like the requested number of components as well as the results of the computations: the eigenvalues, the loadings and the scores. The \code{show()} method presents brief results of the computations, and the \code{predict()} method projects the original or new data to the space spanned by the principal components. It can be used either with new observations or with the scores (if no new data are provided). The \code{summary()} method returns an object of class \code{SummaryPca} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new information (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. Classical principal component analysis is represented by the class \code{PcaClassic} which inherits directly from \code{Pca} (and uses all slots and methods defined there). The function \code{PcaClassic()} serves as a constructor (generating function) of the class. It can be called either by providing a data frame or matrix or a formula with no response variable, referring only to numeric variables. Let us consider the following simple example with the data set \code{hbk} from the package \pkg{robustbase}. The code line \begin{Scode} R> PcaClassic(hbk.x) \end{Scode} can be rewritten as (and is equivalent to) the following code line using the formula interface \begin{Scode} R> PcaClassic(~ ., data = hbk.x) \end{Scode} The function \code{PcaClassic()} performs the standard principal components analysis and returns an object of the class \code{PcaClassic}. <>= ## ## Classical PCA ## pca <- PcaClassic(~., data=hbk.x) pca summary(pca) plot(pca) getLoadings(pca) @ The \code{show()} method displays the standard deviations of the resulting principal components, the loadings and the original call. The \code{summary()} method presents the importance of the calculated components. The \code{plot()} draws a PCA diagnostic plot which is shown and described later. The accessor functions like \code{getLoadings()}, \code{getEigenvalues()}, etc. are used to access the corresponding slots, and \code{predict()} is used to rotate the original or new data to the space of the principle components. Another abstract class, \code{PcaRobust} is derived from \code{Pca}, which serves as a base class for all robust principal components methods. The classes representing robust PCA methods like \code{PcaHubert}, \code{PcaLocantore}, etc. are derived from \code{PcaRobust} and provide implementation for the corresponding methods. Each of the constructor functions \code{PcaCov()}, \code{PcaHubert()}, \code{PcaLocantore()}, \code{PcaGrid()} and \code{PcaProj()} performs the necessary computations and returns an object of the class containing the results. In the following example the same data are analyzed using the projection pursuit method \code{PcaGrid()}. <>= ## ## Robust PCA ## rpca <- PcaGrid(~., data=hbk.x) rpca summary(rpca) @ Similar to the function \code{PcaClassic()}, these functions can be called either with a data frame or matrix or by a formula interface. \subsubsection{Visualization of PCA results} \label{oof-sec:pca-vis} One of the most important applications of PCA, besides dimensionality reduction is data visualization. In the framework several plots for visualizing the results of the analysis are available. The \code{plot()} methods are implemented in the base class \code{Pca} and thus they are available for all objects derived from the class \code{Pca} no matter if classical and robust. The most straightforward plot is the \textit{screeplot} which plots the variances against the number of principal components (similar to the screeplot for the standard \code{prcomp()} and \code{princomp()} functions). It is a useful tool for determining the number of relevant principal components. An example of the classical and robust screeplot for the \code{milk} data from \pkg{robustbase} is shown in Figure~\ref{oof-fig:pca-screeplot}. <>= ## ## Screeplot for classical and robust PCA of the milk data set. ## usr <- par(mfrow=c(1,2)) screeplot(PcaClassic(milk), type="lines", main="Screeplot: classical PCA", sub="milk data") screeplot(PcaHubert(milk), type="lines", main="Screeplot: robust PCA", sub="milk data") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-screeplot} \caption{Screeplot for classical and robust PCA of the \code{milk} data set.} \label{oof-fig:pca-screeplot} \end{figure} \end{center} Another plot borrowed from standard \proglang{R} is the \textit{biplot}. The biplot \citep{gabriel} represents both the observations and variables in the plane of (the first) two principal components allowing the visualization of the magnitude and sign of each variable's contribution to these principal components. Each observation (row of scores) is represented as a point in the biplot and each variable is represented as an arrow. The arrows graphically indicate the proportion of the original variance explained by the (first) two principal components and their direction indicates the relative loadings on these components. Figure~\ref{oof-fig:pca-biplot} shows an example of the robust biplot of the \code{un86} data set which contains seven socioeconomic variables observed for 73 countries. The data set is from World Statistics in Brief, Number 10, a 1986 UN publication. It was used in \citet{Daigle:1992} to illustrate a robust biplot method. <>= ## ## Robust biplot for the UN86 data ## data("un86") set.seed(9) usr<-par(mfrow=c(1,2)) biplot(PcaCov(un86, corr=TRUE, cov.control=NULL), main="Classical biplot", col=c("gray55", "red")) biplot(PcaCov(un86, corr=TRUE), main="Robust biplot", col=c("gray55", "red")) par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-biplot} \caption{Classical (left panel) and robust (right panel) biplot for the \code{UN86} data.} \label{oof-fig:pca-biplot} \end{figure} \end{center} %% diagnostic plot (outlier map) In the context of PCA \citet{hubert-ROBPCA:2005} defined a \textit{diagnostic plot} or \textit{outlier map} which helps to distinguish between the regular observations and the different types of outliers. This plot is based on the \textit{score distances} and \textit{orthogonal distances} computed for each observation. The score distances are given by \begin{equation} \label{oof-eq:pca-SD} SD_i=\sqrt{\sum_{j=1}^k{\frac{t_{ij}^2}{l_j}}},~~~~ i=1,\ldots,n \end{equation} where $t_{ij}$ are the elements of the scores from (\ref{oof-eq:pca-scores}) and $l_j$ are the eignevalues (the diagonal elements of the matrix $\v{L}$ in (\ref{oof-eq:pca-S})). The orthogonal distances $OD_i$ of each observation to the subspace spanned by the first $k$ ($1\le k \le r$, $r$ is the rank of the data) principal components are defined by \begin{equation} \label{oof-eq:pca-OD} OD_i=||\xv_i - \hat{\muv} - \v{P}^{(k)}\tv_i^{(k)}||,~~~~ i=1,\ldots,n \end{equation} where $\xv_i$ denotes the $i$th observation, $\hat{\muv}$ is the estimated center of the data, $\tv_i^{(k)}$ is the $i$th score vector in the space of the first $k$ principal components and the matrix $\v{P}^{(k)}$ contains the first $k$ estimated eigenvectors in its columns. The diagnostic plot is constructed by plotting the score distances on the horizontal axis, the orthogonal distances on the vertical axis and drawing two cutoff lines which will help to classify the observations. The cutoff value on the horizontal axis (for the score distances) is taken as the 97.5\% quantile of $\chi_k^2$ distribution, i.e., $c_h=\sqrt{\chi^2_{k,0.975}}$. For the cutoff value on the vertical axis (for the orthogonal distances) the Wilson-Hilferty transformation for a $\chi^2$ distribution is used (which assumes that the $OD_i$ to the power of 2/3 are approximately normally distributed). The parameters $\mu$ and $\sigma$ of the normal distribution can be estimated by the median and MAD of the values $OD_i^{2/3}$, and the critical value can be taken as $c_v=(\hat{\mu} + \hat{\sigma}z_{0.975})^{3/2}$ where $z_{0.975}$ is the the 97.5\% quantile of the standard normal distribution. An example of the classical and robust diagnostic plot for the \code{hbk} data set from \pkg{robustbase} is shown in Figure~\ref{oof-fig:pca-diagplot}. <>= ## ## An example of the classical and robust diagnostic ## plot for the hbk data set ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=2), sub="data set: hbk, k=2") plot(PcaHubert(hbk.x, k=2), sub="data set: hbk, k=2") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-diagplot} \caption{Classical and robust diagnostic plot for the \code{hbk} data with $k=2$.} \label{oof-fig:pca-diagplot} \end{figure} \end{center} If $k=p$ the orthogonal distances are not meaningful and the diagnostic plot shows a simple distance plot of the score distances (distances vs index). An example is shown in Figure~\ref{oof-fig:pca-distplot}. <>= ## ## If k=p the orthogonal distances are not meaningful and ## simple distance plot of the score distances will be shown ## usr<-par(mfrow=c(1,2)) plot(PcaClassic(hbk.x, k=3), sub="data set: hbk.x, k=3") plot(PcaHubert(hbk.x, k=3), sub="data set: hbk.x, k=3") par(usr) @ \begin{center} \begin{figure}[h!] \setkeys{Gin}{width=1.0\textwidth} \includegraphics{ooframework-ex-pca-plot-distplot} \caption{Classical and robust diagnostic plot for the x-part of the \code{hbk} data set with $k=3=p$.} \label{oof-fig:pca-distplot} \end{figure} \end{center} \subsection{Linear and quadratic discriminant analysis} \label{oof-sec:lda} The problem of discriminant analysis arises when one wants to assign an individual to one of $g$ populations at the basis of a $p$-dimensional feature vector $\xv$. Let the $p$-dimensional random variable $\xv_k$ come from a population $\pi_k$ with underlying density $\v{f}_k$. Further let the prior probability of group $k$, i.e., the probability that an individual comes from population $\pi_k$ be $\alpha_k$, $\Sigma_{k=1}^g \alpha_k = 1$. The prior probabilities $\alpha_k$ are usually estimated by the empirical frequencies $n_k$ in the $k$-th group of the training set, i.e., $\hat{\alpha}_k=n_k/\Sigma_{j=1}^gn_j$. Then the Bayesian discriminant rule assigns an observation $\xv$ to that population $\pi_k$ for which the expression $\ln(\alpha_k \v{f}_k(\xv))$ is maximal over all groups $k=1,\ldots,g$. Usually it is assumed that the $k$ populations $\pi_k$ are $p$-dimensional normally distributed, \begin{equation} \label{oof-eq:discrim-distr} \pi_k \sim N({\muv}_k,\v{\Sigma}_k)~~~~~k=1,\ldots,g. \end{equation} With this assumption the discriminant rule is equivalent to maximizing the discriminant scores $D_k(\xv)$ given by \begin{equation} \label{oof-eq:QDA} D_k(\xv) = -\frac{1}{2}\ln|\v{\Sigma}_k| - \frac{1}{2}(\xv-\muv_k)^{\top}\v{\Sigma}_k^{-1}(\xv-\muv_k) + \ln(\alpha_k)~~~~~(k=1,\ldots,g), \end{equation} and individual $\xv$ is assigned to $\pi_k$ if \begin{equation} \label{oof-eq:QDA-rule} D_k(\xv)=\arg\max_j D_j(\xv). \end{equation} The application of the discrimination rule given by Equations~(\ref{oof-eq:QDA}) and (\ref{oof-eq:QDA-rule}) is referred to as quadratic discriminant analysis (QDA), since the groups are separated by quadratic boundaries. If it is further assumed that all group covariance matrices are equal $(\v{\Sigma}_{1}= \ldots= \v{\Sigma}_g=\v{\Sigma})$, then the overall probability of misclassification is minimized by assigning a new observation $\xv$ to population $\pi_k$ which maximizes \begin{equation} \label{oof-eq:LDA} %%%%%%%%d_k(\xv)=\frac{1}{2}(\xv-\muv_k)^{\top}\v{\Sigma}^{-1}(\xv-\muv_k) + \ln(\alpha_k)~~~~~(k=1,\ldots,g). d_k(\xv)=\xv^{\top}\v{\Sigma}^{-1}\muv_k - \frac{1}{2}\muv_k^{\top}\v{\Sigma}^{-1}\muv_k + \ln(\alpha_k)~~~~~(k=1,\ldots,g). \end{equation} The application of the discriminant rule given by Equation~(\ref{oof-eq:LDA}) is referred to as linear discriminant analysis (LDA), since the scores $d_k(\xv)$ are linear in $\xv$. If the means $\muv_k, k=1,\ldots,g$, and the common covariance matrix $\v{\Sigma}$ are unknown, which is usually the case, a training set consisting of samples drawn from each of the populations is required. In classical QDA and LDA the sample group means and sample covariance matrices are used to estimate $\muv_k$, $\v{\Sigma}_k$ and $\v{\Sigma}$. The prior probabilities can be estimated by the relative frequencies of observations in each particular group. Both QDA and LDA using the classical estimates in (\ref{oof-eq:QDA}) and (\ref{oof-eq:LDA}) are vulnerable to the presence of outliers. The problem of the non-robustness of the classical estimates in the setting of the quadratic and linear discriminant analysis has been addressed by many authors: \citet*{todorov:90, todorov:94} replaced the classical estimates by MCD estimates; \citet*{chork} used MVE instead; \citet*{hawkins:97} defined the minimum within-group covariance determinant estimator (MWCD) especially for the case of linear discriminant analysis; \citet*{he:2000} and \citet*{croux-dehon:01} used S~estimates; \citet*{hubert:04} applied the MCD estimates computed by the FAST-MCD algorithm. For a recent review and comparison of these methods see \citet{todorov-roblda}. A robust version of quadratic discriminant analysis can be obtained by substituting the parameters $\muv_k$, $\v{\Sigma}_k$ by their robust estimates. For this purpose the reweighted MCD estimates, S~estimates or OGK can be used. In the case of linear discriminant analysis a robust version of the common covariance matrix $\v{\Sigma}$ is necessary. There are several methods for estimating the common covariance matrix based on a high breakdown point estimator which are considered in one of the next subsections. \subsubsection{Object model for robust LDA and QDA} The object model for the \proglang{S}4 classes and methods implementing the linear and quadratic discriminant analysis methods follows the proposed class hierarchy given in Section~\ref{oof-sec:objmodel} and is presented in Figure~\ref{fig:uml-lda-qda}. \begin{figure}[h!] \begin{center} \includegraphics[width=\textwidth]{DAModel} \caption{Object models for robust linear discriminant analysis and quadratic discriminant analysis.} \label{fig:uml-lda-qda} \end{center} \end{figure} The abstract classes \code{Lda} and \code{Qda} serve as base classes for deriving all classes representing classical and robust methods for linear and quadratic discriminant analysis methods. They define the common slots and the corresponding accessor methods, provide implementation for the general methods like \code{show()}, \code{plot()}, \code{summary()} and \code{predict()}. This base classes also host several utility functions which are not directly exported but are documented and can be used by quoting the namespace. The slots of \code{Lda} hold some input or default parameters like the prior probabilities, the original data matrix and the grouping variable as well as the results of the computations: the group means and the common covariance matrix, the linear discriminant functions and the corresponding constants. The \code{show()} method presents brief results of the computations, and \code{predict()} can be used either for classifying new observations or for the evaluation of the discriminant rules on the basis of the training sample. The method \code{predict()} returns an object of class \code{PredictLda} which has its own \code{show()} method to print the results of the classification or evaluation. The \code{summary()} method returns an object of class \code{SummaryLda} which has its own \code{show()} method. As in the other sections of the framework these slots and methods are defined and documented only once in this base class and can be used by all derived classes. Whenever new data (slots) or functionality (methods) are necessary, they can be defined or redefined in the particular class. Classical linear discriminant analysis is represented by the class \code{LdaClassic} which inherits directly from \code{Lda} (and uses all slots and methods defined there). The function \code{LdaClassic()} serves as a constructor (generating function) of the class. It can be called either by providing a data frame or matrix and a grouping variable (factor) or a formula specifying the model to be used. Let us consider the following simple example with the data set \code{diabetes}: the grouping variable is \code{diabetes$group} and the three explanatory variables are \code{glucose}, \code{insulin} and \code{sspg}. The code \begin{Scode} R> x <- diabetes[, c("glucose", "insulin", "sspg")] R> grpvar <- diabetes$group R> LdaClassic(x, grpvar) \end{Scode} can be rewritten as (and is equivalent to) the following code using the formula interface: \begin{Scode} R> LdaClassic(group ~ ., data = diabetes) \end{Scode} The function \code{LdaClassic()} performs standard linear discriminant analysis and returns an object of class \code{LdaClassic}. Another abstract class, \code{LdaRobust} is derived from \code{Lda}, which serves as a base class for all robust linear discriminant analysis methods. The only slot added in this class is a character variable specifying the robust method to be used. The class \code{Linda} is derived from \code{LdaRobust} and provides implementation for all methods for robust LDA currently available in the framework. If we wanted to be precisely object oriented, we should define a separate class for each robust method---for example \code{LdaRobustMcd}, \code{LdaRobustFsa}, etc. but this would lead to explosion of the necessary code and documentation. The constructor function \code{Linda()} takes a character parameter \code{method} specifying which robust location and scatter estimator to use and how to compute the common covariance matrix and returns an object of class \code{Linda}. Similarly as the function \code{LdaClassic()}, \code{Linda()} can be called either with a data matrix and grouping variable or by a formula interface. \subsubsection{Computing the common covariance matrix} \label{oof-sec:common-cov} The easiest way to estimate the common covariance matrix $\v{\Sigma}$ is to obtain the estimates of the group means $\muv_k$ and group covariance matrices $\v{\Sigma}_k$ from the individual groups as $(\mv_k,\v{C}_k), k=1,\ldots,g$, and then pool the estimates $\v{C}_k, k=1,\ldots,g$ to yield the common covariance matrix \begin{equation} \v{C} = {\sum_{k=1}^g{n_k\v{C}_k} \over \sum_{k=1}^g{n_k-g}}. \end{equation} This method, using MVE and MCD estimates, was proposed by \citet{todorov:90, todorov:94} and was also used, based on the MVE estimator by \citet*{chork}. \newline \citet*{croux-dehon:01} applied this procedure for robustifying linear discriminant analysis based on S~estimates. A drawback of this method is that the same trimming proportions are applied to all groups which could lead to a loss of efficiency if some groups are outlier free. We will denote this method as ``$A$'' and the corresponding estimator as XXX-A. For example, in the case of the MCD estimator this will be MCD-A. Another method was proposed by \citet*{he:2000} for the S~estimates and was later adapted by \citet*{hubert:04} for the MCD estimates. Instead of pooling the group covariance matrices, the observations are centered and pooled to obtain a single sample for which the covariance matrix is estimated. It starts by obtaining the individual group location estimates $\tv_k, k=1,\ldots,g$, as the reweighted MCD location estimates of each group. These group means are swept from the original observations $\xv_{ik}~(i=1,\ldots,n_k;~k=1,\ldots,g)$ to obtain the centered observations \begin{eqnarray} \v{Z} = \{\zv_{ik}\}, ~~~~~\zv_{ik} = \xv_{ik} - \tv_k. \end{eqnarray} The common covariance matrix $\v{C}$ is estimated as the reweighted MCD covariance matrix of the centered observations $\v{Z}$. The location estimate $\deltav$ of $\v{Z}$ is used to adjust the group means $\mv_k$ and thus the final group means are \begin{equation} \mv_k = {\tv_k + \deltav}. \end{equation} This process could be iterated until convergence, but since the improvements from such iterations are negligible \citep[see][]{ he:2000, hubert:04} we are not going to use it. This method will be denoted by ``$B$'' and as already mentioned, the corresponding estimator as XXX-B, for example MCD-B. The third approach is to modify the algorithm for high breakdown point estimation itself in order to accommodate the pooled sample. \citet*{he:2000} modified Ruperts's SURREAL algorithm for S~estimation in case of two groups. \citet*{hawkins:97} defined the minimum within-group covariance determinant estimator which does not apply the same trimming proportion to each group but minimizes directly the determinant of the common within groups covariance matrix by pairwise swaps of observations. Unfortunately their estimator is based on the Feasible Solution Algorithm \citep[see][and the references therein]{hawkins:97}, which is extremely time consuming as compared to the FAST-MCD algorithm. \citet*{hubert:04} proposed a modification of this algorithm taking advantage of the FAST-MCD, but it is still necessary to compute the MCD for each individual group. This method will be denoted by MCD-C. Using the estimates $\mv^0_k$ and $\v{C}_0$ obtained by one of the methods, we can calculate the initial robust distances \citep{Rousseeuw-van-Zomeren} \begin{equation} RD^0_{ik}= \sqrt{(\xv_{ik}-\mv^0_k)^{\top}\v{C}_0^{-1}(\xv_{ik}-\mv^0_k)}. \end{equation} With these initial robust distances we can define a weight for each observation $\xv_{ik}, ~ i=1, \ldots , n_k$ and $k=1, \ldots, g$, by setting the weight to $1$ if the corresponding robust distance is less or equal to a suitable cut-off, usually $\sqrt{\chi^2_{p,0.975}}$, and to 0 otherwise, i.e., \begin{equation} \label{oof-eq:mdiv} w_{ik} = \begin{cases} 1&RD^0_{ik} \leq \sqrt{\chi^2_{p,0.975}} \\ 0&\text{otherwise}.\\ \end{cases} \end{equation} With these weights we can calculate the final reweighted estimates of the group means, $\mv_k$, and the common within-groups covariance matrix, $\v{C}$, which are necessary for constructing the robust classification rules, \begin{eqnarray} \mv_k &=& (\sum^{n_k}_{i=1}{w_{ik}\xv_{ik}})/\nu_k, \nonumber\\ \v{C} &=& \frac{1}{\nu-g}\sum^g_{k=1}\sum^{n_k}_{i=1}{w_{ik}(\xv_{ik}-\mv_k)(\xv_{ik}-\mv_k)^{\top}}, \end{eqnarray} where $\nu_k$ are the sums of the weights within group $k$, for $k=1,\ldots,g$, and $\nu$ is the total sum of weights, \begin{equation} \nu_k =\sum^{n_k}_{i=1}{w_{ik}}, ~~~~\nu = \sum^{g}_{k=1}{\nu_k}. \nonumber \end{equation} \subsubsection{Evaluation of the discriminant rules} In order to evaluate and compare different discriminant rules, their discriminating power has to be determined in the classification of future observations, i.e., we need an estimate of the overall probability of misclassification. A number of methods to estimate this probability exists in the literature---see for example \citet{lachenbruch:1975}. The \textit{apparent error rate} (known also as resubstitution error rate or reclassification error rate) is the most straightforward estimator of the actual error rate in discriminant analysis and is calculated by applying the classification criterion to the same data set from which it was derived. The number of misclassified observations for each group is divided by the group sample size. An estimate of the apparent error rate is calculated by the method \code{predict()} of the class \code{Lda}. Examples are given in the next section. It is well known that this method is too optimistic (the true error is likely to be higher). If there are plenty of observations in each class, the error rate can be estimated by splitting the data into training and validation set. The first one is used to estimate the discriminant rules and the second to estimate the misclassification error. This method is fast and easy to apply but it is wasteful of data. Another method is the \textit{leave-one-out} \textit{cross-validation} \citep{lachenbruch-michey:68} which proceeds by removing one observation from the data set, estimating the discriminant rule, using the remaining $n-1$ observations and then classifying this observation with the estimated discriminant rule. For the classical discriminant analysis there exist updating formulas which avoid the re-computation of the discriminant rule at each step, but no such formulas are available for the robust methods. Thus the estimation of the error rate by this method can be very time consuming depending on the size of the data set. Nevertheless, \pkg{rrcov} provides an (internal, not exported) function \code{rrcov:::.CV()} which calculates the leave-one-out cross-validation error rate by ``brute force'', but the user should be aware that its usage is appropriate only for moderate data sets. An improvement will be the implementation of a cross-validation technique similar to the one proposed by \citet{hubert:2007-CV}. \subsubsection{Example: Diabetes data} \label{oof:sec-diabetes} As an example for demonstrating the usage of the robust discriminant analysis classes and methods we use the \code{diabetes} data set, which was analyzed by \citet*{reaven-miller} in an attempt to examine the relationship between chemical diabetes and overt diabetes in 145 nonobese adult subjects. Their analysis was focused on three primary variables and the 145 individuals were classified initially on the basis of their plasma glucose levels into three groups: normal subjects, chemical diabetes and overt diabetes. This data set was also analyzed by \citet*{hawkins:97} in the context of robust linear discriminant analysis. The data set is available in several \proglang{R} packages: \code{diabetes} in package \pkg{mclust} \citep{mclust}, \code{chemdiab} in package \pkg{locfit} \citep{locfit} and \code{diabetes.dat} in \pkg{Rfwdmv} \citep{Rfwdmv}. We are going to use the one from \pkg{mclust} in which the value of the second variable, $insulin$, on the 104th observation, is 45 while for the other data sets this value is 455 (note that 45 is more likely to be an outlier in this variable than 455). We start with bringing the data set \code{diabetes} from package \pkg{mclust} into the workspace by typing <>= data("diabetes") @ Using the package \pkg{lattice} \citep{Sarkar:2008} we produce a three dimensional cloud plot of the data (Figure~\ref{lda-cloud}). << lda-cloud, fig=FALSE>>= library("lattice") # load the graphical library ## set different plot symbols - important for black-and-white print sup.sym <- trellis.par.get("superpose.symbol") sup.sym$pch <- c(1,2,3,4,5) trellis.par.set("superpose.symbol", sup.sym) cloud.plt <- cloud(insulin ~ glucose + sspg, groups = group, data = diabetes, auto.key=TRUE) @ \begin{center} \begin{figure}[h!] << lda-cloud-fig, fig=TRUE>>= print(cloud.plt) @ \caption{Three dimensional scatter plot of the \code{diabetes} data.} \label{lda-cloud} \end{figure} \end{center} We will first apply the classical linear discriminant analysis as implemented in \code{LdaClassic()} by the formula interface of the function---the grouping variable is \code{class} and all the remaining variables in \code{diabetes} are used as predictor variables. The \code{show()} method will present the results of the computations: the group means, the (common) within group covariance matrix, the linear discriminant functions together with the corresponding constants. The prior probabilities (either provided by the user or estimated as a proportion of the groups) are also presented. << lda-classic>>= lda <- LdaClassic(group~glucose+insulin+sspg, data=diabetes) lda @ Now the \code{predict()} method can be used on the \code{Lda} object (\code{Lda} is the base class for both \code{LdaClassic} and \code{LdaRobust}) in order to classify new observations. The method returns an object of class \code{PredictLda} which has its own \code{show()} method. If no new data are supplied, the training sample will be reclassified and a classification table will be produced to estimate the apparent error rate of the classification rules. << lda-classic-predict>>= predict(lda) @ Robust linear discriminant analysis can be performed in a similar way but using the function \code{Linda} (which will create an object of class \code{Linda}). As before the \code{predict()} method called without new data returns a classification table of the training subsample. Using the internal convenience function \code{rrcov:::.AER()} we can calculate and print the apparent error rate (which now is equal to 0.1103 and is lower than the obtained with the classical LDA 0.1310). << lda-robust>>= rlda <- Linda(group~glucose+insulin+sspg, data=diabetes) rlda rlda.predict <- predict(rlda) cat("\nApparent error rate: ", round(rrcov:::.AER(rlda.predict@ct),4)) @ In the above example we did not specify which method for computing the common covariance matrix should be used (thus using the default method ``MCD-B'' described above). We could choose the method by providing the \code{method} parameter to the function \code{Linda()}. For example the following call \begin{Scode} R> rlda <- Linda(group~glucose+insulin+sspg, data = diabetes, method = "fsa") \end{Scode} will use the \citet*{hawkins:97} \textit{feasible solution algorithm} method. The variance-covariance structures of the three classes in the \code{diabetes} data set differ substantially and we can expect improved results if quadratic discriminant analysis is used. Robust quadratic discriminant analysis is performed by the function \code{QdaCov()} which will return an object of class \code{QdaCov}. << qda-robust>>= rqda <- QdaCov(group~glucose+insulin+sspg, data=diabetes) rqda rqda.predict <- predict(rqda) cat("\nApparent error rate: ", round(rrcov:::.AER(rqda.predict@ct),4)) @ The accuracy of the prediction improves compared to the linear discriminant analysis. \section{Conclusions} \label{oof-sec:conclusions} In this paper we presented an object oriented framework for robust multivariate analysis developed in the \proglang{S}4 class system of the programming environment \proglang{R}. The main goal of the framework is to support the usage, experimentation, development and testing of robust multivariate methods as well as simplifying comparisons with related methods. It minimizes the effort for performing any of the following tasks: \bi \item{application of the already existing robust multivariate methods for practical data analysis;} \item{implementation of new robust multivariate methods or variants of the existing ones;} \item{evaluation of existing and new methods by carrying out comparison studies.} \ei A major design goal was the openness to extensions by the development of new robust methods in the package \pkg{rrcov} or in other packages depending on \pkg{rrcov}. Further classes implementing robust multivariate methods like principal component regression and partial least squares will follow but the user is encouraged to develop own methods using the proposed reusable statistical design patterns. \section*{Acknowledgements} We wish to express our thanks to the organizers of and participants in the ``Robust Statistics and \proglang{R}'' workshops for the valuable comments and suggestions which were a major input for the development of this framework. We are also grateful to many people, notably Matias Salibian-Barrera, Victor Yohai, Kjell Konis, and Christophe Croux for the provided code. The careful review and constructive comments of the editor and the anonymous reviewers helped us to substantially improve the manuscript. The views expressed herein are those of the authors and do not necessarily reflect the views of the United Nations Industrial Development Organization (UNIDO). \bibliography{mybiblio} \end{document} rrcov/inst/doc/rrcov.pdf0000644000176200001440000161371513607365244015005 0ustar liggesusers%PDF-1.5 % 1 0 obj << /Type /ObjStm /Length 4747 /Filter /FlateDecode /N 93 /First 774 >> stream x\[s۶~?o;ә\4mxi9#K]Yt)*Np~GJgd$ $YicymeT9g  L()ĄQԆGdRL:F͔vÔLy2gx )1, b0Ɍ 8*f}lp0+U`)2f}f=ũ+I 09bN;f0KhcK^U 7 @6pi͂P4)$Bנ &Yp0 a0RF pbJKP! )@*h`0<(d H*Dt*PDgc1.AEx?ЈY0&xFc0oZ:C 8l 0q9#L,F`.F`ead8Wta=1h:$`|$<=Fvny+FvG+700.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ustness, multivariate analysis, MCD, R, statistical design patterns 2020-01-14T17:21:53+01:00 2020-01-14T17:21:53+01:00 LaTeX with hyperref package Object Oriented Framework for Robust Multivariate AnalysisValentin Todorov, Peter Filzmoser endstream endobj 96 0 obj << /Type /ObjStm /Length 3771 /Filter /FlateDecode /N 93 /First 871 >> stream x[r7}߯l<߶R+˱88%%nhR!)ٯs0ކ)JE 8hn4*YX*t$H/yMxT*ƀ[ix* Jp*=AT2*!opeC .7mJ{M܂7my9mѻ-J?+J߮+wE+|_"9E/r|7UA7o(,U ~5?̚8x|}ktr6g2)8N4AWD_sYu /MsLv~nY0sH'6FB,v\/ms[=|dPxmrd9˕缏(! 3#`[0qvJEw #P<ߊ{T<ŏ8/q*N'XFo{\\];117R\6L!b&b~1m1s"{ {%HB|@,糪0ak |Se쿵G >xX|0G Jg LݫVY<> 6Y*Vv7p~pM]ѻ#}\*؂N}X| npF ڷvc4L[IS{GhUѼ%7} j. R6u'YR&?+=a)^[dzLP ^meX}:@%UF#φtْD5tbE_wznvuXV)96M8x%jPb5roɰ>߉ſW?d3@ f|8:k`.Nh0'S6QvޝOY"5{:yn d4LE#2q52_{>mf*._x5YᎇFޝ4|%%!Jrt5?&dshᇍ6;;LeXNl:uysZ=|o'63lx6҅7)7GoV'>3%[KJno~ͮoSі+Dm/D=Ol+}!YͶAv솞nJzrDQN뷛 ]Iiꏕ?#4^b e&:Q (0wKP F>{Ct F80>3`yCZj٭"vcI!`dgO%7UTsˍ1AR9R֧.ldooq'l;xןCjҎ.u/oZv-eŸ]אu(>乌<\/_?,\lɼKn~ZUΓl]ky5n˜vxYsX~5fJxp܆8? 8/WfmI[n X./eeJyrp|R5+R~P< ;dײ_=eNFgkfv2if7_do̦1.,\}2;4XJo3&5|yggbZ mlVߴDh}}jҾPj':Yf > 2_C]?fII1'xm 0Gw <݃d^TikkFڅcȹ%!EY[SV>/ uJjXbb:߉YjK#Rܵ6v zyIřڄe|# .@g+VF\05kPS^$PI L+`z'k'q#v)w} (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=H9c7 E9ŠM,IzN;J&[{J(js*LNX><_:?Z]LmGً](JPݬ:/+uܝqAXk4\\52(UJg3,Qd)F"I OPOkF!TYiqEYFnE1L_unp|΀A.ll:d&G3%ڌF>OS5l+S5@ΤH6jt]!XY.QQ͗G {W q?}gNbXVxj0Ū9kڜ8w?jp9JVC yRYYRLvl14]p(|tXW^)FSCUg1Q>s4ϬJ&IȿR)5ZZ5k͝7b>|OO WmT: $Sd֯ v Mj3q2Oecm? ]|l@+%Xa1$yBna>|PQB{1==R{endstream endobj 682 0 obj << /Filter /FlateDecode /Subtype /Type1C /Length 206 >> stream xcd`ab`dd v 544qH3a#UA6/ewo\0012:)槤)& 2000v00tgcQFBըqVн_pON@[{W4_N\;~*{r\y8XEendstream endobj 683 0 obj << /Filter /FlateDecode /Subtype /Type1C /Length 250 >> stream xcd`ab`dd v 144qH3aUA6/ezE 0012*9)槤)TeDsJRST000030d'gb&,|A~2www4ttŷǷŷIt5w6u7sTj-6N߃$z'N.`QR9@8Ӕ~Odϵ[y='\endstream endobj 684 0 obj << /Filter /FlateDecode /Length 161 >> stream x]O10 m%@HU0q u4=M20g_/W#8|QcY`ѲIy!'X d t.iB GmUu1 > stream xWiXW֮ (mvP&*(((6bD(D5Q%HYl@b5snmېd2{臾Uu99=1z#H"<~/L9]# d Fz&Pl +F1bhv%L^!'=%)9yߞX$nJIJi)՛7YFĥmϋ>{2~36/ ̊[:'>(7!81dMhRXrxJuQ%+Ls>r, cń0L(3Ȅ1$&a"Ō-Lf;f 3Yx1L4,c|Gf981~3Lef3 d\"fdY13͘0Rf #0#b28Ƃ1%!M#Qrp1?TCyz9z'BT l8ltkm{澷Sߨ_>rHߎT,1P  댬 m3;wQͣGh38BXށ E8 md Kjb#l;‚Jp*Ʌ&-=LM .E=p6v+d_ؒ m#:{hEt*a(M:ЩVIvmF׏W\X^xA:Nj?wm EWe -̃鯉w~ zDSR)BRAjABYT"!^ij 䭵T9h܅;sOs ~F`ݣ'\ۧ?zl>4/ w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`+2ڻ@[K/ftdぷ+ٟ0?nI\sK\쉞N-DG_3!:(}-F*QkwZjJe):UBHe?&#CgqmZQ"^F%.H*6,ο؅2u57]성yB{l0endstream endobj 707 0 obj << /Filter /FlateDecode /Length 242 >> stream x]1n0 EwB7D;KdhQ,сȂ }I)O3IjN%/m?hSD%6-q1=-Ӝ^B*d_ÍaCqMt/!R J }b pǥAECDDGTzTxDV^{к X'$Pas9Y_|fVʛiJK)k)˘oօ}endstream endobj 708 0 obj << /Filter /FlateDecode /Subtype /Type1C /Length 1867 >> stream xulS~i`{f(ZA #e NL=c(B`׵A*?*iӦ>i/I:M{W^s=JDtƖ7N,O*~07fh6<}hPW}r.._to:dq0D#qoaը4)R-T,^♧KW(VwZRب4u&aSTZɪxdڻr"Ҡi0;[¢5u*{FzbAoRV+5&QѰ[m==}JV&G0j{G;;junԣƭRe5jtQ֘&AߣStD3ktdKDP-D;DDP4D':N0!DL4CHZ#rUUw~zWk!Wx^ 59.ĕgd8t^'g8%gĝqzvd2OƙH_ϡ@ e!3?#b!~("Q.O|?QatT#XŖv qm3µX9#)޽{~o]6l,,[jo*TK϶oie? _\twfx4W]7֬y<}l݇Md=\9n Jo]GD4 " PxvCjO^ x 8D3ґlJA ]#s7L Pkq/,!F \>așK>YN Hc-c%1ZZ)Bb2d7y^BZDŽ{ t$!Go)$b顳l!8LBj;%wvV56d5f+sNE(]yv2ͷ|e1:7˂87@H3x3g ?`^}o^zIBs/HQȀHp3gexfL%߲7J|v4}"uYIG˨L+?W4O'^y6@ۅ /zi }b3jJC08:Շp Fv~#/ܬ- p{}P 'ooE3?T\@76Y3^߰U}xBO[*Ԑ=v P@ncoh摓QcA(~sjg#R' h).G\a33t M]^>yEz#0 U\vrO^?CRi͸a|+7,dSS`B؁ۡ줴)8C$a{501r DZ,A=E͠2Q |<>ɲAAё͘+4|Iœl0MUccM4Su*4£&4ӈWI'.4zARSt=Ǧ 4ψ+*+d>GF=~Ʒ=|'wED?UjKo q?6H(endstream endobj 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]/yM6dV[54a*c-XL# 0mf  n@Ƈ86/7 \%u1 ۊTT$&\!q_W%热&yYR/S0I!@zt} V6 ^LuY _Dp)Luplh 񧱭lᶶнFSA/?u']!  Y5S;pgu>fZ,F>«#pH?Dc޸}LWHg08x~z"71dreg_brX0Ql╞2o=ETj3bdsx2#3 ץ6F76NVnbP?Q*ܢcsHߚW2*W"hWz9) L6w:yU `heo3fiRX:n[횏lFkFjgE@ZA9%&.۵"4qQRDxib7f61? Ls佪40~ T;$:jxoMӺđ&jݔAL4e×qȸ{a37JVDj;=Ot]^Λ gJ)Yendstream endobj 729 0 obj << /Filter /FlateDecode /Subtype /Type1C /Length 1688 >> stream x{PTwp(v*`m(&h0Ҥ.wkݝ:):Q0&&QdS!RG[Di-iZm5YͿΜs~,R0,N Vג\fXj –wfol3XzՇh ͚)?.iF$~6fŋz~ଐsYYY܏kAy(8(y[ɻ THCphF(%x3ݼBr`Cw|*rx| m$3PH6JZ ґU HHguKI$m*{<}wx<^I-4#J'x%D+Z̑ + Ԍ<iت4mUpHkpri]ZItVŋSySy‡S)I]bJD%VV‹˓Kcf۳'Jն";Ya62f!Slb63L3Y,g "f& b=v17 UQCejM5p@΀i>@c@c 7am_\rj[ mVF!6󦖦@ @vP+Ƒd1' dCR&cQs͉ɥehl1!~ ijnO_]uđEA,YD-GH52,/eP]X+n.W|dl9Tht.#c);j {O\b.=((s4`e nh $Z6a(G\ږ]w9MJ^>7~#oޚI_ _jll\C>>q]~yJeϦ) 9wa Do3f6o ZjNn(8k܁w<ּSJ':ɔ]sIxPnɑiG?}?c46 fǺHjv2ѓiSKp) E&ARNZQ[Lf_}z1W~뫦*wHLŕV /pCsnY[ݸNg%nXP)?:;f]Yd>Q_)ペokl/.q,Mz=6+VkH WȼDss=_|1[ÔZVQ 0i+.5djW(mjLmp-TE41{r0kei * AT^ݑendstream endobj 730 0 obj << /Filter /FlateDecode /Subtype /Type1C /Length 2277 >> stream xUV TW骊"(=-rQE4 .("B7Mp .Ǎ D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xnCi1Z0EG~}@^.\MIC$}VvbVՉ}ѧ~o;|C/P z$-$y8|ֵ3~v ڇ-X<7 e<M"a/=_R>Ѵ>ў>\D}_@endstream endobj 755 0 obj << /Type /XRef /Length 429 /Filter /FlateDecode /DecodeParms << /Columns 5 /Predictor 12 >> /W [ 1 3 1 ] /Info 3 0 R /Root 2 0 R /Size 756 /ID [<1b0bad57a3e243a5e9d4cecc755b8209>] >> stream x+Daƿs0s93̘aZf%e$; v aXl4(GRK) 7f5 ]Є|*W\[mH$Gh69u\13g4f]ɌlfdfW2#42ffȉ,g$3B]Sà݂qH-2u Qu Бm7蟅N+w|k s>A,uL'11hm=?TN{LlLE虧жiMByB}d oǘx*IV=c|jz~4C7sbM{oXQ ƚIv`~ɚ/!Ț0{8A 3Nt_qY endstream endobj startxref 464141 %%EOF rrcov/inst/CITATION0000644000176200001440000000135412763517421013532 0ustar liggesuserscitHeader("To cite rrcov in publications use:") citEntry(entry = "Article", title = "An Object-Oriented Framework for Robust Multivariate Analysis", author = personList(as.person("Valentin Todorov"), as.person("Peter Filzmoser")), journal = "Journal of Statistical Software", year = "2009", volume = "32", number = "3", pages = "1--47", url = "http://www.jstatsoft.org/v32/i03/", textVersion = paste("Valentin Todorov, Peter Filzmoser (2009).", "An Object-Oriented Framework for Robust Multivariate Analysis.", "Journal of Statistical Software, 32(3), 1-47.", "URL http://www.jstatsoft.org/v32/i03/.") ) rrcov/inst/NEWS.Rd0000644000176200001440000000437713607362132013443 0ustar liggesusers% Check from R: % news(db = tools:::.build_news_db_from_package_NEWS_Rd("C:/projects/statproj/R/rrcov/inst/NEWS.Rd")) \name{NEWS} \title{News for \R Package \pkg{rrcov}} \encoding{UTF-8} \section{CHANGES in rrcov VERSION 1.4-7 (2018-11-14)}{ \subsection{NEW FEATURES}{ \itemize{ \item Added Minimum Regularized Covariance Determinant estimator (MRCD) (Boudt et al. 2018) - functions \code{CovMrcd()} and \code{CovControlMrcd()} \item Added data set \code{octane}; data set \code{olitos} from package rrcovHD moved here. \item The 'pairs' plot is now available for classical covariance matrix } } } \section{CHANGES in rrcov VERSION 1.4-9 (2019-11-25)}{ \subsection{NEW FEATURES}{ \itemize{ \item Added data set \code{diabetes}; data set \code{soil} from package \code{rrcovHD} moved here. \item Linear and quadratic discriminant analysis can use the MRCD estimates. } } \subsection{BUG FIXES}{ \itemize{ \item Fixed an issue with CovControlMcd(nsamp="deterministic") - this would not work, because nsamp was defined in the class definition as "numeric". Now it is "Cnumeric" - union of "character" and "numeric'. \item Corrected the code for Minimum Regularized Covariance Determinant estimator (MRCD) - \code{CovMrcd()} - the step of adjusting the eignevalues in r6pack() is excluded now because it has no effect when n > p. } } } \section{CHANGES in rrcov VERSION 1.5-2 (2020-01-14)}{ \subsection{NEW FEATURES}{ \itemize{ \item Added parameter 'control' to Linda - to select the robust location and covariance estimator to use in LDA. Now any estimator derived from class 'Cov' can be used, even such that are not in 'rrcov'. Return this parameter in the returned S4 object. \item Linda returns now the location and covariance estimator used as 'covobj'. This is useful for controlling cross-validation, for example. \item Linda and LdaClassic use generalized inverse if the common covariance matrix is singular. } } \subsection{BUG FIXES}{ \itemize{ \item Fixed an issue the 'predict' function. \item Removed the dependence on packages 'cluster' and 'ellipse'. } } }