Title: | Robust Estimation of the ACF from the M-Periodogram |
---|---|
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>. |
Authors: | Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc |
Maintainer: | Higor Cotta <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2025-02-03 02:52:56 UTC |
Source: | https://github.com/rogih/acfmperiod |
Wrapper that computes the covariance or correlation matrix of x
at lag 0 obtained from the robust MPer-ACF.
CovCorMPer(x, type = c("correlation", "covariance"))
CovCorMPer(x, type = c("correlation", "covariance"))
x |
a numeric matrix |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". |
a numeric matrix
data.set <- cbind(fdeaths, mdeaths) CovCorMPer(data.set)
data.set <- cbind(fdeaths, mdeaths) CovCorMPer(data.set)
Wrapper that computes the covariance or correlation matrix of x
at lag 0 obtained from the Per-ACF.
CovCorPer(x, type = c("correlation", "covariance"))
CovCorPer(x, type = c("correlation", "covariance"))
x |
a numeric matrix |
type |
character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". |
a numeric matrix
data.set <- cbind(fdeaths, mdeaths) CovCorPer(data.set)
data.set <- cbind(fdeaths, mdeaths) CovCorPer(data.set)
This function computes the cross-periodogram using harmonic regression.
CrossPeriodogram(series1, series2)
CrossPeriodogram(series1, series2)
series1 |
univariate time series |
series2 |
univariate time series |
a numeric vector containing the estimates of the cross-spectral density
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
This function computes the Robust M-cross-periodogram using M-regression.
MCrossPeriodogram(series1, series2)
MCrossPeriodogram(series1, series2)
series1 |
univariate time series |
series2 |
univariate time series |
a numeric vector containing the estimates of the cross-spectral density
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
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.
MPerACF(x, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, demean = TRUE, ...)
MPerACF(x, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, demean = TRUE, ...)
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. |
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.
Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc. Part of the code re-used from the acf() function.
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009
data.set <- cbind(fdeaths, mdeaths) MPerACF(data.set)
data.set <- cbind(fdeaths, mdeaths) MPerACF(data.set)
This function computes the univariate robust M-periodogram using M-regression.
MPerioReg(series)
MPerioReg(series)
series |
univariate time series |
a numeric vector containing the robust estimates of the spectral density
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc.
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.
MPerioReg(ldeaths)
MPerioReg(ldeaths)
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..
PerACF(x, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, demean = TRUE, ...)
PerACF(x, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, demean = TRUE, ...)
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. |
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.
Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc. Part of the code re-used from the acf() function.
Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.
data.set <- cbind(fdeaths, mdeaths) PerACF(data.set) PerACF(data.set, type = "covariance", lag.max = 10)
data.set <- cbind(fdeaths, mdeaths) PerACF(data.set) PerACF(data.set, type = "covariance", lag.max = 10)
This function computes the univariate periodogram using harmonic regression.
PerioReg(series)
PerioReg(series)
series |
univariate time series |
a numeric vector containing the robust estimates of the spectral density
Higor Cotta, Valdério A. Reisen, Pascal Bondon and Céline Lévy-Leduc.
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.
PerioReg(ldeaths)
PerioReg(ldeaths)
Plot method for objects of class "robacf". Mostly of the code re-used from the standard acf class.
## 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"), ...)
## 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"), ...)
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. |
None
plot.acf (stats) - R Core