# frbe: Fuzzy Rule-Based Ensemble (FRBE) of time-series forecasts In lfl: Linguistic Fuzzy Logic

## Description

This function computes the fuzzy rule-based ensemble of time-series forecasts. Several forecasting methods are used to predict future values of given time-series and a weighted sum is computed from them with weights being determined from a fuzzy rule base.

## Usage

 ```1 2``` ```frbe(d, h=10) ```

## Arguments

 `d` A source time-series in the ts time-series format. Note that the frequency of the time-series must to be set properly. `h` A forecasting horizon, i.e. the number of values to forecast.

## Details

This function computes the fuzzy rule-based ensemble of time-series forecasts. The evaluation comprises of the following steps:

1. Several features are extracted from the given time-series `d`:

• length of the time-series

• strength of trend

• strength of seasonality

• skewness

• kurtosis

• variation coefficient

• stationarity

• frequency

These features are used later to infer weights of the forecasting methods.

2. Several forecasting methods are applied on the given time-series `d` to obtain forecasts. Actually, the following methods are used:

• ARIMA - by calling `auto.arima` of the `forecast` package

• Exponential Smoothing - by calling `ets` of the `forecast` package

• Random Walk with Drift - by calling `rwf` of the `forecast` package

• Theta - by calling `thetaf` of the `forecast` package

3. Computed features are input to the fuzzy rule-based inference mechanism which yields into weights of the forecasting methods. The fuzzy rule base is hardwired in this package and it was obtained by performing data mining with the use of the `farules` function.

4. A weighted sum of forecasts is computed and returned as a result.

## Value

Result is a list of class `frbe` with the following elements:

• `features` - a data frame with computed features of the given time-series;

• `forecasts` - a data frame with forecasts to be ensembled;

• `weights` - weights of the forecasting methods as inferred from the features and the hard-wired fuzzy rule base;

• `mean` - the resulting ensembled forecast (computed as a weighted sum of forecasts).

Michal Burda

## References

<c5><a0>t<c4><9b>pni<c4><8d>ka, M., Burda, M., <c5><a0>t<c4><9b>pni<c4><8d>kov<c3><a1>, L. Fuzzy Rule Base Ensemble Generated from Data by Linguistic Associations Mining. FUZZY SET SYST. 2015.

`evalfrbe`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ``` # prepare data (from the forecast package) library(forecast) horizon <- 10 train <- wineind[-1 * (length(wineind)-horizon+1):length(wineind)] test <- wineind[(length(wineind)-horizon+1):length(wineind)] # perform FRBE f <- frbe(ts(train, frequency=frequency(wineind)), h=horizon) # evaluate FRBE forecasts evalfrbe(f, test) # display forecast results f\$mean ```