Title: | Robust ARIMA Modeling |
---|---|
Description: | Functions for fitting a linear regression model with ARIMA errors using a filtered tau-estimate. The methodology is described in Maronna et al (2017, ISBN:9781119214687). |
Authors: | Stephen Kaluzny [aut, cre], Bill Dunlap [ctb], TIBCO Software Inc. [aut, cph] |
Maintainer: | Stephen Kaluzny <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 0.2.7 |
Built: | 2024-11-23 06:47:03 UTC |
Source: | CRAN |
Returns an object of class "arima.rob"
that represents a robust fit of a linear
regression model with ARIMA errors using a filtered tau-estimate. The error
model may have seasonal differences and one seasonal moving average
parameter. It also returns the detected outliers and level shifts.
arima.rob(formula, data, contrasts=NULL, start=NULL, end=NULL, p=0, q=0, d=0, sd=0, freq=1, sfreq=NULL, sma=FALSE, max.p=NULL, auto.ar=FALSE, n.predict=20, tol=10^(-6), max.fcal=2000, iter=FALSE, innov.outlier=FALSE, critv=NULL, ...)
arima.rob(formula, data, contrasts=NULL, start=NULL, end=NULL, p=0, q=0, d=0, sd=0, freq=1, sfreq=NULL, sma=FALSE, max.p=NULL, auto.ar=FALSE, n.predict=20, tol=10^(-6), max.fcal=2000, iter=FALSE, innov.outlier=FALSE, critv=NULL, ...)
formula |
a |
data |
a data frame or a |
contrasts |
the same as the |
start |
a character string which can be passed to |
end |
a character string which can be passed to |
p |
the autoregressive order of the errors model.
The default is |
q |
the moving average order of the errors model.
The default is |
d |
the number of regular differences in the ARIMA model.
It must be |
sd |
the number of seasonal differences. It must be |
freq |
the frequency of |
sfreq |
the seasonality frequency of |
sma |
logical flag: if |
auto.ar |
logical flag: If |
max.p |
the maximum order of the autoregressive stationary model that approximates
the ARMA stationary model. If |
n.predict |
the maximum number of future periods for which we wish to compute the
predictions. The default is |
tol |
the tolerance for convergence. |
max.fcal |
the maximum number of function evaluations. |
iter |
a logical flag or the number of iterations to
execute |
innov.outlier |
logical flag: if |
critv |
the critical value for detecting outliers.
If |
... |
extra arguments passed to or from other methods. |
an object of class "arima.rob"
representing the fit and the outliers detected.
See arima.rob.object
for details of
the components of the object.
When either d
or
sd
is greater than zero, the interpretation
of the intercept in the formula
is
different from its usual interpretation:
it represents the coefficient of the lowest order power of the time trend
which can be identified. For example, if
d=2
and
sd=0
, the
intercept represents the coefficient of the
term t^2
.
Bianco, A., Garcia Ben, M., Martinez, E., and Yohai, V. (1996). Robust procedures for regression models with ARIMA errors. COMPSTAT 96, Proceedings in Computational Statistics. Ed. Albert Prat, pages. 27-38. Physica-Verlag, Heidelberg.
Bianco, A., Garcia Ben, M., Martinez, E., and Yohai, V. (1997). Outlier detection in regression models with ARIMA errors using robust estimates. mimeo.
Chang, I., Tiao, G. C., and Chen, C. (1988). Estimation of time series parameters in the presence of outliers. Technometrics, 30:193-204.
Maronna, R. A., Martin, R. D., Yohai, V. J., Salibián-Barrera. M. (2017). Robust Statistics: Theory and Practice (with R), 2nd Edition, Wiley.
Martin, R. D., Samarov, A., and Vandaele, W. (1983). Robust methods for ARIMA models. in Applied Time Series Analysis of Economic Data, E. Zellner, ed.
Yohai, V. Y., and Zamar, R. H. (1988). High breakdown-point estimates of regression by means of the minimization of an efficient scale. Journal of the American Statistical Association, 83:406-413.
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1)
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1)
These are objects of class "arima.rob"
which represent
the robust fit of a
regression model with ARIMA errors. It also contains information about the
detected outliers.
The following components must be included in a legitimate
"arima.rob"
object:
x |
the model matrix. |
y |
the response variable. |
model |
a list with the following named components: |
regcoef |
the estimates of regression coefficients. |
regcoef.cov |
the estimated covariance matrix of the regression coefficients. |
innov |
the estimated innovations. |
innov.acf |
a series whose autocorrelations or partial autocorrelations are the robust estimates of the innovation autocorrelations or partial autocorrelations. |
regresid |
the estimated regression residuals cleaned of additive outliers by the robust filter. |
regresid.acf |
a series whose autocorrelations or partial autocorrelations are the robust estimates of the autocorrelations or partial autocorrelations of the differenced regression residuals. |
sigma.innov |
a robust estimate of the innovation scale. |
sigma.regresid |
an estimate of the scale of the differenced regression residuals. |
sigma.first |
the first estimate of the innovation scale based only on the scale of the differenced model and the ARMA parameters. |
tuning.c |
the bandwidth of the robust filter. |
y.robust |
the response series cleaned of outliers by the robust filter. |
y.cleaned |
the response series cleaned of additive outliers and level shifts after the outliers detection procedure. |
predict.error |
the fitted and predicted regression errors. |
predict.scales |
the standard deviations of the fitted and predicted regression errors. |
n.predict |
the number of predicted observations, which is equal to the
|
tauef |
the inverse of the estimated efficiency factor of the tau-estimate with respect to the LS-estimate. |
inf |
information about the outcome of the last optimization procedure: |
innov.outlier |
logical flag, the same as the |
outliers |
an object of class |
outliers.iter |
optionally a list of objects of class |
n0 |
the number of missing innovations at the beginning. |
call |
an image of the call that produced the object, but with the arguments all
named and with the actual formula included as
the |
assign |
the same as the |
contrasts |
the same as the |
terms |
the same as the |
rank |
the same as the |
This class of objects is returned from the
arima.rob
function.
coef
, formula
,
outliers
,
predict
, print
, summary
.
arima.rob
,
outliers
,
outliers.object
.
This is a method for the function
coef()
for objects inheriting from
class "arima.rob"
.
See coef
or
coef.default
for the general behavior of this
function and for the interpretation of object.
## S3 method for class 'arima.rob' coef(object, ...)
## S3 method for class 'arima.rob' coef(object, ...)
object |
an object of class |
... |
extra arguments passed to or from other methods. The coef method here ignore these arguments. |
a named vector of the model coefficients.
A "timeSeries"
vector containing the monthly industrial production
of France from January 1960 to December 1989.
frip.dat
frip.dat
A "timeSeries"
vector
The import.dat
data frame has 96 rows and 2 columns.
The sample runs from January 1983 to December 1990.
import.dat
import.dat
A data frame with 96 observations and 2 columns:
monthly import taxes of Argentina.
monthly imports of Argentina.
The newtaxes.dat
data frame has 10 rows and 1 column.
The sample runs from January to October 1992.
newtaxes.dat
newtaxes.dat
A data frame with 10 rows and 1 column:
monthly import taxes of Argentina.
Returns an object of class "outliers"
.
outliers(object, iter=NULL)
outliers(object, iter=NULL)
object |
an object of class |
iter |
a number specifying from which iteration to extract the detected outliers,
if the |
an object of class "outliers"
.
If iter
is NULL
,
the object contains
all the detected outliers (and level shifts).
If iter
is not
NULL
, the
object contains the outliers (and level shifts) detected in iteration
iter
.
See outliers.object
for
components of the returned object.
outliers.object
,
arima.rob
,
arima.rob.object
.
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1, iter=2) frip.outliers.all <- outliers(frip.rr) frip.outliers.2 <- outliers(frip.rr, iter=2)
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1, iter=2) frip.outliers.all <- outliers(frip.rr) frip.outliers.2 <- outliers(frip.rr, iter=2)
These are objects of class "outliers"
extracted an object of class "arima.rob"
,
which contain information about the detected outliers (and level shifts).
The following components must be included in a
legitimate "outliers"
object:
nout |
the number of outliers (and level shifts) detected. |
outlier.index |
the index of each detected outlier (or level shift). |
outlier.type |
the type of each detected outlier (or level shift): 1=innovation outlier, 2=additive outlier, 3=level shift. |
outlier.impact |
the size of each detected outlier (or level shift). |
outlier.t.statistics |
the t-statistics for each detected outlier (or level shift). |
outlier.positions |
the |
sigma0 |
the estimate of the innovation scale before correcting the outliers. |
sigma |
the estimate of the innovation scale after correcting the outliers. |
ierror |
the error indicator: if |
This class of objects is returned from the
outliers
function.
print
,
summary
.
outliers
arima.rob
,
arima.rob.object
.
Predicts from a fitted "arima.rob"
object.
## S3 method for class 'arima.rob' predict(object, n.predict=1, newdata=NULL, olddata=NULL, se.fit=FALSE, ...)
## S3 method for class 'arima.rob' predict(object, n.predict=1, newdata=NULL, olddata=NULL, se.fit=FALSE, ...)
object |
an object of class |
n.predict |
the number of predictions to be returned. |
newdata |
a data frame containing the future values of exogenous variables, if any, at which predictions are required. |
olddata |
a data frame containing the original data used to fit
|
se.fit |
logical flag: if |
... |
extra arguments passed to or from other methods. The predict method here ignore these arguments. |
This function is a method for the generic function predict
for class
"arima.rob"
.
It can be invoked by calling predict
for an object of the
appropriate class,
or directly by calling predict.arima.rob
regardless of the
class of the object.
a list containing the following components:
values |
the predicted values. |
std.err |
the pointwise standard errors for the predictions (if |
import.rr <- arima.rob(import ~ taxes-1, data=import.dat, p=2, d=1) import.hat <- predict(import.rr, 5, newdata=newtaxes.dat, se=TRUE)
import.rr <- arima.rob(import ~ taxes-1, data=import.dat, p=2, d=1) import.hat <- predict(import.rr, 5, newdata=newtaxes.dat, se=TRUE)
This is a method for the function print()
for objects inheriting from
class "arima.rob"
.
See print
or
print.default
for the general behavior
of this function and for the interpretation of
x
.
## S3 method for class 'arima.rob' print(x, digits = 4, ...)
## S3 method for class 'arima.rob' print(x, digits = 4, ...)
x |
an object of class |
digits |
the number of digits to display. |
... |
extra arguments passed to or from other methods. |
invisibly returns x
.
Typically called for the printing side effect.
This is a method for the function print
for objects inheriting from class "outliers"
.
See print
or
print.default
for the general behavior
of this function and for the interpretation of
x
.
## S3 method for class 'outliers' print(x, digits = 4, ...)
## S3 method for class 'outliers' print(x, digits = 4, ...)
x |
an object of class |
digits |
the number of digits to display. |
... |
extra arguments passed to or from other methods. |
invisibly returns x
.
Typically called for the printing side effect.
This is a method for the function print
for objects inheriting
from class "summary.arima.rob"
.
See print
or
print.default
for the general
behavior of this function and for the interpretation of
x
.
## S3 method for class 'summary.arima.rob' print(x, digits = 4, ...)
## S3 method for class 'summary.arima.rob' print(x, digits = 4, ...)
x |
an object of class |
digits |
the number of digits to display. |
... |
extra arguments passed to or from other methods. |
invisibly returns x
.
Typically called for the printing side effect.
This is a method for the function print()
for objects inheriting from
class "summary.outliers"
.
See print
or
print.default
for the general
behavior of this function and for the interpretation of
x
.
## S3 method for class 'summary.outliers' print(x, digits = 4, ...)
## S3 method for class 'summary.outliers' print(x, digits = 4, ...)
x |
an object of class |
digits |
the number of digits to display. |
... |
extra arguments passed to or from other methods. |
invisibly returns x
.
Typically called for the printing side effect.
Returns a summary list for an "arima.rob"
object.
## S3 method for class 'arima.rob' summary(object, correlation = FALSE, ...)
## S3 method for class 'arima.rob' summary(object, correlation = FALSE, ...)
object |
an object of class |
correlation |
a logical flag: if |
... |
extra arguments passed to or from other methods. The summary method here ignore these arguments. |
This function is a method for the generic function
summary
for class
"arima.rob"
. It can be invoked by
calling summary
for an object of the
appropriate class, or directly by calling
summary.arima.rob
regardless of the
class of the object.
an object of class "summary.arima.rob"
which
must contain the following components:
ARIMA.model |
the same list as the |
reg.coef |
a matrix with four columns, containing the regression coefficients, their standard errors, the t-statistics and the corresponding p-values. |
regcoef.cov |
the estimated covariance matrix for the regression coefficients. |
regcoef.corr |
the estimated correlation matrix for the regression coefficients.
This is only present if |
AR.coef |
a matrix with four columns, containing the AR coefficients, their standard errors, the t-statistics and the p-values. |
MA.coef |
a matrix with four columns, containing the MA coefficients, their standard errors, the t-statistics and the p-values. |
sMA.coef |
an array which contains the seasonal moving average parameter, its standard error, the t-statistic and the p-value. |
ARIMA.cov |
the estimated covariance matrix of the ARMA coefficients. |
ARIMA.corr |
the estimated correlation matrix of the ARMA coefficients.
This is only present if |
n |
the length of the time series. |
df |
the number of degrees of freedom for the model. |
sigma |
the estimate of the innovations scale. |
call |
the image of the original call to |
outliers |
an object of class |
arima.rob
,
arima.rob.object
,
summary
.
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1) summary(frip.rr)
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1) summary(frip.rr)
Returns an object of class "summary.outliers"
containing a summary list
for an "outliers"
object.
A null value will be returned if printing is invoked.
## S3 method for class 'outliers' summary(object, ...)
## S3 method for class 'outliers' summary(object, ...)
object |
an object of class |
... |
extra arguments passed to or from other methods. The summary method here ignore these arguments. |
This function is a method for the generic function
summary
for class
"outliers"
. It can be invoked by
calling summary
for an object of the
appropriate class, or directly by calling
summary.outliers
regardless of
the class of the object.
a list is returned with the following components:
nout |
number of outliers (and level shifts) detected. |
outliers.table |
the index (or |
sigma0 |
the estimate of the innovation scale before correcting outliers. |
sigma |
the estimate of the innovation scale after correcting outliers. |
outliers
,
outliers.object
,
summary
.
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1) frip.outliers <- outliers(frip.rr) summary(frip.outliers)
frip.rr <- arima.rob(log(frip.dat) ~ 1, p=2, d=1) frip.outliers <- outliers(frip.rr) summary(frip.outliers)
This is a method for the function vcov()
for objects
inheriting from class "arima.rob"
.
See vcov
for the general behavior of this
function and for the interpretation of object
.
## S3 method for class 'arima.rob' vcov(object, nterm=1000, ...)
## S3 method for class 'arima.rob' vcov(object, nterm=1000, ...)
object |
an object inheriting from class |
nterm |
an interger specifying the number of terms. |
... |
extra arguments passed to or from other methods. The method here ignore these arguments. |
the variance-covariance matrix of fitted arima.rob model returned
from a call arima.rob
.