arrob: Robust Fitting of Autoregressive Models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Robust fit of an autoregressive model to a time series. Its order is either optimized with respect to a robustified AIC or specified by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
arrob(x, aic = TRUE, order.max, method = c("yw", "regression", "gm", "filter"),
      na.action = na.fail, series = deparse(substitute(x)),asyvar=FALSE,bootpar=list(num=100,blockl=floor(2*length(x)^(1/2))), ...)

arrob.yw(x, order.max, aic = TRUE, aicpenalty = function(p) 2*p,
      na.action = na.fail, series = deparse(substitute(x)),
      acf.approach = c("GK", "median", "multi", "partrank", "RA", "rank",
      "filter", "trim", "bireg"), locfn = median, scalefn = Qn, ...)
      
arrob.regression(x, order.max, aic = TRUE, aicpenalty = function(p) 2*p,
      na.action = na.fail, series = deparse(substitute(x)),
      intercept = TRUE, scalefn = Qn, ...)
      
arrob.filter(x, order.max, aic = TRUE, aicpenalty = function(p) 2*p,
      na.action = na.fail, series = deparse(substitute(x)),
      psi.l = 2, psi.0 = 3)

Arguments

x

numeric vector of a univariate time series.

aic

logical indicating whether the AR order should be estimated by robust AIC criteria considering orders up to order.max (if aic = TRUE) or should be equal to order.max (if aic = FALSE).

order.max

integer value determining the (maximal) order of the AR fit. If missing, this value is chosen to be floor(min(c((n - 1) / 4, 10 * log(n, base = 10)))), where n is the number of observations.

method

character string naming the estimation method to be used, see Details.

na.action

function to be called to handle missing values. Default is na.fail. Other reasonable possibilities are na.omit (omits all missing values at the beginning and the end of the time series and fails if there are more missing values), na.contiguous (uses longest contiguous stretch of non-missing observations) and na.extremify (experimental, sets missing values to very extreme values in the expectation that they have only little influence on the outcome of robust estimation methods).

series

the time series name.

asyvar

logical indicating whether the covariance matrix of the fitted AR coefficients should be estimated by a block bootstrap. The default is FALSE since it can take some time.

bootpar

list containing parameters of the blockbootstrap which is used to estimate the variance of the fitted AR coefficients, see Details.

aicpenalty

function of the model order defining the penalty term of the model selection criteria. The default results in a robust AIC.

...

further arguments to be passed to internal function arrob.yw, arrob.regression, arrob.filter or arrob.gm. See below or on the respective help page.

acf.approach

character string naming the function to calculate the autocorrelation function. See acfrob for details. It is not recommended to use acf.approach = "filter" since one can get an AR fit more directly by method = "filter".

locfn

function which calculates a location estimator. Its argument must be a vector of the data.

scalefn

function which calculates a scale estimator. Its argument must be a vector of the data. One could for example use one of the functions Qn (the default), Sn, scaleTau2 (all from the package robustbase), mad or (not robust) sd.

intercept

logical whether the regression model includes an intercept.

psi.l

numeric value determining the psi function, see the help page of ARfilter for details.

psi.0

numeric value determining the psi function, see the help page of ARfilter for details.

Details

There are many possibilities for robust estimation of AR models. The argument method specifies which of the following methods is to be used, where method = "yw" is the default.

"yw"

One approach is to use a roust estimation of the autocorrelation function. The corresponding AR coefficients can be then either computed by solving the Yule-Walker equations method = "yule-walker" employing the Durbin-Levinson algorithm. The acf estimator can be determined by acf.fun. See the help page of acfrob for an overview of implemented procedures for estimation of the acf.

"regression"

The AR coefficients are computed by a robust regression. Here the dependent variable is the time series x and the independent variables are the up to order.max lagged time series. The regression is done by MM estimation with the function lmrob, see Rousseeuw et al. (2014).

"filter"

The regression coefficients are computed via robust filtering as described in Chapter 8.6 of Maronna et al. (2006). See the help page of ARfilter for details.

"gm"

Generalized M estimates are used for obtaining an AR fit as described in Maronna et al. (2006). See the help page of arrob.gm for details and further arguments which are passed to that function by the ... argument.

If aic = TRUE, AR models for every order up to order.max are estimated and the one with the smallest model selection criterion returned. The criterion is the sum of the logarithm of a robust variance estimation of the residuals and a penalty term pen(p) divided by n-p depending on the AR order p, i.e.,

log(sigma_hat^2) + (pen(p))/(n-p)

The penalty term can be set by the argument aicpenalty.

If asyvar=TRUE the variance of the fitted AR coefficients is estimated by a moving block bootstrap, see Lahiri (1999) for a detailed description of this method. The blocklength can be set by the blockl argument and thr number of bootstrap repetitions by num. Note that there are no theoretical justifications that this estimation is consistent for robust methods.

Value

Object of classes "arrob" and "ar". This is a list which includes all elements of an object of class "ar" (see ar for details) plus the following additional element:

x

the original time series x.

Note that list element aic gives the value of the robust information criterion and not its difference with the lowest information criterion of all considered models, as it is returned by the function ar.

Author(s)

Alexander Dürre, Tobias Liboschik and Jonathan Rathjens

References

Lahiri, S.N. (1999): Theoretical Comparisons of Block Bootstrap Methods, The annals of Statistics, vol. 27, 386–404.

Maronna, R. A., Martin, R. D., and Yohai, V. J. (2006): Robust Statistics: Theory and Methods, Wiley, chapter 8, doi: 10.1002/0470010940.

Rousseeuw, P., Croux, C., Todorov, V., Ruckstuhl, A., Salibian-Barrera, M., Verbeke, T., Koller, M. and Maechler, M. (2014): robustbase: Basic Robust Statistics. R package version 0.91-1. URL http://cran.r-project.org/package=robustbase.

See Also

Classical, nonrobust fitting is provided by the function ar.

S3 methods residuals.arrob, fitted.arrob, filtered.arrob and predict.arrob for objects of class "arrob".

Examples

1
2
3
4
5
6
set.seed(1066)
tss <- arima.sim(model = list(ar = 0.3, ma = 0.5), n = 100)
arrob(tss, method = "yw")
arrob(tss, method = "regression")
arrob(tss, method = "filter")
arrob(tss, method = "gm")

robts documentation built on May 2, 2019, 4:55 p.m.