Predictive sales analysis according to the effect of weather Alessandro Massaro, Melisa Aruci Giuseppe Pirlo Donato Barbuzzi, Valeria Vitti, Departmenti i Informatikës Dept. of Informatics Angelo Galiano Fakulteti i Shkencave të Natyrës, Bari University, Dyrecta Lab srl Tiranë, Albania 70125 Bari, Italy ResearchInstitute, melisa.aruci@gmail.com giuseppe.pirlo@uniba.it 70014 Conversano (BA), Italy alessandro.massaro@dyrecta.com Our approach is consistent with the aforementioned studies, which analyzes the direct link between the Abstract weather variables and the customers’ behavior in order This work presents an empirical simulation to to predict the sales of a particular product in the next estimate the extent to which weather affects future. This is important to establish optimal business consumer spending. For the spending intelligence rules, i.e. for warehouse management. The prediction purpose, the regression technique work begins with an analysis of daily sales in one shoe has been applied on the historical daily data of store, which have an effect onweather forecasts. The the following meteorological parameters: paper is organized as follows: Section 2 reports an temperature, snow, sun, rain and humidity. overview on the effects that weather can have on The experimental results demonstrate the consumer behavior. Section 3 describes the technique effectives of the model for predicting sales for sales prediction based on Regression; Section 4 trends and for applying optimal business presents the experimental results. The conclusion of the intelligence rules. paper and some of the most interesting future perspectives are reported in Section 5. 1Introduction 2 Weather effects: An overview Weather has strong effects on human behavior and a lot In literature, the weather effects have been investigated of scientific research was devoted to the investigation for the consumer behavior analysis. Three different on the direct link between weather and social activities. consumer categories, affected by: (1) bad weather; (2) For instance, [Coh90a] and [Coh90b] reported that seasons and (3) his moods, were considered. higher temperatures are correlated with increases in violent assaults and homicides. Also [Bar94] and In the first category (1), the rain, the snow and extreme [Sto99] studied the number of suicides related to the temperature keep people at home. In this case,the barometric pressure and demonstrated their decrease weather negatively affects both sales and store related to the wind. traffic[Par01].An intelligent marketing solution would be to focus on online sales. The second set of Weather also influences human behavior in the sales. consumers (2) influences both sales volume and store For instance, we buy warm clothing in winter and cool traffic in particular product categories [Mau95]. For clothing in summer. Moreover, in the finance field, example, when temperatures fall, ice cream sales weather variables can affect human behavior and his decrease, while sales of oatmeal increase. Similarity, mood [Goe05], [Hir03], [Sau93], [Tro97]. Coca-Cola people tend to purchase more clothing and footwear in company proposed a dynamic pricing strategy based on the winter and more food and drinks in the summer changes in the environment temperature, so the vending [Ros00].Finally, it has been suggested that weather can machines increase the price of a soda as the weather influence sales by affecting consumers’ internal states gets hotter [Kin00]. Nevertheless, the effect of weather (3). Although there is very little research forthis third on consumer spending has received only limited category of effects, few studies have attention in the marketing literature [Par00] [Par01] providedpreliminarysupport for this idea. In [Par00], [Ste51]. the authors present a global climate-based model of the effect of weather on consumer behavior, which predicts variation in consumption patterns in response to Table 1: Meteorological and sales data for the different temperatures and exposure to sunlight. They calculation of regression coefficients argue that consumers do adapt to changes in the Feb Sales Temp Snow Sun Rain Humid TempSun Temp2 environment by modifying their purchasing behavior to 2010 both maintain physiological homeostasis and to achieve 1 7 8,7 0 66,75 14,79 69,54 573,92 77,21 3 12 7,1 0 72,5 0 57,38 493,58 56,17 optimal stimulation levels. In [Mur10], the authors 4 15 9,13 0 88,46 0 74,75 796,54 85,36 report an empirical evidence of how weather can 8 3 8,37 0 35,67 39,38 79,33 312,33 70,71 impact consumer spending. In particular, they claimed 10 1 13,08 0 29 55 83,38 431,71 176 that: 11 2 10,25 0 48,67 42,08 76,83 492,17 105,5 12 10 9,71 0 72,42 8,13 69,79 687,21 96,96  Weather variables and, sunlight in particular, 13 6 7,29 0 59,21 1,88 68,46 433,17 54,04 affect consumer spending; 15 3 9,08 0 46,04 22,29 81,75 429,21 83,17 16 5 11,83 0 21,13 42,29 82,79 209,42 143,25  17 3 13 0 37,04 51,25 87,75 502,42 169,75 Exposure to sunlight reduces negative affect; 19 14 14,96 0 79,21 1,25 78,71 1209,29 237,38 22 3 10,83 0 44 41,04 81,63 469,79 119,67  As negative affect decreases, consumer 23 8 13,25 0 70,13 21,25 80,5 928,38 180,25 spending increases; 24 2 13,25 0 55,33 82,5 85,21 752,83 177,75 25 10 12 0 72,88 12,08 82,54 879,25 144,58  Negative affect mediates the effect of sunlight 26 12 12,96 0 76,58 6,88 78,25 1002,38 176,38 on consumer spending. Starting from the value of Table 1, the regression Their research demonstrates a cause-and-effect coefficients have been computed with Microsoft Excel relationship between exposure to sunlight and an tool. So, Table 2 shows thisspecific information. More increased willingness to pay for common product. specifically, it reports:  Coefficient. This column shows the least 3Sales Predictive Analysis by Regression squares estimate.  Standard Error. This column shows the least In this section, we will provide some aspects squares estimate of the standard error. concerning the approach used for sales prediction based  T Statistic. This column shows the T Statistic on weather effect. for the null hypothesis vs. the alternate For the purpose, we consider the empirical model for hypothesis. the iterative calculation of the regression coefficients:  P Value. This column shows the p-value for the hypothesis test. Salesij=aij+b1Tempij+b2Snowij+b3Sunij+b4Rainij+  Lower 95%. This column shows the lower +b5Humidij+b6SunijTempij+b7Temp2ij+eij(1) boundary for the confidence interval. Table 1 shows the averagemeteorological values,in  Upper 95%. This column shows the upper February 2010, related to: boundary for the confidence interval.  Temperature; Table 2: Calculation of regression coefficients  Snow; Standard Lower Upper  Sun; Coefficients Error t Stat P-value 95% 95% -13,28 11,54 -1,15 0,28 -39,38 12,82  Rain; Intercepts -1,68 2,26 -0,75 0,47 -6,79 3,42  Humidity. x1 x2 0,00 0,00 65535 #NUM! 0,00 0,00 x3 0,44 0,15 2,97 #NUM! 0,11 0,78 Itreports thesimulated sales data in that day. x4 -0,11 0,03 -3,47 0,01 -0,18 -0,04 x5 0,17 0,17 1,03 0,33 -0,21 0,55 x6 -0,03 0,01 -2,38 0,04 -0,06 0,00 0,16 0,10 1,57 0,15 -0,07 0,40 x7 Table 4 describes the ANOVA parameters. An The formula (1) becomes: ANOVA test is a way to find out if survey or Salesij=-13,28-1,68x1+0x2+0.44x3-0.11x4+0.17x5- experiment results are significant. More specifically, -0.03x6+0.16x7+1.67(2) these parameters are used to accept or to reject the null hypothesis for the alternate hypothesis. In particular: Table 3shows regression statistics. These measures  df. This measure explains degrees of freedom. show how well the calculated regression equation fits  SS. This measure explains the sum of squares. data. In particular:  Regression MS. This measure is computed  Multiple R. This is the correlation coefficient. dividing Regression SS with Regression It explains how strong the relationship is. A degrees of freedom. value of 1 means a perfect positive  Residual MS. This measure is computed relationship and a value of zero means no dividing Residual SS with Residual degrees of relationship at all. It is the square root of r freedom and it explains the mean squared squared. error.  R squared. This is rxr, the Coefficient of  F. This measure explains overall F test for the Determination. It explains how many points null hypothesis. fall on the regression line.The best value for  Significance F. This measure explains the this measure is 80%. It means that 80% of the significance associated P-Value. variation of y-values around the mean is explained by the x-values. Table 4: ANOVA Analysis  Adjusted R squared. The adjusted R-square ANOVA Analysis adjusts for the number of terms in a model. Users have to use this measure instead of R df SS MS F Significance F squared, if there are more than one x variable. Regression 7 311,4610 44,4944 16,0119 0,0002  Standard Error of the regression.This Residual 9 25,0096 2,7788 measure is an estimate of the standard Total 16 336,4706 deviation of the error μ. This is not the same as the standard error in descriptive statistics. The standard error of the regression is the 4 Prediction Results precision that the regression coefficient is Figure 1 shows the sales prediction, in the next fifteen measured; if the coefficient is large compared days, concerning a store (Store 1)located in to the standard error, then the coefficient is Conversano (BA). Figure 2 and Figure 3 report weather probably different from 0. forecast in February 2016 related to the city.  Observations. Number of observations in the sample. Table 3: Statistical Regression Performance Regression Statistics Multiple R 0,962117902 R Squared 0,925670858 Adjusted R squared 0,867859304 Figure 1: Sales prediction in Store 1 Standard Error of 1,666985637 regression Observations 17 Figure 2: Temperature Forecast in Conversano (BA) Figure 6: Sun, Snow, Rain and Humidity Forecast in Milano Data of Figure 1 andFigure 4 have been calculated respect to the Equation (2). More specifically, the weather forecasts in Conversano (BA) and Milano have been used to draw the trend line, respectively. 5 Conclusion Figure 3: Sun, Snow, Rain and Humidity Forecast in A predicted model based on weather variables has been Conversano (BA) introduced in order to optimize business intelligence rules. The empirical simulation shows the direct link Figure 4 shows the sales prediction in Store 2, located between the temperature, the snow, the sun, the rain in Milano. Figure 5 and Figure 6 report weather and the humidity and the customers’ behavior in order forecast in February 2016 related to the city. to predict the sales of a particular fashion product in the next future. Finally, the sales prediction for two weeks has been calculated respect to the historical data in the month. In the future other models such as the “Decision Tree” in the Data Mining field will be compared with the regression approach. Acknowledgments The work has been developed within the framework of the project titled: Sistema di Business Intelligence di Figure 4: Sales prediction in Store 2 tipo “embedded” basatosu prediction real time in sistemi Big Data orientate al settore di calzature e accessorimoda “Predishoes”(Business Intelligence Embedded Systembased on real time prediction in BigData systems oriented on fashion”Predishoes”). Figure 5: Temperature Forecast in Milano [Par01] Parsons, A.G., 2001. The association between References daily weather and daily shopping patterns. Australasian Marketing Journal 9 (2), 78–84 [Goe05] Goetzmann, W.N., Zhu, N., 2005. Rain or shine: where is the weather effect? European [Ste51] Steele, A.T., 1951. Weather’s effect on the Financial Management 11 (November) 559– sales of a department store. Journal of 578 Marketing 15 (April), 436–443. [Hir03] Hirshleifer, D., Shumway, T., 2003. Good day [Mur10] Murray, K. B., Di Muro, F., Finn, A., sunshine: stock returns and the weather. &Leszczyc, P. P. (2010). The effect of weather Journal of Finance 58 (June), 1009–1032. on consumer spending.Journal of Retailing and Consumer Services,17(6), 512-520. [Sau93] Saunders, E.M., 1993. Stock prices and wall [Mau95] Agnew, Maureen D., and John E. street weather. The American Economic Thornes."The weather sensitivity of the UK Review 83 (December), 1337–1345. food retail and distribution industry."Meteorological Applications 2.2 [Tro97] Trombley, M.A., 1997. Stock price and wall (1995): 137-147. street weather: additional evidence. Quarterly Journal of Business and Economics 36 [Ros00] Roslow, S., Li, T., & Nicholls, J. A. F. (Summer), 11–21. (2000).Impact of situational variables and demographic attributes in two seasons on [Coh90a] Cohn, E.G., 1990a.Weather and crime. purchase behaviour.European Journal of British Journal of Criminology 30 (1), 51–64. Marketing, 34(9/10), 1167-1180. [Coh90b] Cohn, E.G., 1990b.Weather and violent crime. Environment and Behavior 22 (March), 28–94 [Bar94] Barker, A., Hawton, K., Fagg, J., Jennison, C., 1994.Seasonal and weather factors in parasuicide. British Journal of Psychiatry 165 (3), 375–380. [Sto99] Stoupel, E., Abramson, E., Sulkes, J., 1999. The effect of environmental physical influences on suicide. How long is the delay? Archives of Suicide Research 5 (September) 241–244. [Kin00] King, C., Narayandas, D., 2000. Coca-cola’s new vending machine (A): pricing to capture value, or not? Harvard Business School Case # 9-500-068. [Par00] Parker, P.M., Tavassoli, N.T., 2000.Homeostasis and consumer behavior across cultures. International Journal of Research in Marketing 17 (March), 33–53.