View source: R/garch-FitFromFormula.R
garchFit | R Documentation |
Estimates the parameters of a univariate ARMA-GARCH/APARCH process, or
— experimentally — of a multivariate GO-GARCH process model. The
latter uses an algorithm based on fastICA()
, inspired from
Bernhard Pfaff's package gogarch.
garchFit(formula = ~ garch(1, 1), data,
init.rec = c("mci", "uev"),
delta = 2, skew = 1, shape = 4,
cond.dist = c("norm", "snorm", "ged", "sged",
"std", "sstd", "snig", "QMLE"),
include.mean = TRUE, include.delta = NULL, include.skew = NULL,
include.shape = NULL,
leverage = NULL, trace = TRUE,
algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"),
hessian = c("ropt", "rcd"),
control = list(),
title = NULL, description = NULL, ...)
garchKappa(cond.dist = c("norm", "ged", "std", "snorm", "sged", "sstd", "snig"),
gamma = 0, delta = 2, skew = NA, shape = NA)
.gogarchFit(formula = ~garch(1, 1), data, init.rec = c("mci", "uev"),
delta = 2, skew = 1, shape = 4,
cond.dist = c("norm", "snorm", "ged", "sged",
"std", "sstd", "snig", "QMLE"),
include.mean = TRUE, include.delta = NULL, include.skew = NULL,
include.shape = NULL,
leverage = NULL, trace = TRUE,
algorithm = c("nlminb", "lbfgsb", "nlminb+nm", "lbfgsb+nm"),
hessian = c("ropt", "rcd"),
control = list(),
title = NULL, description = NULL, ...)
algorithm |
a string parameter that determines the algorithm used for maximum likelihood estimation. |
cond.dist |
a character string naming the desired conditional distribution.
Valid values are |
control |
control parameters, the same as used for the functions from
|
data |
an optional timeSeries or data frame object containing the variables
in the model. If not found in |
delta |
a numeric value, the exponent |
description |
optional character string with a brief description. |
formula |
|
gamma |
APARCH leverage parameter entering into the formula for calculating the expectation value. |
hessian |
a string denoting how the Hessian matrix should be evaluated,
either |
include.delta |
a |
include.mean |
this flag determines if the parameter for the mean will be estimated
or not. If |
include.shape |
a logical flag which determines if the parameter for the shape
of the conditional distribution will be estimated or not. If
|
include.skew |
a logical flag which determines if the parameter for the skewness
of the conditional distribution will be estimated or not. If
|
init.rec |
a character string indicating the method how to initialize the mean and varaince recursion relation. |
leverage |
a logical flag for APARCH models. Should the model be leveraged?
By default |
shape |
a numeric value, the shape parameter of the conditional distribution. |
skew |
a numeric value, the skewness parameter of the conditional distribution. |
title |
a character string which allows for a project title. |
trace |
a logical flag. Should the optimization process of fitting the
model parameters be printed? By default |
... |
additional arguments to be passed. |
"QMLE"
stands for Quasi-Maximum Likelihood Estimation, which
assumes normal distribution and uses robust standard errors for
inference. Bollerslev and Wooldridge (1992) proved that if the mean
and the volatility equations are correctly specified, the QML
estimates are consistent and asymptotically normally
distributed. However, the estimates are not efficient and “the
efficiency loss can be marked under asymmetric ... distributions”
(Bollerslev and Wooldridge (1992), p. 166). The robust
variance-covariance matrix of the estimates equals the (Eicker-White)
sandwich estimator, i.e.
V = H^{-1} G^{\prime} G H^{-1},
where V
denotes the variance-covariance matrix, H
stands for the Hessian and G
represents the matrix of
contributions to the gradient, the elements of which are defined as
G_{t,i} = \frac{\partial l_{t}}{\partial \zeta_{i}},
where t_{t}
is the log likelihood of the t-th observation
and \zeta_{i}
is the i-th estimated parameter. See
sections 10.3 and 10.4 in Davidson and MacKinnon (2004) for a more
detailed description of the robust variance-covariance matrix.
for garchFit
, an S4 object of class "fGARCH"
.
Slot @fit
contains the results from the optimization.
for .gogarchFit()
: Similar definition for GO-GARCH modeling.
Here, data
must be multivariate. Still
“preliminary”, mostly undocumented, and untested(!). At least
mentioned here...
Diethelm Wuertz for the Rmetrics R-port,
R Core Team for the 'optim' R-port,
Douglas Bates and Deepayan Sarkar for the 'nlminb' R-port,
Bell-Labs for the underlying PORT Library,
Ladislav Luksan for the underlying Fortran SQP Routine,
Zhu, Byrd, Lu-Chen and Nocedal for the underlying L-BFGS-B Routine.
Martin Maechler for cleaning up; mentioning
.gogarchFit()
.
ATT (1984); PORT Library Documentation, http://netlib.bell-labs.com/netlib/port/.
Bera A.K., Higgins M.L. (1993); ARCH Models: Properties, Estimation and Testing, J. Economic Surveys 7, 305–362.
Bollerslev T. (1986); Generalized Autoregressive Conditional Heteroscedasticity, Journal of Econometrics 31, 307–327.
Bollerslev T., Wooldridge J.M. (1992); Quasi-Maximum Likelihood Estimation and Inference in Dynamic Models with Time-Varying Covariance, Econometric Reviews 11, 143–172.
Byrd R.H., Lu P., Nocedal J., Zhu C. (1995); A Limited Memory Algorithm for Bound Constrained Optimization, SIAM Journal of Scientific Computing 16, 1190–1208.
Davidson R., MacKinnon J.G. (2004); Econometric Theory and Methods, Oxford University Press, New York.
Engle R.F. (1982); Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation, Econometrica 50, 987–1008.
Nash J.C. (1990); Compact Numerical Methods for Computers, Linear Algebra and Function Minimisation, Adam Hilger.
Nelder J.A., Mead R. (1965); A Simplex Algorithm for Function Minimization, Computer Journal 7, 308–313.
Nocedal J., Wright S.J. (1999); Numerical Optimization, Springer, New York.
garchSpec
,
garchFitControl
,
class "fGARCH"
## UNIVARIATE TIME SERIES INPUT:
# In the univariate case the lhs formula has not to be specified ...
# A numeric Vector from default GARCH(1,1) - fix the seed:
N = 200
x.vec = as.vector(garchSim(garchSpec(rseed = 1985), n = N)[,1])
garchFit(~ garch(1,1), data = x.vec, trace = FALSE)
# An univariate timeSeries object with dummy dates:
stopifnot(require("timeSeries"))
x.timeSeries = dummyDailySeries(matrix(x.vec), units = "GARCH11")
garchFit(~ garch(1,1), data = x.timeSeries, trace = FALSE)
## Not run:
# An univariate zoo object:
require("zoo")
x.zoo = zoo(as.vector(x.vec), order.by = as.Date(rownames(x.timeSeries)))
garchFit(~ garch(1,1), data = x.zoo, trace = FALSE)
## End(Not run)
# An univariate "ts" object:
x.ts = as.ts(x.vec)
garchFit(~ garch(1,1), data = x.ts, trace = FALSE)
## MULTIVARIATE TIME SERIES INPUT:
# For multivariate data inputs the lhs formula must be specified ...
# A numeric matrix binded with dummy random normal variates:
X.mat = cbind(GARCH11 = x.vec, R = rnorm(N))
garchFit(GARCH11 ~ garch(1,1), data = X.mat)
# A multivariate timeSeries object with dummy dates:
X.timeSeries = dummyDailySeries(X.mat, units = c("GARCH11", "R"))
garchFit(GARCH11 ~ garch(1,1), data = X.timeSeries)
## Not run:
# A multivariate zoo object:
X.zoo = zoo(X.mat, order.by = as.Date(rownames(x.timeSeries)))
garchFit(GARCH11 ~ garch(1,1), data = X.zoo)
## End(Not run)
# A multivariate "mts" object:
X.mts = as.ts(X.mat)
garchFit(GARCH11 ~ garch(1,1), data = X.mts)
## MODELING THE PERCENTUAL SPI/SBI SPREAD FROM LPP BENCHMARK:
stopifnot(require("timeSeries"))
X.timeSeries = as.timeSeries(data(LPP2005REC))
X.mat = as.matrix(X.timeSeries)
## Not run: X.zoo = zoo(X.mat, order.by = as.Date(rownames(X.mat)))
X.mts = ts(X.mat)
garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.timeSeries)
# The remaining are not yet supported ...
# garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mat)
# garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.zoo)
# garchFit(100*(SPI - SBI) ~ garch(1,1), data = X.mts)
## MODELING HIGH/LOW RETURN SPREADS FROM MSFT PRICE SERIES:
X.timeSeries = MSFT
garchFit(Open ~ garch(1,1), data = returns(X.timeSeries))
garchFit(100*(High-Low) ~ garch(1,1), data = returns(X.timeSeries))
## GO-GARCH Modelling (not yet!!) % FIXME
## data(DowJones30, package="fEcofin") # no longer exists
## X = returns(as.timeSeries(DowJones30)); head(X)
## N = 5; ans = .gogarchFit(data = X[, 1:N], trace = FALSE); ans
## ans@h.t
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.