fpm-methods: function: Univariate GARCH and ARFIMA Forecast Performance...

Description Usage Arguments Details Value Methods Examples

Description

A method for generating forecast performance measures from a forecasted object of class uGARCHforecast or ARFIMAforecast subject to either out of sample data being available from the fitted routine or user provided realized data.

Usage

1
fpm(object, ...)

Arguments

object

A uGARCHforecast or ARFIMAforecast object

...

Additional arguments include realized which may me a matrix (or vector) two (one) named columns, with the names being “series” and “sigma” (not for ARFIMA case) indicating the realized data which will be used for the loss functions. These must be at least as long as the rolling forecast horizon. Additionally and required if the realized is used, the realized.type option indicates the type of realized data provided and is either “both”, “sigma” or “series” (for ARFIMA this is not applicable since only series is available).

Details

The method is only valid for objects which have been previously called with the out.sample option in the fitting routine with a minimum of 10 out of sample point available. The realized option, while still requiring the out.sample to have been used, will allow either a matrix with both the realized sigma and data or a vector with either to be provided for the calculation of the loss measures. The realized.type indicates what realized data is provided, and in the case of “both” and a matrix, unless the matrix columns are named (with valid names being “sigma” and “series”, the function will assume that sigma is the first column and the series is the second one.

Value

A uGARCHfpm or codeARFIMAfpm object containing details of the forecast performance measures for which extractor and show methods exist (see class for details).

Methods

object = "ANY"

Generic method for expansion to other classes

object = "uGARCHforecast"

The method currently supports this class.

object = "ARFIMAforecast"

The method currently supports this class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## Not run: 
data(dmbp)
spec = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1,1)), 
		mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = "std")
fit = ugarchfit(data = dmbp[,1], out.sample = 50, spec = spec)
pred = ugarchforecast(fit, n.ahead = 50)
pred.fpm = fpm(pred)
# show method
pred.fpm
# extract meanloss
as.data.frame(pred.fpm, which = "sigma", type = "meanloss")
# extract the actual loss series
as.data.frame(pred.fpm, which = "sigma", type = "loss", rollframe = 0)

# an example with rolling:
pred = ugarchforecast(fit, n.ahead = 50, n.roll = 2)
pred.fpm = fpm(pred)
# show method
pred.fpm
# extract meanloss
as.data.frame(pred.fpm, which = "sigma", type = "meanloss")
# extract the actual loss series (notice the NA's at the end since
# we are calculating on 50 + 2 (roll) points using only 50 out.sample data points (for realized)
as.data.frame(pred.fpm, which = "sigma", type = "loss", rollframe = 2)

# an example with fictional realized:
pred = ugarchforecast(fit, n.ahead = 50, n.roll = 1)
pred.fpm = fpm(pred, realized = rep(-0.01, 52), realized.type = "series")
# show method
pred.fpm
# extract meanloss
as.data.frame(pred.fpm, which = "sigma", type = "meanloss")
# extract the actual loss series (notice the NA's at the end since
# we are calculating on 50 + 2 (roll) points using only 50 out.sample data points (for realized)
as.data.frame(pred.fpm, which = "series", type = "loss", rollframe = 1)

## End(Not run)

rgarch documentation built on May 2, 2019, 5:22 p.m.