Daily sales data
Total sales of stores against time

Identifying change points for trend in the series.The single changepoint detected is in January 2015, where we can see that the next trend is bit downward side.

## [1] 748
Trying to check for multiple changing point with mean values.
The multiple change points can be seen in the plot.

Outliers
Box Plot for detecting outliers

The outliers according to the boxplot above are highlighted below.
One high value above 300 looks abnormal, but it lies in peak seasonal period, thus cannot be ruled out. Keepinng as it is.
.
Plotting all the outliers from the boxplot in the series.
Fitting the Prophet Model
Prophet is the time series forecasting model build by facebook in 2017, specially for the data with seasonality and trends.
The model is fitted on train data till date 2015-07-01 and forecast is done fo period of 120 days.
Model automatically disable daily seasonality as it detects there could be no daily seasonality present.

We try check if there is any difference by turning on the daily seasonality or not.
Ckeck by Turning on the daily seasonality
.

Not much of a difference here. Thus model correctly disabled the daily seasonality
Lets see our original series for comparison

CHECKING FOR COMPONENTS OF TIME SERIES
Plot shows the different components which includes, trend, weekly seasonality and yearly seasonality.

Checking changepoint with phophet model
Plot shows that two three equidistant change points. The model includes one change point found using boxplot.

COMPARING FORECAST
Comparing forecast with actual observed data. The model fits well but has greater variance at start.

Trying to forecast it for 250 days

.
The prophet is considering seasonality correctly, We dont need to take account for daily seasonality here. We can check for additive and multiplicative seasonality for considration.
Additive Seasonality
## Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

Plotting additive components.

Multiplicative seasonality
## Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

Multiplicative components

There is not much of difference between both.
Checking Holiday Impact
Leveraging the holiday list available in the prophet model,We could see below which holidays has greater Impact.
## .
Checking the amount of impact of two main holidays. New year and Christmas
## ds Christmas Day New Year's Day
## 1 2014-12-25 -18.6936 0.00000
## 2 2015-01-01 0.0000 -57.80842
Holiday Impact by each holiday in the US calender.
###### .
Checking model “Fit”
Checking In sample performance by Calculating the MSE,MAE and MAPE of the model.
The error values are not large, the fit is good. Generally, Prophet works good on daily data and with seasonality.
## [1] "RMSE: 10.91"
## [1] "MAE: 8.67"
## [1] "MAPE: 0.38"
Cross- Validation for the window of 30 days.
Cutt-off points for the cross validation
## [1] "2014-12-02 GMT" "2015-01-01 GMT" "2015-01-31 GMT" "2015-03-02 GMT"
## [5] "2015-04-01 GMT" "2015-05-01 GMT" "2015-05-31 GMT"
Plotting the comparison of cross validation and actual for different cut-off points.
