locreg_ts fits a locally weighted regression using locfit. It first searches over a parameter space of nearest neighbors bandwidth, and polynomial degree, and then uses the best solution

locreg_ts(timeseries, num_ahead = 5, level = 95, nn = seq(from = 0.2,
  to = 3, by = 0.05), deg = 1:3)

Arguments

timeseries

the time series to forecast

num_ahead

the number of points at the end of the time series to forecast

level

Confidence level for prediction intervals.

nn

Nearest neighbor component of the smoothing parameter. Default value is 0.7, unless either h or adpen are provided, in which case the default is 0.

deg

Degree of polynomial to use.

Value

a data.frame of the mean forecasts, the observed values, and the lower and upper CI levels (if an error occurs, then just NA values)