A function to subset the n-best forecasts; assumes column named observed.

NBest(forecasts, n.max, window = NA)

Arguments

forecasts

data.frame: a data frame of forecasts to combine, assumes one column named "observed"

n.max

int: maximum number of forecasts to select

window

int: size of rolling window to evaluate forecast error over, use entire period if NA

Value

data.frame with n columns of the historically best forecasts