Type: | Package |
Title: | Robust Correlations |
Version: | 0.1-6.1 |
Date: | 2014-01-06 |
Author: | Paul Smirnov |
Maintainer: | Paul Smirnov <s.paul@mail.ru> |
Description: | Robust pairwise correlations based on estimates of scale, particularly on "FastQn" one-step M-estimate. |
Suggests: | MASS, robustbase, sfsmisc |
Depends: | R (≥ 2.10.0), stats |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Packaged: | 2022-06-27 05:13:27 UTC; hornik |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2022-06-27 05:20:51 UTC |
Robust, Efficient and Fast Scale Estimate
Description
Compute the robust scale estimator FastQn, an efficient alternative to the MAD, a fast alternative to the Qn.
Usage
FastQn(x, center = median(x), scale = mad(x, center))
fqn(x, center = median(x), scale = mad(x, center))
s_FastQn(x, mu.too = FALSE, center = median(x), ...)
Arguments
x |
numeric vector of observations. |
center |
optionally, the center: defaults to the median. |
scale |
optionally, the basic scale: defaults to the median absolute deviation. |
mu.too |
logical indicating if the |
... |
potentially further arguments for |
Details
This function computes one-step M-estimate of scale based on provided robust estimate (defaults to the MAD). It gives 50% breakdown point and Gaussian efficiency about 80%.
The fqn
function is a shorter alias, like sd
and
mad
.
Value
FastQn()
returns a number, the FastQn robust scale estimator.
s_FastQn(x, mu.too=TRUE)
returns a length-2 vector with location and scale;
this is typically only useful for covOGK(*, sigmamu = s_FastQn)
or
robcor(*, scaler = s_FastQn)
.
Author(s)
Paul Smirnov <s.paul@mail.ru>
References
Smirnov, P. O., Shevlyakov, G. L. (2010). On Approximation of the Qn-Estimate of Scale by Fast M-Estimates. In Book of Abstracts: International Conference on Robust Statistics (ICORS 2010) (pp. 94-95). Prague, Czech Republic.
See Also
Examples
set.seed(153)
x <- sort(c(rnorm(80), rt(20, df = 1)))
s_FastQn(x, mu.too=TRUE)
FastQn(x)
Positive Semidefinite Correlation Matrix Correction
Description
Correct pseudo-correlation matrices to make them positive semidefinite ones.
Usage
psdcor(m, method = c("higham", "eigen"), ...)
Arguments
m |
pseudo-correlation matrix to correct. |
method |
optionally, correction method to use. |
... |
potentially further arguments for the particular correction method. |
Details
This function applies transformation to the given matrix in order to make it positive semidefinite correlation matrix.
When method is higham
, use Higham projections algorithm via nearPD()
function.
When method is eigen
, use direct eigenvalues correction via posdefify()
function.
Value
The corrected matrix.
Author(s)
Paul Smirnov <s.paul@mail.ru>
Robust Autocovariance and Autocorrelation Function Estimation
Description
Compute (and by default plot) an estimate of the autocovariance or autocorrelation function.
Usage
robacf(x, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE,
scaler = "s_FastQn", ...)
Arguments
x |
a univariate numeric time series object or a numeric vector. |
lag.max |
maximum lag at which to calculate the acf. Default is |
type |
character string giving the type of acf to be computed.
Allowed values are |
plot |
logical. If |
scaler |
location-scale estimator to use in the algorithm.
By default, |
... |
further arguments to be passed to |
Details
This function is a robust replacement for acf()
.
Note, that implementation and documentation is not finished/polished yet.
Value
A list of class "acf"
. For description of elements see acf()
.
Note
WORK-IN-PROGRESS status.
Author(s)
Paul Smirnov <s.paul@mail.ru>
References
Shevlyakov, G. L., Lyubomishchenko, N. S. and Smirnov, P. O. (2013). Some remarks on robust estimation of power spectra. Proceedings of the 11th International Conference on Computer Data Analysis and Modeling, Minsk, Belarus, 97–104.
Robust Fit Autoregressive Models to Time Series
Description
Fit an autoregressive time series model to the data using robust algorithms.
Usage
robar(x, order = 2, scaler = "s_FastQn")
Arguments
x |
a univariate time series. |
order |
an order of model to fit. |
scaler |
location-scale estimator to use in the algorithm.
By default, |
Details
This function is a robust replacement for ar()
.
Note, that implementation and documentation is not finished/polished yet.
Value
A list of class "ar"
. For description of elements see ar()
.
Note
WORK-IN-PROGRESS status.
Author(s)
Paul Smirnov <s.paul@mail.ru>
References
Shevlyakov, G. L., Lyubomishchenko, N. S. and Smirnov, P. O. (2013). Some remarks on robust estimation of power spectra. Proceedings of the 11th International Conference on Computer Data Analysis and Modeling, Minsk, Belarus, 97–104.
Examples
n <- 100
set.seed(361)
eps <- as.ts(rnorm(n))
x <- arima.sim(list(ar=c(1,-0.9)), n, innov=eps) # basic signal
z <- as.ts(rbinom(n, 1, 0.1) * rnorm(n, sd=10)) # noise
y <- x + z
spec.ar(robar(y, order=2))
Robust Pairwise Correlations.
Description
Compute a robust estimate of the correlation coefficient or correlation matrix via pairwise correlations.
Usage
robcor(x, y = NULL, method = c("ssd", "quadrant", "mcd"), partial = FALSE,
post = "psdcor", scaler = "s_FastQn", regress = "lmrob")
Arguments
x |
a numeric vector, matrix or data frame. |
y |
|
method |
a character string indicating which correlation coefficient is to be computed. |
partial |
logical. Should a partial correlation algorithm be used? |
post |
function to apply after the matrix is built or |
scaler |
function to use as a location-scale estimator in |
regress |
function to use as a regression estimator in partial correlations algorithm.
By default, |
Details
This function is a robust replacement for cor()
.
Note, that implementation and documentation is not finished/polished yet.
Value
Either a single correlation coefficient or a correlation matrix estimate.
Note
WORK-IN-PROGRESS status.
Author(s)
Paul Smirnov <s.paul@mail.ru>
References
Shevlyakov, G. L., Smirnov, P. O. (2011). Robust Estimation of the Correlation Coefficient: An Attempt of Survey. Austrian Journal of Statistics, 40(1&2), 147-156.