forecast_naive2: NAIVE2 Forecasts

Description Usage Arguments Value Examples

View source: R/forecast_naive2.R

Description

Used to return the point forecasts using the Naive2 method. Code modified from the M4 Competition's original code.

Usage

1
forecast_naive2(ts.data, ts.frequency, forecast.horizon, alpha.level = 0.05)

Arguments

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.

Value

A ts object of forecasted values obtained using the Naive2 method.

Examples

 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
)

gu-stat/gears documentation built on Oct. 20, 2021, 2:53 a.m.