Description Usage Arguments Details Value Author(s) Examples
Estimation of ACD models.
1 2 3 |
data |
A univariate xts data object (or one which can be coerced to such). |
spec |
A univariate ACD spec object of class |
out.sample |
A positive integer indicating the number of periods before the last to keep for out of sample forecasting (see details). |
solver |
One of either “nlminb”, “solnp”, “optim”, “ucminf” or “cmaes” or their multistart equivalents (see details). |
solver.control |
Control arguments list passed to optimizer. |
fit.control |
Control arguments passed to the fitting routine. Stationarity explicitly imposes
the variance stationarity constraint during optimization. The fixed.se argument
controls whether standard errors should be calculated for those parameters which
were fixed (through the fixed.pars argument of the |
skew0 |
Optional recursion starting parameter for the skew dynamics. If not used, a restricted GARCH model is first estimated in order to obtain this. |
shape0 |
Optional recursion starting parameter for the shape dynamics. If not used, a restricted GARCH model is first estimated in order to obtain this. |
cluster |
A pre-created cluster from the parallel package for use with the multistart solvers. |
... |
In the case of the mcsGARCH model, a ‘DailyVar’ xts object needs to be passed of the forecast daily variance for the period under consideration. |
For the optim and ucminf solvers (unconstrained optimization), the parameters
are transformed from the unbounded to the bounded domain (upper and lower bounds)
using a logistic transformation. This approach seems to provide better results for
most cases and enough data. For the optim solvers, the default used is “BFGS”,
but you can choose another option by passing the ‘method’ in solver.control
options in addition to any other solver specific options. It is suggested that
the n.sim option is set high enough to allow for a good set of starting parameters
to be generated, where the Rsolnp package's ‘startpars’ function is used
for this purpose. A sure indication that the solver has converged to only a local
solution is a warning about failure to invert the hessian or that the likelihood
is lower than that of the restricted GARCH model. In that case, try with a
different solver, higher n.sim etc. A visual inspection of the skewness
and kurtosis plots may also reveal problems. Setting tighter or wider bounds on
either the complete skew/shape dynamics or the individual parameters driving those
is also an option using the setbounds<-
method on the specification.
The 4 main solvers have multistart versions (preceded by the letters “ms”, e.g.
“msoptim”) which take an extra parameter in the solver.control list of
‘restarts’ denoting the number of independent optimizations to perform from
different starting parameters. When used with a cluster based object this leads
to a parallel evaluation of different starting parameters and a much better
chance of obtaining a good solution. The “cmaes” solver has a very large
and specific set of options which the user can consult.
A ACDfit
object containing details of the ACD fit.
Alexios Ghalanos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
data(sp500ret)
spec = acdspec(variance.model=list(variance.targeting = TRUE),
mean.model=list(armaOrder=c(1,1)),distribution.model=list(model = "jsu",
skewOrder=c(1,1,0), shapeOrder=c(1,1,0)))
fit = acdfit(spec, sp500ret, solver="msoptim",solver.control=list(restarts=5))
convergence(fit)
head(residuals(fit))
head(fitted(fit))
head(sigma(fit))
head(skewness(fit))
head(kurtosis(fit))
head(quantile(fit, probs=c(0.01, 0.05)))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.