Type: | Package |
Title: | Robust Estimation of the ACF from the M-Periodogram |
Version: | 1.0.0 |
Author: | Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc |
Maintainer: | Higor Cotta <cotta.higor@gmail.com> |
Depends: | R (≥ 3.2.2), MASS |
Description: | Non-robust and robust computations of the sample autocovariance (ACOVF) and sample autocorrelation functions (ACF) of univariate and multivariate processes. The methodology consists in reversing the diagonalization procedure involving the periodogram or the cross-periodogram and the Fourier transform vectors, and, thus, obtaining the ACOVF or the ACF as discussed in Fuller (1995) <doi:10.1002/9780470316917>. The robust version is obtained by fitting robust M-regressors to obtain the M-periodogram or M-cross-periodogram as discussed in Reisen et al. (2017) <doi:10.1016/j.jspi.2017.02.008>. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2019-07-19 23:36:17 UTC; higor |
Repository: | CRAN |
Date/Publication: | 2019-07-23 14:22:05 UTC |
Robust covariance or correlation matrix from the MPer-ACF
Description
Wrapper that computes the covariance or correlation matrix of x
at lag 0 obtained from the robust MPer-ACF.
Usage
CovCorMPer(x, type = c("correlation", "covariance"))
Arguments
x |
a numeric matrix |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". |
Value
a numeric matrix
Examples
data.set <- cbind(fdeaths, mdeaths)
CovCorMPer(data.set)
Covariance or correlation matrix from the Per-ACF
Description
Wrapper that computes the covariance or correlation matrix of x
at lag 0 obtained from the Per-ACF.
Usage
CovCorPer(x, type = c("correlation", "covariance"))
Arguments
x |
a numeric matrix |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". |
Value
a numeric matrix
Examples
data.set <- cbind(fdeaths, mdeaths)
CovCorPer(data.set)
Cross-periodogram
Description
This function computes the cross-periodogram using harmonic regression.
Usage
CrossPeriodogram(series1, series2)
Arguments
series1 |
univariate time series |
series2 |
univariate time series |
Value
a numeric vector containing the estimates of the cross-spectral density
Author(s)
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc
References
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
Robust M-cross-periodogram
Description
This function computes the Robust M-cross-periodogram using M-regression.
Usage
MCrossPeriodogram(series1, series2)
Arguments
series1 |
univariate time series |
series2 |
univariate time series |
Value
a numeric vector containing the estimates of the cross-spectral density
Author(s)
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc
References
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
Robust autocorrelation or autocovariance function estimation from the robust M-periodogram
Description
This function computer and plots(by default) the robust estimates of the autocovariance or the autocorrelation function for univariate and multivariate time series based on the M-periodogram and the M-cross-periodogram.
Usage
MPerACF(x, lag.max = NULL, type = c("correlation", "covariance"),
plot = TRUE, na.action = na.fail, demean = TRUE, ...)
Arguments
x |
a numeric vector or matrix. |
lag.max |
maximum lag at which to calculate the acf. Default is 10*log10(N/m) where N is the number of observations and m the number of series. Will be automatically limited to one less than the number of observations in the series. |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". Accepts parcial names. |
plot |
logical. If TRUE (the default) the acf is plotted. |
na.action |
function to be called to handle missing values. na.pass can be used. |
demean |
logical. Should the covariances be about the sample means? |
... |
further arguments to be passed to plot.acf. |
Value
An object of class "robacf", which is a list with the following elements:
lag
A three dimensional array containing the lags at which the acf is estimated.
acf
An array with the same dimensions as lag containing the estimated acf.
type
The type of correlation (same as the type argument).
n.used
The number of observations in the time series.
series
The name of the series x.
snames
The series names for a multivariate time series.
The result is returned invisibly if plot is TRUE.
Author(s)
Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc. Part of the code re-used from the acf() function.
References
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009
Examples
data.set <- cbind(fdeaths, mdeaths)
MPerACF(data.set)
Robust M-periodogram
Description
This function computes the univariate robust M-periodogram using M-regression.
Usage
MPerioReg(series)
Arguments
series |
univariate time series |
Value
a numeric vector containing the robust estimates of the spectral density
Author(s)
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc.
References
Reisen, V. A. and Lévy-Leduc, C. and Taqqu, M. (2017) An M-estimator for the long-memory parameter. Journal of Statistical Planning and Inference, 187, 44-55.
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
Examples
MPerioReg(ldeaths)
Autocorrelation or autocovariance function estimation from the periodogram
Description
This function computer and plots(by default) the estimates of the autocovariance or the autocorrelation function for univariate and multivariate time series based on the periodogram and the cross-periodogram..
Usage
PerACF(x, lag.max = NULL, type = c("correlation", "covariance"),
plot = TRUE, na.action = na.fail, demean = TRUE, ...)
Arguments
x |
a numeric vector or matrix. |
lag.max |
maximum lag at which to calculate the acf. Default is 10*log10(N/m) where N is the number of observations and m the number of series. Will be automatically limited to one less than the number of observations in the series. |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". Accepts parcial names. |
plot |
logical. If TRUE (the default) the acf is plotted. |
na.action |
function to be called to handle missing values. na.pass can be used. |
demean |
logical. Should the covariances be about the sample means? |
... |
further arguments to be passed to plot.acf. |
Value
An object of class "acf", which is a list with the following elements:
lag
A three dimensional array containing the lags at which the acf is estimated.
acf
An array with the same dimensions as lag containing the estimated acf.
type
The type of correlation (same as the type argument).
n.used
The number of observations in the time series.
series
The name of the series x.
snames
The series names for a multivariate time series.
The result is returned invisibly if plot is TRUE.
Author(s)
Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc. Part of the code re-used from the acf() function.
References
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
Examples
data.set <- cbind(fdeaths, mdeaths)
PerACF(data.set)
PerACF(data.set, type = "covariance", lag.max = 10)
Periodogram
Description
This function computes the univariate periodogram using harmonic regression.
Usage
PerioReg(series)
Arguments
series |
univariate time series |
Value
a numeric vector containing the robust estimates of the spectral density
Author(s)
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc.
References
Reisen, V. A. and Lévy-Leduc, C. and Taqqu, M. (2017) An M-estimator for the long-memory parameter. Journal of Statistical Planning and Inference, 187, 44-55.
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
Examples
PerioReg(ldeaths)
Plot Robust Autocovariance and Robust Autocorrelation Functions
Description
Plot method for objects of class "robacf". Mostly of the code re-used from the standard acf class.
Usage
## S3 method for class 'robacf'
plot(x, type = "h", xlab = "Lag", ylab = NULL,
ylim = NULL, main = NULL, max.mfrow = 6, ask = Npgs > 1 &&
dev.interactive(), mar = if (nser > 2) c(3, 2, 2, 0.8) else par("mar"),
oma = if (nser > 2) c(1, 1.2, 1, 1) else par("oma"), mgp = if (nser >
2) c(1.5, 0.6, 0) else par("mgp"), xpd = par("xpd"), cex.main = if
(nser > 2) 1 else par("cex.main"), verbose = getOption("verbose"), ...)
Arguments
x |
an object of class "robacf". |
type |
the type of plot to be drawn, default to histogram like vertical lines. |
xlab |
the x label of the plot. |
ylab |
the y label of the plot. |
ylim |
numeric of length 2 giving the y limits for the plot. |
main |
overall title for the plot. |
max.mfrow |
positive integer; for multivariate x indicating how many rows and columns of plots should be put on one page, using par(mfrow = c(m,m))(see |
ask |
logical; if TRUE, the user is asked before a new page is started. |
mar , oma , mgp , xpd , cex.main |
graphics parameters as in par(*), by default adjusted to use smaller than default margins for multivariate x only. |
verbose |
logical. Should R report extra information on progress? |
... |
graphics parameters to be passed to the plotting routines. |
Value
None
Contributions
plot.acf (stats) - R Core