Page 169 - Data Science Algorithms in a Week
P. 169
Time Series Analysis
Conclusion:
Therefore, the trend line equation for the profit of the company is:
profit=3.357*year-6711.571.
From this equation, we can predict the profit for the year 2018 to be
profit=3.357*2018-6711.571=62.855k USD or 62855 USD.
This example was simple - we were able to make a prediction just by using linear regression
on the trend line. In the next example, we will look at data subject to both trends and
seasonality.
Electronics shop's sales - analysis of
seasonality
We have data of sales in thousands of USD for a small electronics shop by month for the
years 2010 to 2017. We would like to predict sales for each month of 2018:
Month/Year 2010 2011 2012 2013 2014 2015 2016 2017 2018
January 10.5 11.9 13.2 14.6 15.1 16.5 18.9 20 20.843
February 11.9 12.6 14.4 15.4 17.4 17.9 19.5 20.8 21.993
March 13.4 13.5 16.1 16.2 17.2 19.6 19.8 22.1 22.993
April 12.7 13.6 14.9 17.8 17.8 20.2 19.7 20.9 22.956
May 13.9 14.6 15.7 17.8 18.6 19.1 20.8 21.5 23.505
June 14 14.4 15.3 16.1 18.9 19.7 21.1 22.1 23.456
July 13.5 15.7 16.8 17.4 18.3 19.7 21 22.6 23.881
August 14.5 14 15.7 17 17.9 20.5 21 22.7 23.668
September 14.3 15.5 16.8 17.2 19.2 20.3 20.6 21.9 23.981
October 14.9 15.8 16.3 17.9 18.8 20.3 21.4 22.9 24.293
November 16.9 16.5 18.7 20.5 20.4 22.4 23.7 24 26.143
December 17.4 20.1 19.7 22.5 23 23.8 24.6 26.6 27.968
[ 157 ]