TSF - Problem Statement
TSF - Problem Statement
Context:
In today's dynamic business environment, precise sales and production forecasts are essential for strategic
planning and operational efficiency. Companies like IJK Shoe Company and RST Firm have accumulated
extensive monthly data on shoe sales and soft drink production, respectively, spanning from January 1980
to July 1995. Leveraging advanced time series forecasting techniques, these companies aim to utilize their
historical data to predict future trends accurately. This initiative enables them to make informed decisions,
optimize resource allocation, and adapt proactively to market dynamics.
Objective:
The primary objective is to predict future sales for IJK Shoe Company and production volumes for RST
Firm over the next one year. By analyzing the historical monthly data spanning from January 1980 to July
1995, our goal is to develop accurate forecasting models that capture the underlying patterns and
seasonality inherent in the sales and production processes. Through this task, we aim to empower IJK Shoe
Company and RST Firm with actionable insights that facilitate proactive planning, optimize resource
allocation, and enhance operational efficiency. By anticipating future trends in sales and production, both
companies can align their strategies, streamline production-related activities, and capitalize on emerging
opportunities in their respective markets.
Data Overview
Shoe Sales
Head:
YearMonth Shoe_Sales
0 1980-01 85
1 1980-02 89
2 1980-03 109
3 1980-04 95
4 1980-05 91
Tail:
Shoe_Sales
YearMonth
We are able to see that the Sales see an upward trend during the months of July till Oct, then
see a downward trend.
Soft Drinks
Head:
YearMonth SoftDrinkProduction
0 1980-01 1954
1 1980-02 2302
YearMonth SoftDrinkProduction
2 1980-03 3054
3 1980-04 2414
4 1980-05 2226
Tail :
SoftDrinkProduction
YearMonth
It may be noticed that there are variations with sales trend month on month with November,
December taking precedence owing to the fact that these are holiday season.
statistics summary:
year month
Shoe_Sales
Outliers are noted in the month of 1980, 1984, 88 through 91 and during the years of 93 &
94.
The sales saw a huge volume in the year of 1987.
There were fewer sales during 1984
We are also able to see that there has been an upward trend year on year.
The upward trend may be attributed to the branding & advertisement of the product.
As noted there is an upward trend of sales with each year
Month wise, we note that post July, there is an upward sales trend
This is due to onset of winter and Holiday Seasons.
Decomposition:
It is evident that sales increase after the month of July and there is an upward trend during the
last quarter of the year
Although there is not much variation each month
The sales have definitely improved during the years between 1985 till 1991.
Soft Drinks
Bivariate Analysis
The standard deviation of the year is at 4.51 and the sales is at 728.35
The first quartiel is at 2748 with 3rd quartile at 3741
The average sales is at 3262.60
We are able to see outlier in the month of April, May, June, August & November
The sales takes presedence during December, which may be due to the Holiday Season
The months February and July also see a considerable amount of sales as compared to other
months
The median sales each month also varies.
The outleirs are visible from the year of 1989 till 1995.
The maximum sales could be witnessed during the years of 1988
The median also varies each year with sales in the range of 2400 till 4200
The years 1980, 83 & 85 also witnessed a good amount of sales as compared to other years.
The sales do see an upward trend after July
Year on Year there has been an increase in the sales trend
The sales pattern however remains mostly same.
Decomposition:
From the plots above we can see the sales distributions over the years and months.
We can say that the production Exponentially increased every month, But more in the months
towards the end of the year.
Data Pre-processing
Shoe Sales
Train Test Split
The train datasets were prior to the year 1991 and test datasets are post the year 1991
The test dataset also has an upward trend with every year.
Soft Drinks
Train Test Split
The data was split into train and test data
The train datasets were prior to the year 1991 and test datasets are post the year 1991
With training datset, we are able to see that the maximum sales happened during 1989
With test data set the highest contribution came from years 1994 & 1995.
Triple Exp Smoothing Model: Level 0.57 ,Trend 0.0 ,Seasonality 0.29 128.992526
With Exponential Smoothening, the triple Exponential model is better with lower RMSE as
compared to other models
We tuned the model and applied alpha, beta and gamma to smooth the parameters
We are able to see that the tuned model works quiet well on training dataset and has a variable
prediction.
With tuned paremeters applied on test data, we are able to see that triple expnential smoothening
performs quiet well
Beta Gamma
Alpha Values
RMSE Values Values
Single Exp. Smoothing Model: Level 0.61 196.404837 NaN NaN NaN
Double Exp Smoothing Model: Level 0.59 ,Trend 0.0 288.576717 NaN NaN NaN
With RMSE being still at 128.99 for Triple Exponential Smoothening, this model has more accuracy
in predicting future trends
Soft Drinks
Linear Regression
The data was split into train and test data
The train datasets were prior to the year 1991 and test datasets are post the year 1991
The test dataset also has an upward trend with every year
With Linear Regression Model, there is upward trend year on year noted with RMSE being at
775.75.
Moving Average:
With Moving Average, we are able to see that there is not much variance with the test data
The average sales remains very similar and follows a straight line
This model exhibits a simple trend but predicts an downward trend on the test dataset
We are able to see that this model is much better and has an upward prediction trend and is
predicting
Triple Exp Smoothing Model: Level 0.15 ,Trend 0.04 ,Seasonality 0.26 458.965428
We tuned the model and applied alpha, beta and gamma to smooth the parameters
We are able to see that the tuned model works quiet well on training dataset and has a variable
prediction.
Single Exp. Smoothing Model: Level 0.16 819.401213 NaN NaN NaN
Soft Drinks
Results of Dickey-Fuller Test:
Test Statistic -1.717397
p-value 0.422172
#Lags Used 13.000000
Number of Observations Used 173.000000
Critical Value (1%) -3.468726
Critical Value (5%) -2.878396
Critical Value (10%) -2.575756
dtype: float64
We see that at 5% significant level the Time Series is non stationary as p value
= 0.42 is greater than alpha = 0.05.
We use differencing approach to make the series stationary.
Results of Dickey-Fuller Test:
Test Statistic -3.144211
p-value 0.023450
#Lags Used 13.000000
Number of Observations Used 117.000000
Critical Value (1%) -3.487517
Critical Value (5%) -2.886578
Critical Value (10%) -2.580124
dtype: float64
Manual ARIMA:
Auto SARIMA
Manual SARIMA
Soft Drinks:
Auto ARIMA
Some parameter combinations for the Model...
Model: (0, 0, 1)
Model: (0, 0, 2)
Model: (1, 0, 0)
Model: (1, 0, 1)
Model: (1, 0, 2)
Model: (2, 0, 0)
Model: (2, 0, 1)
Model: (2, 0, 2)
ARIMA(0, 0, 0) - AIC:758.6368500789519
ARIMA(0, 0, 1) - AIC:759.8713034294582
ARIMA(0, 0, 2) - AIC:761.6791565339296
ARIMA(1, 0, 0) - AIC:759.9391043347649
ARIMA(1, 0, 1) - AIC:761.4777625813728
ARIMA(1, 0, 2) - AIC:763.4596380764991
ARIMA(2, 0, 0) - AIC:761.8332949007508
ARIMA(2, 0, 1) - AIC:763.4512219957444
ARIMA(2, 0, 2) - AIC:763.9034264159081
Comparison of Model Performance
Shoe Sales:
Alpha Beta Gamma
RMSE
Values Values Values
Single Exp. Smoothing Model: Level 0.61 196.404837 NaN NaN NaN
Double Exp Smoothing Model: Level 0.59 ,Trend 0.0 288.576717 NaN NaN NaN
Auto ARIMA, SARIMA and 2 point Moving Average forecasting models have
lowest RMSE
and hence are the most accurate forecasting models respectively.
Soft Drinks:
Beta Gamma
Alpha Values
RMSE Values Values
Single Exp. Smoothing Model: Level 0.16 819.401213 NaN NaN NaN
Double Exp Smoothing Model: Level 0.12 ,Trend 0.11 1074.329653 NaN NaN NaN
Shoe sales are poised to experience a significant upward trend in the coming
year.
Historical data reveals a consistent growth in sales since 1980,
with a temporary decline observed in the late 1980s and early 1990s.
However, sales figures are projected to reach unprecedented heights, nearly
doubling previous records.
Notably, seasonal patterns greatly influence shoe sales, with a surge in
demand towards the end of the year,
likely due to winter.
To leverage this anticipated growth, it is advisable to launch targeted
marketing campaigns
and offer attractive discounts at the beginning of each year.
By doing so, businesses can capitalize on the expected rise in sales and
maximize their market impact.
Over the next 12 months, there is a strong expectation for a significant
increase in soft drink production.
This growth is attributed to a seasonality component that amplifies
production levels in each quarter,
with a peak occurring in the middle of each quarter.
Notably, the end of the year experiences a surge in production due to
heightened demand during festive seasons
such as Halloween, Christmas, and New Year.
Considering this trend, it is advisable to strategically plan branding initiatives
that align soft drinks with
Santa and New Year themes.
By doing so, companies can effectively capitalize on the increased demand and
reinforce their
products association with these popular festivities.