<CRANTaskView> <!-- emacs, please treat me as -*- html -*- -->
  <!-- to test *AND* find CRAN packages,
  do use ~/R/MM/Pkg-ex/robustness-ctv.R  <<=== TODO there !!
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

  <name>Robust</name>
  <topic>Robust Statistical Methods</topic>
  <!--  &amp; Resistant  ?? -->
  <maintainer email="Martin.Maechler@R-project.org">Martin Maechler</maintainer>
  <version>2016-08-29</version>

  <info>
    <p>
    Robust (or "resistant") methods for statistics modelling have been
    available in S from the very beginning in the 1980s; and then in R in
    package <code>stats</code>.
    <!-- not using <pkg... /pkg  for a standard i.e. non-CRAN package -->
    Examples are <code>median()</code>, <code>mean(*, trim =
    . )</code>, <code>mad()</code>, <code>IQR()</code>,
    or also <code>fivenum()</code>, the statistic
    behind <code>boxplot()</code> in package <code>graphics</code>)
    or <code>lowess()</code> (and <code>loess()</code>) for robust
    nonparametric regression, which had been complemented
    by <code>runmed()</code> in 2003.

    Much further important functionality has been made available in
    recommended (and hence present in all R versions) package
    <pkg>MASS</pkg> (by Bill Venables and Brian Ripley, see <em>the</em> book
    <a href="http://www.stats.ox.ac.uk/pub/MASS4/">Modern Applied
    Statistics with S</a>).
    Most importantly, they provide
    <code>rlm()</code> for robust regression and <code>cov.rob()</code> for
    robust multivariate scatter and covariance.
    </p>

    <p>
    This task view is about R add-on packages providing newer or faster,
    more efficient algorithms and notably for (robustification of) new models.
    </p>

    <p>
    Please send suggestions for additions and extensions to the
    <a href="mailto:maechler@R-project.org">task view maintainer</a>.
    </p>

    <p>
    An international group of scientists working in the field of robust
    statistics has made efforts (since October 2005) to coordinate several of
    the scattered developments and make the important ones available
    through a set of R packages complementing each other.

    These should build on a basic package with "Essentials",
    coined <pkg>robustbase</pkg> with (potentially many) other packages
    building on top and extending the essential functionality to particular
    models or applications.

    Further, there is the quite comprehensive package
    <pkg>robust</pkg>, a version of the robust library of S-PLUS,
    as an R package now GPLicensed thanks to Insightful and Kjell Konis.

    Originally, there has been much overlap between 'robustbase'
    and 'robust', now <pkg>robust</pkg> <em>depends</em>
    on <pkg>robustbase</pkg>, the former providing convenient routines for
    the casual user where the latter will contain the underlying
    functionality, and provide the more advanced statistician with a
    large range of options for robust modeling.
    </p>

    <p>We structure the packages roughly into the following topics, and
    typically will first mention functionality in packages
    <pkg>robustbase</pkg> and <pkg>robust</pkg>.</p>
    <ul>
      <li><i>Regression (Linear, Generalized Linear, Nonlinear Models,
      incl. Mixed Effects)</i>:

	<code>lmrob()</code> (<pkg>robustbase</pkg>) and <code>lmRob()</code>
	(<pkg>robust</pkg>) where the former uses the latest of the
	fast-S algorithms and heteroscedasticity and autocorrelation corrected
	(HAC) standard errors, the latter makes use of the M-S algorithm of
	Maronna and Yohai (2000), automatically when there are factors
	among the predictors (where S-estimators (and hence MM-estimators)
	based on resampling typically badly fail).

	The <code>ltsReg()</code> and <code>lmrob.S()</code> functions
	are available in <pkg>robustbase</pkg>, but rather for comparison
	purposes.

	<code>rlm()</code> from <pkg>MASS</pkg> had been the first widely
	available implementation for robust linear models, and also one of
	the very first MM-estimation implementations.
	<pkg>robustreg</pkg> provides very simple M-estimates for linear
	regression (in pure R).

	Note that Koenker's quantile regression package <pkg>quantreg</pkg>
	contains L1 (aka LAD, least absolute deviations)-regression as a
	special case, doing so also for nonparametric regression via
	splines.

	Quantile regression (and hence L1 or LAD) for mixed effect models,
	is available in package <pkg>lqmm</pkg>, whereas an
	<em>MM-like</em> approach for robust linear <b>mixed effects</b> modeling
	is available from package <pkg>robustlmm</pkg>.

	Package <pkg>mblm</pkg>'s function <code>mblm()</code> fits
	median-based (Theil-Sen or Siegel's repeated) simple linear models.
	Package <pkg>TEEReg</pkg> provides trimmed elemental estimators for
	linear models.<!-- not convincing to MM -->

	Generalized linear models (GLMs) are provided both via
	<code>glmrob()</code> (<pkg>robustbase</pkg>) and <code>glmRob()</code>
	(<pkg>robust</pkg>), <!-- where the former is typically preferable -->
	where package <pkg>robustloggamma</pkg> focuses on generalized log
	gamma models.

	Robust ordinal regression is provided by
	<pkg>rorutadis</pkg> (UTADIS).

	Robust Nonlinear model fitting is available through
	<pkg>robustbase</pkg>'s <code>nlrob()</code>.

	<pkg>multinomRob</pkg> fits overdispersed multinomial regression
	models for count data.

	<pkg>rgam</pkg> and <pkg>robustgam</pkg> both fit robust GAMs,
	i.e., robust Generalized Additive Models.

	<pkg>drgee</pkg> fits "Doubly Robust" Generalized Estimating Equations (GEEs)

      </li>

      <li><i>Multivariate Analysis</i>:

      Here, the <pkg>rrcov</pkg> package which builds ("<code>Depends</code>")
      on <pkg>robustbase</pkg> provides nice S4 class based methods,
      more methods for robust multivariate variance-covariance estimation,
      and adds robust PCA methodology. <!-- .... FIXME; there's more . -->
      It is extended by <pkg>rrcovNA</pkg>, providing robust multivariate
      methods for <em>for incomplete</em> or missing (<code>NA</code>) data, and by
      <pkg>rrcovHD</pkg>, providing robust multivariate methods for
      <em>High Dimensional</em> data.  High dimensional data with an
      emphasis on functional data are treated robustly also by <pkg>roahd</pkg>.

      Here, <pkg>robustbase</pkg> contains a slightly more flexible
      version, <code>covMcd()</code> than <pkg>robust</pkg>'s
      <code>fastmcd()</code>, and similarly for <code>covOGK()</code>.
      OTOH, <pkg>robust</pkg>'s <code>covRob()</code> has automatically chosen
      methods, notably <code>pairwiseQC()</code> for large dimensionality p.

      Package <pkg>robustX</pkg> for experimental, or other not yet
      established procedures, contains <code>BACON()</code> and
      <code>covNCC()</code>, the latter providing the
      neighbor variance estimation (NNVE) method of Wang and Raftery (2002),
      also available (slightly less optimized) in <pkg>covRobust</pkg>.

      <pkg>RobRSVD</pkg> provides a robust Regularized Singular Value Decomposition.

      <pkg>mvoutlier</pkg> (building on <pkg>robustbase</pkg>) provides
      several methods for outlier identification in high dimensions.

      <pkg>GSE</pkg> estimates multivariate location and scatter in the presence of missing data.

      <pkg>FRB</pkg> performs robust inference based on <b>F</b>ast
      and <b>R</b>obust <b>B</b>ootstrap on robust estimators, including
      multivariate regression, PCA and Hotelling tests.

      <pkg>RSKC</pkg> provides <b>R</b>obust <b>S</b>parse
      <b>K</b>-means <b>C</b>lustering.
      <pkg>robustDA</pkg> for <em>robust mixture Discriminant Analysis</em>
      (RMDA) builds a mixture model classifier with noisy class labels.

      <pkg>robcor</pkg> computes robust pairwise correlations based on scale estimates,
      particularly on <code>FastQn()</code>.

      <pkg>covRobust</pkg> provides the
      nearest neighbor variance estimation (NNVE) method of Wang and
      Raftery (2002).

<!-- Package <pkg>MCLIME</pkg>'s function <code>m.clime())</code> fits -->
<!-- constrained L1 ...  MM: Its example never ran correctly, as they -->
<!-- did *not* escape '%' !! -->

      Note that robust PCA can be performed by using standard
      R's <code>princomp()</code>, e.g.,
      <code> X &lt;- stackloss; pc.rob &lt;- princomp(X, covmat= MASS::cov.rob(X))</code>


      See also the CRAN task views
          <view>Multivariate</view> and
          <view>Cluster</view>
      </li>

      <li><i>Large Data Sets</i>: <code>BACON()</code> (in <pkg>robustX</pkg>)
        should be applicable for larger (n,p) than traditional robust
        covariance based outlier detectors.

	<pkg>OutlierDM</pkg> detects outliers for replicated high-throughput data.

	(See also the CRAN task view <view>MachineLearning</view>.)</li>

      <li><i>Descriptive Statistics / Exploratory Data Analysis</i>:
	<code>boxplot.stats()</code>, etc mentioned above </li>

      <li><i>Time Series</i>:
	<ul>
	  <li> R's <code>runmed()</code> provides <i>most robust</i>
	    running median filtering.</li>
	  <li>
	    Package <pkg>robfilter</pkg> contains robust regression and
	    filtering methods for univariate time series, typically based on
	    repeated (weighted) median regressions.</li>

	  <li>
	    The <pkg>RobPer</pkg> provides several methods for robust
	    periodogram estimation, notably for irregularly spaced time series.</li>

	  <li>
	    Peter Ruckdeschel has started to lead an effort for a robust
	    time-series package, see <rforge>robust-ts</rforge> on R-Forge.</li>

	  <li>
	    Further, robKalman, <i>"Routines for Robust Kalman
	    Filtering --- the ACM- and rLS-filter"</i>, is being developed, see
	    <rforge>robkalman</rforge> on R-Forge.</li>
	</ul>
	Note however that these (last two items) are not yet available from CRAN.
        </li>

      <li><i>Econometric Models</i>:

	Econometricians tend to like HAC (heteroscedasticity and
        autocorrelation corrected) standard errors. For a broad class of
        models, these are provided by package <pkg>sandwich</pkg>.

	Note that <code>vcov(lmrob())</code> also uses a version of HAC
	standard errors for its robustly estimated linear models.

	See also the CRAN task view <view>Econometrics</view>
      </li>

      <li><i>Robust Methods for Bioinformatics</i>:
      There are several packages in the <a
      href="http://www.bioconductor.org/">Bioconductor project</a>
      providing specialized robust methods.

      In addition, <pkg>RobLoxBioC</pkg> provides infinitesimally robust
      estimators for preprocessing omics data.
       </li>

      <li><i>Robust Methods for Survival Analysis</i>:
	Package <pkg>coxrobust</pkg> provides robust estimation in the Cox
	model; package <pkg>rsig</pkg> does robust signature selection for
	survival outcomes.
	<pkg>OutlierDC</pkg> detects outliers using quantile regression for
	censored data.
      </li>

      <li><i>Robust Methods for Surveys</i>:
	On R-forge only, package <rforge>rhte</rforge> provides a robust
	Horvitz-Thompson estimator.
      </li>

      <li><i>Geostatistics</i>:
      	Package <pkg>georob</pkg> aims at robust geostatistical
      	analysis of spatial data, such as kriging and more.
      </li>

      <li><i>Collections of several methodologies</i>:
	<ul>
	  <li> <pkg>WRS2</pkg> contains <!-- currently (2014-11) -->
	    robust tests for ANOVA and ANCOVA from Rand Wilcox's collection.</li>

	  <li> <pkg>robeth</pkg> contains R functions interfacing to the extensive
	    RobETH fortran library with many functions for regression,
	    multivariate estimation and more.</li>
	</ul>
      </li>

      <li><i>Other approaches to robust and resistant methodology</i>:
	<ul>
	  <li>
	    The package <pkg>distr</pkg> and its several child packages
	    also allow to explore robust estimation concepts, see e.g.,
	    <rforge>distr</rforge> on R-Forge.</li>
	  <li>
	    Notably, based on these,
	    the project <rforge>robast</rforge> aims for the implementation of R
	    packages for the computation of optimally robust estimators and
	    tests as well as the necessary infrastructure (mainly S4 classes
	    and methods) and diagnostics; cf. M. Kohl (2005).
	    It includes the R packages
	    <pkg>RandVar</pkg>, <pkg>RobAStBase</pkg>, <pkg>RobLox</pkg>,
	    <pkg>RobLoxBioC</pkg>, <pkg>RobRex</pkg>.
	    Further, <pkg>ROptEst</pkg>, and <pkg>ROptRegTS</pkg>.
	  </li>
	  <li> <pkg>RobustAFT</pkg> computes Robust Accelerated Failure
	  Time Regression for Gaussian and logWeibull errors.
	  </li>
	  <li> <pkg>wle</pkg> <i>Weighted Likelihood Estimation</i> provides
	    robustified likelihood estimation for a range of models,
	    notably (generalized) regression, and time series (AR and
	    fracdiff).
	  </li>

	  <li><pkg>robumeta</pkg> for robust variance meta-regression </li>

	  <li><pkg>ssmrob</pkg> provides robust estimation and inference in sample selection models.
	  </li>
	</ul>
      </li>
    </ul>
  </info>

  <!-- >> sorted alphabetically in HTML irrespective of order here!
       ==> add newest at BOTTOM ! -->
  <packagelist>
    <pkg priority="core">MASS</pkg>
    <pkg priority="core">robustbase</pkg>
    <pkg priority="core">robust</pkg>
    <pkg priority="core">rrcov</pkg>

    <pkg>covRobust</pkg>
    <pkg>coxrobust</pkg>
    <pkg>distr</pkg>
    <pkg>drgee</pkg>
    <pkg>FRB</pkg>
    <pkg>georob</pkg>
    <pkg>GSE</pkg>
    <pkg>multinomRob</pkg>
    <pkg>lqmm</pkg>
    <pkg>mblm</pkg>
    <pkg>mvoutlier</pkg>
    <pkg>OutlierDC</pkg>
    <pkg>OutlierDM</pkg>
    <pkg>quantreg</pkg>
    <pkg>RandVar</pkg>
    <pkg>rgam</pkg>
    <pkg>ROptEst</pkg>
    <pkg>ROptRegTS</pkg>
    <pkg>robcor</pkg>
    <pkg>RobAStBase</pkg>
    <pkg>RobLox</pkg>
    <pkg>RobLoxBioC</pkg>
    <pkg>RobPer</pkg>
    <pkg>RobRex</pkg>
    <pkg>RobRSVD</pkg>
    <pkg>robumeta</pkg>
    <pkg>RobustAFT</pkg>
    <pkg>robfilter</pkg>
    <pkg>robustlmm</pkg>
    <pkg>robustX</pkg>
    <pkg>rrcovHD</pkg>
    <pkg>rrcovNA</pkg>
    <pkg>RSKC</pkg>
    <pkg>rsig</pkg>
    <pkg>sandwich</pkg>
    <pkg>ssmrob</pkg>
    <pkg>wle</pkg>
    <pkg>robustgam</pkg>
    <pkg>robustloggamma</pkg>
    <pkg>robustreg</pkg>
    <pkg>rorutadis</pkg>
    <pkg>TEEReg</pkg>
    <pkg>robustDA</pkg>
    <pkg>WRS2</pkg>
    <pkg>robeth</pkg>
    <pkg>roahd</pkg>
  </packagelist>

  <links>
    Mailing list:
    <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-robust/">R Special Interest Group on Robust Statistics</a>
    <a href="http://www.statistik.tuwien.ac.at/rsr/">Robust Statistics in R (TU Vienna)</a>
    <rforge>distr</rforge>
    <rforge>robast</rforge>
    <rforge>robkalman</rforge>
    <rforge>robust-ts</rforge>
  </links>

</CRANTaskView>
