ForwardDates-methods {rugarch}R Documentation

function: Generate Future Dates

Description

Given a starting date, this helper function generates a set of future dates (excl.weekends) for use in forecasting and simulation when using external regressors.

Usage

ForwardDates(Dates, n.ahead, date.format, periodicity = "days")

Arguments

Dates

A character vector of dates. The last date is used as the starting date for the forward date creation.

n.ahead

The number of dates to generate forward.

date.format

The format of the dates e.g. “%Y-%m-%d"” .

periodicity

Currently only days is supported.

Value

A POSIXct vector of future dates.

Note

This is a helper function particularly useful when used with the weekday dummy variable for simulation and forecasting in light of weekday dummy external regressors in the mean or variance equation. For example, if fitting a GARCH model with a "Monday" dummy variable in the mean equation, then for simulation or forecasting, one needs a set of forward deterministic dummy variables for the Mondays going forward.

Author(s)

Alexios Ghalanos

Examples

## Not run: 
data(sp500ret)
Dates = rownames(sp500ret)
# generate the 100 forward non-weekend days
fwd100 = ForwardDates(Dates, n.ahead=100, date.format = "%Y-%m-%d", 
periodicity = "days")
# create a dummy vector for those forward days which are Mondays
fwdMonday = WeekDayDummy(as.character(fwd100), date.format = "%Y-%m-%d", 
weekday = "Monday")

## End(Not run)

[Package rugarch version 1.0-10 Index]