Category Archives: Forecasting

The cost of not predicting

photo credit: <a href="http://www.flickr.com/photos/36196762@N04/4930275692">Army Photography Contest - 2007 - FMWRC - Arts and Crafts - Eye of the Holder</a> via <a href="http://photopin.com">photopin</a> <a href="https://creativecommons.org/licenses/by/2.0/">(license)</a>

We live in a predictive world and we are certainly predictive beings. No matter if you either accept it or ignore it. There is no choice for us. In the most elementary learning process a predictive task has to be carried out. Sometime in the past, we learnt that fire burns and now we keep away from it because we unconsciously predict that if we get too close we are going to be seriously damaged.

Bearing in mind that we are predictive beings can be of great help, especially when you are still mentally young enough to follow learning disregarding your age. Our ability to predict represents a solid starting point to any decision to be made. The better our predictions, the better our decision-making. Because of that, we usually consider predictive accuracy as a measure of performance of our predictions. Predictive accuracy is only a quantitative representation of how good our predictions are in comparison to the real observed values. However, predictive accuracy is not enough in real world problems. Cost analysis needs to be taken into account and needs to be performed in a broad sense.

Let’s see an example. Assume you are the cash manager of an important company. Assume you currently hold a high amount of money in your bank account. I know this last assumption is nowadays an unlikely one but assume it just for illustration purposes. Simple cash management models consider this holding position to have a cost because of the not achieved returns of alternative investments. In order to transform this idle money into productive money but with low risk you may decide to invest this extra money in, for example, treasury bills. That’s perfect! You will not only maintain the same amount of money at the maturity date but with a small amount on top of that. However this transaction has also a cost. No problem. As long as this cost is smaller than the amount of money obtained from the investment the final result will remain positive. That’s true. But let’s go on and see what happen in our example. The following day an unexpected large payment has to be done within the next 10 days and the amount of money left in your bank account after the investment is not enough to cover this payment. If you are lucky you may sell the treasury bill without losing too much and have enough money to face the payment. Again a transaction cost will be charged to your profit and loss account. This extra cost is an example of the cost of not predicting.

No one knows if this sudden payment can be predicted or not but there is one certain fact: not predicting has an associated cost. Any cost related to the lack of prediction can be reduced by attempts to reduce uncertainty using the best techniques available. In our illustration example, cash managers can use different cash management models that allow them to reduce cost by using cash flow forecasts as a key input to the models. In general, the cost of not predicting can be viewed as the benefit not achieved or the incurred costs associated to the fact of the unavailability of a prediction system. However, there is another type of costs associated to the design and implementation of any prediction system that must be considered. The cost of different predictive approaches to any particular problem may be totally different making projects feasible or not. In most of the cases both kinds of costs are unknown but can be estimated. This cost estimation task is a good starting point in any data mining project. A model that makes quick and cheap predictions will probably have cost savings in both the task performed and the saved executive time. The next question is: what to predict?

photo credit: <a href=”http://www.flickr.com/photos/36196762@N04/4930275692″>Army Photography Contest – 2007 – FMWRC – Arts and Crafts – Eye of the Holder</a> via <a href=”http://photopin.com”>photopin</a&gt; <a href=”https://creativecommons.org/licenses/by/2.0/”>(license)</a&gt;

People get married in summer and prefer to die in winter

The presence of seasonal patterns in many time series is not a big discovery. However, from time to time, interesting seasonal data come to you to teach you something it was no so obvious, at least for you. This happened to me recently when I was working with data of weddings and deaths in Spain for the last years in order to fit some basic ARIMA models to the data. I had an explanation for why do people decide to get married in summer because of the weather but the decision to die is not so clear, at least under normal circumstances.

Weddings and deaths in Spain from 2007 to 2013. Source: http://www.ine.es

Before seeing this plot, I would have betted a couple of beers that there was no relationship between the month and the number of deaths. Surprisingly, the reverse is true. It seems that the weather not only has an effect on weddings (nobody likes rain in his/her wedding day) but also on deaths, and the reasons are far from clear. One can think of a number of causes for this behavior but this is another question. In this post, my purpose is to show the importance of seasonality in predicting. In the context of general regression models, years, months, weeks and days are usually more important than we expected. Most of the times, plots rather than data tables allow practitioners to a better understanding of what is going on. In the search for features that are able to explain the behavior of any target variable, we are prone to look for a number of more difficult to obtain features, in terms of time and money. However, when dealing with time series forecasting, there are several features such as calendar variables that are cost free but that may be able to explain a remarkable part of the variance of the target variable. Two examples are weddings and deaths grouped by month but there are many other examples were seasonality is also present. Electricity consumption by hour, the effect of the day of the week and the January effect in stock market returns are examples on how seasonality and other calendar anomalies can lead users to important savings and benefits if they take into account these effects in their predictions. In the corporate cash management problem, one of the most important tasks is daily cash forecasting where the day-of-month and the day-of-week plays a critical role in the ability to predict next day cash flow. Setting one or two fixed days of payment per month is a common business practice so that cash flow highly depends on the day of the month that occurs. In this sense, the works on daily cash flow forecasting by Stone, Stone and Wood, and Miller and Stone in the seventies and eighties focus on the ability of calendar dummy variables for predictions. My first steps in daily cash flow forecasting confirm that the use of these calendar dummy variables results in better forecast accuracy. Remember, seasonality is present in weddings and deaths but also in cash flow forecasting and many other fields of interest for researchers. You can find useful information about seasonality in daily cash flow forecasting in the next references.

  • Stone, B. K. (1976). The payments-pattern approach to the forecasting and control of accounts receivable. Financial Management, 65-82.
  •  Stone, B. K., & Wood, R. A. (1977). Daily cash forecasting: a simple method for implementing the distribution approach. Financial Management, 40-50.
  •  Miller, T. W., & Stone, B. K. (1985). Daily Cash Forecasting and Seasonal Resolution: Alternative Models and Techniques for Using the Distribution Approach. Journal of Financial and Quantitative Analysis20(03), 335-351.
  •  Stone, B. K., & Miller, T. W. (1987). Daily cash forecasting with multiplicative models of cash flow patterns. Financial Management, 45-54.