Description Usage Arguments Value Examples
View source: R/forecast_naive2.R
Used to return the point forecasts using the Naive2 method. Code modified from the M4 Competition's original code.
1 | forecast_naive2(ts.data, ts.frequency, forecast.horizon, alpha.level = 0.05)
|
ts.data |
A numeric vector of time series observations (a ts object). |
ts.frequency |
The frequency of a ts object. |
forecast.horizon |
A numeric value with the length of the forecast lead. |
alpha.level |
A numeric value with the alpha level to be used in the test to detect seasonality. Default is 0.05. |
A ts object of forecasted values obtained using the Naive2 method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | forecast_naive2(
ts.data = datasets::WWWusage,
ts.frequency = stats::frequency(datasets::WWWusage),
forecast.horizon = 10,
alpha.level = 0.05
)
forecast_naive2(
ts.data = datasets::AirPassengers,
ts.frequency = stats::frequency(datasets::AirPassengers),
forecast.horizon = 15,
alpha.level = 0.05
)
forecast_naive2(
ts.data = datasets::EuStockMarkets[, "DAX"],
ts.frequency = stats::frequency(datasets::EuStockMarkets[, "DAX"]),
forecast.horizon = 40,
alpha.level = 0.05
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.