Page 167 - Data Science Algorithms in a Week
P. 167

Time Series Analysis


            Business profit - analysis of the trend

            We are interested in predicting the profits of a business for the year 2018 given its profits for
            the previous years:

             Year Profit in USD
             2011 40k

             2012 43k
             2013 45k
             2014 50k

             2015 54k
             2016 57k

             2017 59k
             2018 ?
            Analysis:

            In this example, the profit is always increasing, so we can think of representing the profit as
            a growing function dependent on the time variable represented by years. The differences in
            profit between the subsequent years are: 3k, 2k, 5k, 4k, 3k, and 2k USD. These differences
            do not seem to be affected by time, and the variation between them is relatively low.
            Therefore, we may try to predict the profit for the coming years by performing a linear
            regression. We express profit p in terms of the year y in the linear equation, also called a
            trend line:

            profit=a*year+b

            We can find the constants a and b with linear regression.


















                                                    [ 155 ]
   162   163   164   165   166   167   168   169   170   171   172