ForwardDates-methods {rugarch} | R Documentation |
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.
ForwardDates(Dates, n.ahead, date.format, periodicity = "days")
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. |
A POSIXct vector of future dates.
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.
Alexios Ghalanos
## 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)