predict-methods | R Documentation |
Predicts a time series from a fitted GARCH object.
## S4 method for signature 'fGARCH'
predict(object, n.ahead = 10, trace = FALSE, mse = c("cond","uncond"),
plot=FALSE, nx=NULL, crit_val=NULL, conf=NULL, ...)
n.ahead |
an integer value, denoting the number of steps to be forecasted, by default 10. |
object |
an object of class |
trace |
a logical flag. Should the prediction process be traced?
By default |
mse |
If set to |
plot |
If set to |
nx |
The number of observations to be plotted along with the
predictions. The default is |
crit_val |
The critical values for the confidence intervals when
|
conf |
The confidence level for the confidence intervals if
|
... |
additional arguments to be passed. |
The predictions are returned as a data frame with with columns
"meanForecast"
, "meanError"
, and
"standardDeviation"
. Row h
contains the predictions for
horizon h
.
The number of records equals the number of forecasting steps n.ahead
.
a data frame containing 3 columns and n.ahead
rows, see section ‘Details’
Diethelm Wuertz for the Rmetrics R-port
predict
in base R
fitted
,
residuals
,
plot
,
garchFit
,
class fGARCH
,
## garchFit -
# Parameter Estimation of Default GARCH(1,1) Model:
set.seed(123)
fit = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE)
fit
## predict -
predict(fit, n.ahead = 10)
predict(fit, n.ahead = 10, mse="uncond")
## predict with plotting: critical values = +/- 2
predict(fit, n.ahead = 10, plot=TRUE, crit_val = 2)
## predict with plotting: automatic critical values
## for different conditional distributions
set.seed(321)
fit2 = garchFit(~ garch(1, 1), data = garchSim(), trace=FALSE, cond.dist="sged")
## 95% confidence level
predict(fit2, n.ahead=20, plot=TRUE)
set.seed(444)
fit3 = garchFit(~ garch(1, 1), data = garchSim(), trace=FALSE, cond.dist="QMLE")
## 90% confidence level and nx=100 :
predict(fit3, n.ahead=20, plot=TRUE, conf=.9, nx=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.