Calculates the maximum likelihood estimators of the parameters of a fractionally-differenced ARIMA (p,d,q) model, together (if possible) with their estimated covariance and correlation matrices and standard errors, as well as the value of the maximized likelihood. The likelihood is approximated using the fast and accurate method of Haslett and Raftery (1989).
fracdiff(x, nar = 0, nma = 0,
         ar = rep(NA, max(nar, 1)), ma = rep(NA, max(nma, 1)),
         dtol = NULL, drange = c(0, 0.5), h, M = 100, trace = 0)an object of S3 class
"fracdiff", which is
  a list with components:
logarithm of the maximum likelihood
optimal fractional-differencing parameter
vector of optimal autoregressive parameters
vector of optimal moving average parameters
covariance matrix of the parameter estimates (order : d, ar, ma).
standard errors of the parameter estimates
  c(d, ar, ma).
correlation matrix of the parameter estimates (order : d, ar, ma).
interval used for numerical derivatives, see h argument.
interval of uncertainty for d; possibly altered from input
    dtol.
as input.
the approximate Hessian matrix \(H\) of 2nd order
    partial derivatives of the likelihood with respect to the
    parameters; this is (internally) used to compute
    covariance.dpq, the approximate asymptotic covariance matrix as
    \(C = (-H)^{-1}\).
time series (numeric vector) for the ARIMA model
number of autoregressive parameters \(p\).
number of moving average parameters \(q\).
initial autoregressive parameters.
initial moving average parameters.
interval of uncertainty for \(d\).  If dtol is
    negative or NULL, the fourth root of machine precision will be used.
    dtol will be altered if necessary by the program.
interval over which the likelihood function is to be maximized as a function of \(d\).
size of finite difference interval for numerical derivatives.
    By default (or if negative),
    h = min(0.1, eps.5 * (1+ abs(cllf))), where
    clff := log. max.likelihood (as returned) and
    eps.5 := sqrt(.Machine$double.neg.eps) (typically 1.05e-8).
This is used to compute a finite difference approximation to the
    Hessian, and hence only influences the cov, cor, and std.error
    computations; use fracdiff.var() to change this
    after the estimation process.
number of terms in the likelihood approximation (see Haslett and Raftery 1989).
optional integer, specifying a trace level. If positive, currently the “outer loop” iterations produce one line of diagnostic output.
The optimization is carried out in two levels:
  an outer univariate unimodal
  optimization in d over the interval drange (typically [0,.5]),
  using Brent's fmin algorithm), and
  an inner nonlinear least-squares optimization in the AR and MA parameters to
  minimize white noise variance (uses the MINPACK subroutine lmDER).
  written by Chris Fraley (March 1991).
The variance-covariance matrix and consequently the standard errors
  may be quite inaccurate, see the example in fracdiff.var.
The fracdiff package has --- for historical reason, namely,
  S-plus arima() compatibility --- used an unusual
  parametrization for the MA part, see also the ‘Details’ section
  in arima (in standard R's stats package).
  The ARMA (i.e., \(d = 0\)) model in fracdiff() and
  fracdiff.sim() is
$$X_t - a_1X_{t-1} - \cdots - a_pX_{t-p} = e_t - b_1e_{t-1} - \dots - b_qe_{t-q},$$
where \(e_i\) are mean zero i.i.d., for fracdiff()'s
  estimation,  \(e_i \sim \mathcal{N}(0,\sigma^2)\).
  This model indeed has the signs of the MA coefficients \(b_j\)
  inverted, compared to other parametrizations, including
  Wikipedia's
  https://en.wikipedia.org/wiki/Autoregressive_moving-average_model
  and the one of arima.
Note that NA's in the initial values for ar or ma
  are replaced by \(0\)'s.
J. Haslett and A. E. Raftery (1989) Space-time Modelling with Long-memory Dependence: Assessing Ireland's Wind Power Resource (with Discussion); Applied Statistics 38, 1--50.
R. Brent (1973) Algorithms for Minimization without Derivatives, Prentice-Hall
J. J. More, B. S. Garbow, and K. E. Hillstrom (1980) Users Guide for MINPACK-1, Technical Report ANL-80-74, Applied Mathematics Division, Argonne National Laboratory.
coef.fracdiff and other methods for "fracdiff"
  objects;
  fracdiff.var() for re-estimation of variances or
  standard errors;
  fracdiff.sim
ts.test <- fracdiff.sim( 5000, ar = .2, ma = -.4, d = .3)
fd. <- fracdiff( ts.test$series,
                 nar = length(ts.test$ar), nma = length(ts.test$ma))
fd.
## Confidence intervals
confint(fd.)
## with iteration output
fd2 <- fracdiff(ts.test$series, nar = 1, nma = 1, trace = 1)
all.equal(fd., fd2)
Run the code above in your browser using DataLab