Description Usage Arguments Value Author(s) See Also Examples
Predicts the value for items based on previous values. Previous values can be aggregated to value per day, week, month, quarter or year. An ARIMA model is estimated for each item based on the function forecast:auto.arima. The best model is selected and used for prediction. Note that only models without drift term will be considered in order to ensure consistent predictions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
data |
Data frame including previous values. |
value |
Name of the column representing the item value. |
item |
Name of the column representing the item ID or the item name. |
timestamp |
Name of the column including the timestamp. This column should be in POSIX or date-format. |
temporalAggregation |
Temporal aggregation mode (i.e., "day", "week", "month", "quarter", "year"). |
aggregationFun |
Function for aggregating the value column. Default is sum. |
timeUnitsAhead |
Integer indicating the number of time units (i.e., days, weeks, months, quarters or years) the should be predicted. |
digits |
Integer indicating the number of significant digits used for the predicted values. |
expand |
Logical indicating whether the data will be expanded after they are aggregated. Default is not (FALSE). |
keepPreviousData |
Logical indicating whether the data from the given data frame will be added to the result or not. Default is not (FALSE). |
level |
Numeric value representing the confidence level for the predictions. The default is 0.95 (i.e. lower level = 0.025 and upper level = 0.975). |
... |
Further arguments for function forecast::auto.arima. |
Returns a Forecast
object.
Leon Binder leon.binder@th-deg.de
Bernhard Bauer bernhard.bauer@th-deg.de
Michael Scholz michael.scholz@th-deg.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Simple Example
data("Amount")
prediction = predictValue(data = Amount,
value = "amount",
item = "item",
timestamp = "date",
temporalAggregation = "week",
timeUnitsAhead = 3)
prediction
# More Sophisticated Example
data("Amount")
prediction = predictValue(data = Amount,
value = "amount",
item = "item",
timestamp = "date",
temporalAggregation = "week",
aggregationFun = mean,
timeUnitsAhead = 5,
digits = 4,
keepPreviousData = TRUE,
level = 0.9,
trace = TRUE)
prediction
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.