#### This question refers to the data set that you are using for your project. For your data set determine the best forecasting method (average, naÃ¯ve, seasonal naÃ¯ve, exponential smoothing, Holt-Wintersâ€™ method, ETS, ARIMA). ). Use 80% of the data for training and 20% of the data for testing. Using the best model, forecast your data set for 6 periods into the future.

##### Load Data and Library Packages

##### Define as time-series and name varaible

```
indigo_data = ts(indigo_data, start=2002, frequency=4)
data = indigo_data[,3]
```

##### Set training data, test data, out of sample

```
train <- window(data,start=c(2002, 1),end=c(2014, 2))
test <- window(data, start=c(2014,2),end=c(2017, 3))
both <- window(data,start=c(2002, 1))
h=length(test)
```

##### Forecast using Average, NaÃ¯ve, and Seasonal NaÃ¯ve Method

```
Indigofit1 <- meanf(train, h=h)
Indigofit2 <- naive(train, h=h)
Indigofit3 <- snaive(train, h=h)
```

##### Plot forecasts for Average, NaÃ¯ve, and Seasonal NaÃ¯ve Method

```
plot(Indigofit1, PI=FALSE,
main="Forecasts for quarterly Indigo sales")
lines(Indigofit2$mean,col=2)
lines(Indigofit3$mean,col=3)
legend("topleft",lty=1,col=c(4,2,3),
legend=c("Mean method","Naive method","Seasonal naive method"),bty="n")
```

##### Forecast using Simple Exonential moving averages

```
Indigofit4 <- ses(train, h = h)
plot(Indigofit4)
```