arima.mle(x, model, n.cond=<<see below>>, xreg=NULL, ...)
model
should be a list with component names from:
order
,
period
,
ar
,
ma
,
ndiff
,
ar.opt
,
ma.trans
, and
ma.opt
.
See the DETAILS section for further details.
n.cond
must be at least P+D (the default), where P and D are
the orders of the expanded autoregressive and differencing polynomials.
xreg
is of
length 1, the mean of the time series will be estimated.
nlmin
.
arima.object
for details.
SPECIFYING A MODEL.
The components of the
model
argument should be some or all of:
order
,
period
,
ar
,
ma
,
ndiff
,
ar.opt
,
ma.trans
, and
ma.opt
.
order
is a vector of length 3 specifying the order of an ARIMA(p,d,q);
the elements of the vector are (p, d, q), where p and q are the
order of the autoregressive
and moving average operators and d is the number of differences.
period
specifies the period of the ARIMA operators;
e.g., a seasonal operator for monthly data would have a period of
12
(the default is
1
).
ar
and
ma
are vectors of initial values for
autoregressive and moving average coefficients respectively
(if not provided, the initial values to the optimizer are set to
0
).
ndiff
is an alternative way to specify the number of differences.
A model can be specified using either
order
or
ar
,
ma
, and
ndiff
,
or both (but they must agree if both are specified).
The model doesn't explicitly allow for a non-zero mean of the series, though
the estimation is invariant to the mean of the data for many of the possible
models; if you estimate an AR model, you must subtract the mean yourself or
use the
xreg
argument in order to get sensible estimates.
If
ma.trans
is
TRUE
(the default),
the moving average coefficients will be transformed
before passing them to the optimizer,
ensuring invertibility of the model.
ar.opt
and
ma.opt
are logical vectors of length p and q respectively.
If the ith element is
TRUE
,
then the optimizer will optimize over the ith
autoregressive or moving average coefficient.
By default, the vectors are
TRUE
.
This option is useful to fit models in which some
low order coefficients are set to
0
.
If a multiplicative ARIMA model is specified
(i.e., more than one component),
then
model
is a list of lists.
Each list represents a component of the multiplicative ARIMA model,
and is specified in the same manner as above
(i.e., the components of each list are
ar
,
ma
,
ndiff
,
order
,
period
,
ma.trans
,
ar.opt
,
ma.opt
).
THE ALGORITHM.
The likelihood is conditioned on
n.cond
observations.
If no missing values are present,
the likelihood is computed by forming the Choleski decomposition
of the covariance matrix of the process (see Ansley, 1979).
If missing values are present,
then the likelihood is computed using the Kalman filter applied
to a state space representation of the likelihood.
The state space representation is the same as that used by Kohn and
Ansley (1986).
The method of initializing the Kalman filter recursions is that
given by Bell and Hillmer (1987).
The regression parameters are concentrated out of the likelihood,
as in Kohn and Ansley (1985).
The autoregressive and moving average parameters are transformed
to ensure stationarity and invertibility as in Jones (1980).
Unlike the
ar
function, the mean of the series will not be estimated by
arima.mle
unless you use the
xreg
argument.
arima.mle
assumes a zero mean series.
Ansley, C. F. (1979).
An algorithm for the exact likelihood of a mixed autoregressive-moving average
process.
Biometrika
66, 59-65.
Bell, W. and Hillmer, S. (1987).
Initializing the Kalman filter in the nonstationary case.
Research Report CENSUS/SRC/RR-87/33, Statistical Research Division,
Bureau of the Census, Washington, DC, 20233.
Jones, R. H. (1980).
Maximum likelihood fitting of ARMA models to time series
with missing observations.
Technometrics
22, 389-395.
Kohn, R. and Ansley, C. F. (1985).
Efficient estimation and prediction in time series regression models.
Biometrika
72, 694-697.
Kohn, R. and Ansley, C. F. (1986).
Estimation, prediction, and interpolation for ARIMA models with missing data.
Journal of the American Statistical Association
81, 751-761.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
# Simulate an MA(2) series and fit the series using Gaussian # Maximum Likelihood ma <- arima.sim(model=list(ma=c(-.5, -.25))) ma.fit <- arima.mle(ma, model=list(ma=c(-.5, -.25))) # Fit a Box-Jenkins (0,1,1)x(0,1,1)12 Airline model to the 'ship' data # Use zeros as the starting values for the optimizer al.mod <- list(list(order=c(0,1,1)), list(order=c(0,1,1), period=12)) fit <- arima.mle(ship, model=al.mod)