Description Usage Arguments Details Value Author(s) See Also Examples
Method for fitting a variety of univariate GARCH models.
1 2 |
data |
A univariate data object. Can be a numeric vector, matrix, data.frame, zoo, xts, timeSeries, ts or irts object. |
spec |
A univariate GARCH 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” or “gosolnp”. |
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
|
... |
. |
The GARCH optimization routine first calculates a set of feasible starting points
which are used to initiate the GARCH recursion. The main part of the likelihood
calculation is performed in C-code for speed.
The out.sample option is provided in order to carry out forecast performance testing
against actual data. A minimum of 5 data points are required for these tests.
If the out.sample option is positive, then the routine will fit only N - out.sample
(where N is the total data length) data points, leaving out.sample points for
forecasting and testing using the forecast performance measure fpm
.
In the ugarchforecast
routine the n.ahead may also be greater than
the out.sample number resulting in a combination of out of sample data points
matched against actual data and some without, which the forecast performance
tests will ignore.
The “gosolnp” solver allows for the initialization of multiple restarts of the
solnp solver with randomly generated parameters (see documentation in the Rsolnp-package for
details of the strategy used). The solver.control list then accepts the following additional
(to the solnp) arguments: “n.restarts” is the number of solver restarts required
(defaults to 1), “parallel” and “parallel.control” for use of the parallel functionality,
“rseed” is the seed to initialize the random number generator,
and “n.sim” is the number of simulated parameter vectors to generate per n.restarts.
A uGARCHfit
object containing details of the GARCH fit.
Alexios Ghalanos
For specification ugarchspec
,filtering ugarchfilter
,
forecasting ugarchforecast
, simulation ugarchsim
, rolling forecast
and estimation ugarchroll
, parameter distribution and uncertainty
ugarchdistribution
, bootstrap forecast ugarchboot
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Basic GARCH(1,1) Spec
data(dmbp)
spec = ugarchspec()
fit = ugarchfit(data = dmbp[,1], spec = spec)
fit
coef(fit)
head(as.data.frame(fit))
#plot(fit,which="all")
# in order to use fpm (forecast performance measure function)
# you need to select a subsample of the data:
spec = ugarchspec()
fit = ugarchfit(data = dmbp[,1], spec = spec, out.sample=100)
forc = ugarchforecast(fit, n.ahead=100)
# this means that 100 data points are left from the end with which to
# make inference on the forecasts
fpm(forc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.