Type: | Package |
Title: | Robust Garch(1,1) Model |
Version: | 0.4.2 |
Description: | A method for modeling robust generalized autoregressive conditional heteroskedasticity (Garch) (1,1) processes, providing robustness toward additive outliers instead of innovation outliers. This work is based on the methodology described by Muler and Yohai (2008) <doi:10.1016/j.jspi.2007.11.003>. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
URL: | https://github.com/EchoRLiu/robustGarch |
BugReports: | https://github.com/EchoRLiu/robustGarch/issues |
RoxygenNote: | 7.3.2 |
Suggests: | rmarkdown, testthat, PCRA |
Imports: | Rsolnp, nloptr, rugarch, zoo, xts |
Depends: | R (≥ 4.3.0) |
NeedsCompilation: | no |
Packaged: | 2025-04-27 18:12:42 UTC; yuhongliu |
Author: | Echo Liu [aut, cre], Daniel Xia [aut], R. Douglas Martin [aut] |
Maintainer: | Echo Liu <yuhong.echo.liu@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-04-28 18:50:02 UTC |
Robust GARCH Package
Description
Robust GARCH modeling functions.
Author(s)
Maintainer: Echo Liu yuhong.echo.liu@gmail.com
Authors:
Daniel Xia dxia94@gmail.com
R. Douglas Martin dougPCRA@gmail.com
See Also
Useful links:
Report bugs at https://github.com/EchoRLiu/robustGarch/issues
Robust GARCH(1,1) Model Estimation
Description
Computes "BM" robust Garch(1,1) model parameter estimate by using a bounded objective function and a bounded conditional variance recursion. Alternatively, it computes: (1) "M" estimates by using only the bounded objective function, (2) "QML" estimates based on a typically incorrect assumption of normally distributed innovations, (3) "t-MLE" estimates based on an assumption of an innovations t-distributed MLE with unknown location, scale,and degrees of freedom parameters. CHECK IF (3) IS CORRECT.
Usage
robGarch(
data,
fitMethod = c("BM", "M", "QML", "MLE"),
robTunePars = c(0.8, 3),
optChoice = c("Rsolnp", "nloptr", "nlminb"),
initialPars = c(5e-04, 0.15, 0.75),
SEmethod = c("numDeriv", "optim", "sandwich"),
optControl = list(trace = 0)
)
Arguments
data |
an xts object |
fitMethod |
character valued name of fitting method, one of "BM", "M" "QML" or "tMLE", with "BM" the default value. |
robTunePars |
a numeric vector c(cM,cFlt) that controls the extent of fitMethod robustness, with default c(0.8,3.0). |
optChoice |
character valued optChoice name, one of "Rsolnp", "nloptr", "nlminb", with default "Rsolnp". |
initialPars |
numeric user-defined initial parameters c(gamma0, alpha0, beta0) for use by optChoice, with default values c(0.0005, 0.15, 0.75). |
SEmethod |
character valued name of standard error method, one of "numDeriv", "optim", "sandwich", with default "numDeriv". |
optControl |
list of arguments passed to optChoice, with
default |
Details
The "BM" fit method delivers the highest robustness by using a half-Huber psi function to bound the normal distribution log-likelihood, and using a Huber psi function to prevent the propagation of influential outliers in the variance recursion. The "M" method is obtained by dropping the BM bounding of the variance recursion, and is therefore less robust toward outliers.
ECHO OR DAN, PLEASE PROVIDE DETAILS FOR optControl.
For details of the list of control arguments, please refer to
nloptr::nloptr
, Rsolnp::solnp
, nlminb
.
The SEmethod default "numDeriv" is based on the Hessian from the
optimization.
Value
A list object of class “robustGarch” with components:
data |
the input xts object |
fitMethod |
the the fitMethod specified |
robtunePars |
the robtunePars specified |
initialPars |
the initialPars specified |
optChoice |
the optChoice specified |
coefEstimates |
computed parameter estimates |
sigma |
conditional standard deviation xts class time series |
SEmethod |
the specidied of calculating standard errors |
observedInfoMat |
observed information matrix |
optDetails |
a list containing the optChoice specified, the control values specified, and the optChoice minimized objective, and convergence status message |
References
Muler, N. and Yohai, V. (2008). Robust estimates for GARCH models. Journal of Statistical Planning and Inference, 138, 2918-2940.
Examples
if (requireNamespace("PCRA", quietly = TRUE)) {
ret <- PCRA::retOFG
ret <- ret$RET
(robFitBM <- robGarch(ret, fitMethod = "BM"))
sum(robFitBM$fitted_pars[2:3])
summary(robFitBM)
}
Summary for robustGARCH class
Description
Summarizes the results of a robust GARCH(1,1) model fit by extracting key model components.
Usage
## S3 method for class 'robustGARCH'
summary(object, digits = 3, ...)
## S3 method for class 'robustGARCH'
print(x, digits = 3, ...)
## S3 method for class 'robustGARCH'
plot(
x,
digits = 3,
estimation_pos = "topleft",
line_name_pos = "topright",
par_ = par(no.readonly = TRUE),
pctReturn_ = TRUE,
abs_ = TRUE,
original_ = FALSE,
main_name = "Conditional Volatility (vs |pctReturns(%)|)",
...
)
## S3 method for class 'robustGARCH'
coef(object, ...)
aef(fit, nu = 5)
Arguments
object |
Same as fit, for summary.robustGARCH |
digits |
the number of digits for print and plot, default is 3. |
... |
# to be written |
x |
Same as fit, for plot.robustGARCH and print.robustGARCH |
estimation_pos |
string that determines the legend position that specifies gamma, alpha, beta estimations. Choice of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". Default is "topleft". |
line_name_pos |
string that determines the legend position that specifies the names of lines in the plot. Choice of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". Default is "topright". |
par_ |
graphical parameters that can be set, which is in the form of par(...). The default is par(no.readonly = TRUE). |
pctReturn_ |
a logical argument. IF TRUE, the plot function will plot the returns in percentage instead of original. Default is TRUE. |
abs_ |
a logical argument, when TRUE, the plot function will plot abs(returns) with conditional standard deviation instead of returns, default to TRUE. |
original_ |
a logical argument. If TRUE, the original return will be plotted. Default is FALSE |
main_name |
the title of the plot, default is "Conditional SD (vs returns)" |
fit |
A robustGARCH fit object of class |
nu |
degrees of freedom in a Student's t-distribution. |
Value
A list of class "summary.robustGARCH"
containing:
method |
The fitting method used (e.g., "BM", "M", "QML", or "MLE"). |
coefficients |
Named vector of parameter estimates. |
loglikelihood |
The value of the objective function at convergence. |
converged |
Logical; indicates whether the optimizer converged successfully. |
Examples
if (requireNamespace("PCRA", quietly = TRUE)) {
library(robustGarch)
ret <- PCRA::retOFG
ret <- ret$RET
(robFitBM <- robGarch(ret, fitMethod = "BM"))
sum(robFitBM$fitted_pars[2:3])
summary(robFitBM)
print(robFitBM)
plot(robFitBM)
coef(robFitBM)
} else {
message("Run install.packages('PCRA') to run this example.")
}