acdFit {ACDm} | R Documentation |
ACD (Autoregressive Conditional Duration) Model Fitting
Description
This function estimates various ACD models with various assumed error term distributions, using Maximum Likelihood Estimation.
The currently available models (conditional mean specifications) are:
Standard ACD, Log-ACD (two alternative specifications), AMACD, ABACD, SNIACD and LSNIACD.
The currently available distributions are:
Exponential (also used for QML), Weibull, Burr, generalized Gamma, and generalized F.
Usage
acdFit(durations = NULL, model = "ACD", dist = "exponential",
order = NULL, startPara = NULL, dailyRestart = 0, optimFnc = "optim",
method = "Nelder-Mead", output = TRUE, bootstrapErrors = FALSE,
forceErrExpec = TRUE, fixedParamPos = NULL, bp = NULL,
exogenousVariables = NULL, control = list())
Arguments
durations |
either (1) a data frame including, at least, a column named 'durations' or 'adjDur' (for adjusted durations), or (2) a vector of durations |
model |
the conditional mean model specification. Must be one of |
dist |
the assumed error term distribution. Must be one of |
order |
a vector detailing the order of the particular ACD model. For example an ACD(p, q) specification should have |
startPara |
a vector with parameter values to start the maximization algorithm from. Must be in the correct order according to the model specification (see Details). |
dailyRestart |
if |
optimFnc |
Specifies which optimization function to use for the estimation. |
method |
Argument passed to the optimization function if |
output |
if |
bootstrapErrors |
if |
forceErrExpec |
if |
fixedParamPos |
a logical vector of |
bp |
used only for the SNIACD or LSNIACD model. A vector of break points. |
exogenousVariables |
specifies the columns in the |
control |
a list of control values,
|
Details
The startPara
argument is a vector of the parameter values to start from. The length of the vector naturally depends on the model
and distribution
. The first elements represent the model parameters, and the last elements the distribution parameters. For example for an ACD(1,1) with Weibull errors the first 3 elements are for the model, and the last is
for the Weibull distribution.
The family of ACD models are
where different specifications of the conditional mean duration and the error term
give rise to different models as shown below.
When exogenous variables are used, they are added in the form of
to the right hand side of the equations, where are the exogenous variables.
Conditional mean duration specifications according to the
model
argument:
ACD(p, q) specification: (Engle and Russell, 1998)
The element order of the startPara
vector is .
LACD1(p, q): (Bauwens and Giot, 2000)
The element order of the startPara
vector is .
LACD2(p, q): (Lunde, 1999)
The element order of the startPara
vector is .
AMACD(p, r, q) (Additive and Multiplicative ACD): (Hautsch , 2012)
The element order of the startPara
vector is .
ABACD(p, q) (Augmented Box-Cox ACD): (Hautsch, 2012)
The element order of the startPara
vector is .
BACD(p, q) (Box-Cox ACD): (Hautsch, 2003)
The element order of the startPara
vector is .
SNIACD(p, q, M) (Spline News Impact ACD): (Hautsch, 2012, with a slight difference)
where is an indicator function and
.
The element order of the startPara
vector is (The number of
-parameters are
).
The distribution of the error term specifications according to the
dist
argument:
Exponential distribution, dist = "exponential"
:
Weibull distribution, dist = "weibull"
:
where if
forceErrExpec = TRUE
.
Burr distribution, dist = "burr"
:
where,
if forceErrExpec = TRUE
.
The element order of the startPara
vector is .
Generalized Gamma distribution, dist = "gengamma"
:
where if
forceErrExpec = TRUE
.
The element order of the startPara
vector is .
Generalized F distribution, dist = "genf"
:
where , and if
forceErrExpec = TRUE
,
The element order of the startPara
vector is .
q-Weibull distribution, dist = "qweibull"
:
where if forceErrExpec = TRUE
,
The element order of the startPara
vector is .
Value
a list of class "acdFit"
with the following slots:
durations |
the durations object used to fit the model. |
muHats |
a vector of the estimated conditional mean durations |
residuals |
the residuals from the fitted model, calculated as durations/mu |
model |
the model for the conditional mean durations |
order |
the order of the model |
distribution |
the assumed error term distribution |
distCode |
the internal code used to represent the distribution |
mPara |
a vector of the estimated conditional mean duration parameters |
dPara |
a vector of the estimated error distribution parameters |
Npar |
total number of parameters |
goodnessOfFit |
a data.frame with the log likelihood, AIC, BIC, and MSE calculated as the mean squared deviation of the durations and the estimated conditional durations. |
parameterInference |
a data.frame with the estimated coefficients and their standard errors and p-values |
forcedDistPara |
the value of the unfree distribution parameter. If |
comments |
|
hessian |
the numerical hessian of the log likelihood evaluated at the estimate |
N |
number of observations |
evals |
number of log-likelihood evaluations needed for the maximization algorithm |
convergence |
if the maximization algorithm converged, this value is zero. (see the help file optim, nlminb or solnp) |
estimationTime |
time required for estimation |
description |
who fitted the model and when |
robustCorr |
only available for QML estimation (choosing the exponential distribution) for the standard ACD(p, q) model. The robust correlation matrix of the parameter estimates. |
Author(s)
Markus Belfrage
References
Bauwens, L., and P. Giot (2000) The logarithmic ACD model: an application to the bid-ask quote process of three NYSE stocks. Annales d'Economie et de Statistique, 60, 117-149.
Engle R.F, Russell J.R. (1998) Autoregressive Conditional Duration: A New Model for Irregularly Spaced Transaction Data, Econometrica, 66(5): 1127-1162.
Grammig, J., and Maurer, K.-O. (2000) Non-monotonic hazard functions and the autoregressive conditional duration model. Econometrics Journal 3: 16-38.
Hautsch, N. (2003) Assessing the Risk of Liquidity Suppliers on the Basis of Excess Demand Intensities. Journal of Financial Econometrics (2003) 1 (2): 189-215
Hautsch, N. (2012) Econometrics of Financial High-Frequency Data. Berlin, Heidelberg: Springer.
Lunde, A. (1999): A generalized gamma autoregressive conditional duration model, Working paper, Aalborg University.
Examples
fitModel <- acdFit(durations = adjDurData, model = "ACD",
dist = "exponential", order = c(1,1), dailyRestart = 1)