Showing posts with label Forecasting. Show all posts
Showing posts with label Forecasting. Show all posts

Tuesday, August 8, 2017

70. TIME SERIES ANALYSIS

OBJECTIVE

Forecast the demand for the next periods.


DESCRIPTION

Time series analysis is useful for forecasting based on the patterns underlying the past data. There are four main components:

  • - Trend: a long-term movement concerning time series that can be upward, downward, or stationary (an example can be the upward trend in population growth);
  • -  Cyclical: a pattern that is usually observed over two or more years, and it is caused by circumstances that repeat in cycles (for example economic cycles, which present four phases: prosperity, decline, depression, and recovery);
  • -     Seasonal: variations within a year that usually depend on the weather, customers’ habits, and so on;
  • - Irregular components: random events with unpredictable influences on the time series.
Time Series Analysis



Time Series Analysis


There are two main types of models depending on how the previous four components are included:

(     1)    Y(t)=T(t) x S(t) x C(t) x I(t)
Multiplicative models: the four components are multiplied, and in this case we assume that the components can affect each other.

(     2)    Y(t)=T(t) + S(t) + C(t) + I(t)
Additive models: we make the assumption that the components are independent.


Another important element of time series is stationarity. A process is stationary when an event is influenced by a previous event or events. For example, if today the temperature is quite high, it is more likely that tomorrow it will be quite high as well.

There are many models for time series analysis, but one of the most used is ARIMA (autoregressive integrated moving average). There are some variations of it as well as non-linear models. However, linear models such as ARIMA are widely used due to their simplicity of implementation and understanding.

A good time series analysis implies several exploratory analyses and model validation, which requires statistical knowledge and experience. The template contains a simplification of a time series model in which seasonality and trends are isolated to forecast future sales.
The data can be collected at every instance of time (continuous time series), for example temperature reading, or at discrete points of time (discrete time series), when they are observed daily, weekly, monthly, and so on.



TEMPLATE



Wednesday, March 29, 2017

71. PICKUP MODELS

OBJECTIVE

Forecast the demand for the next periods.


DESCRIPTION

Pickup models are advanced forecasting models used in revenue management, and they can be applied in businesses that book the service in advance (airlines, hotels, theaters, etc.). The forecast is calculated using the current bookings for a certain future period and estimating the incremental bookings (pickup) from now until this future period (i.e. departure date, check-in date, etc.).

The pickup is calculated using past data, and it can be the average pickup with a specific anticipation (x days before) if we are summing it with the current bookings or it can be an average pickup ratio (total bookings / bookings x days before) if we are multiplying it by the current bookings:



In the first formula (additive pickup), the bookings on anticipation day 0 (BDB0) are equal to the current bookings (BDBX) plus the average pickup bookings between anticipation day x and anticipation day 0 (PUDB(X,O)). In the second formula (multiplicative pickup), the forecast is calculated by multiplying the current bookings by the average pickup ratio (PURDB(X,0)).

To estimate good forecasts, it is very important to calculate carefully either the average pickup or the pickup ratio. Take as an example an airline company. If we are using the average pickup, then we should take into consideration seasonality at different levels: time of the day, day of the week, month, holidays, and so on. The amount of incremental bookings depends heavily on the demand for a specific departure time, so we should calculate the average using similar days. However, if we are using the average pickup ratio, we do not have this problem but may discover that the booking pace is different for different departure periods; for example, more people are anticipated to book during summer periods. In this case it is important to calculate the average pickup ratio from similar departure periods.

We can also take a step further and expect that the booking pace may change over time, either because the customer behavior has changed or because we have widened the booking horizon. For example, we can calculate a trend in the pickup ratio and adjust it for the prediction of future periods.



TEMPLATE



Monday, November 21, 2016

67. S-CURVE LIFE CYCLE ANALYSIS

OBJECTIVE

Identify the maturity of a product or service and forecast the demand for the next periods.


DESCRIPTION

The assumption behind this model is that usually a product has a life cycle that follows an S-shaped curve with three main phases (see 12. PRODUCT LIFE CYCLE):
  • -          Emergent phase: this is characterized by a low number of firms, low revenues, and usually zero or negative margins;
  • -          Growth phase: the margins are increasing rapidly (for a while, but less in the last part of the growth phase), as well as the number of firms;
  • -          Mature phase: the global revenues are increasing at a far lower rate; both the margins and the number of firms are decreasing. At this point the product can enter into a decline phase, for example if a newer substitute product is introduced or if the demand is decreasing.

As mentioned in chapter 12. PRODUCT LIFE CYCLE, it is important to identify the phase of the product or service (this analysis also applies to different product levels – brand, product line, product category, etc.). For this purpose we should identify the trend in the number of firms, revenues, and margins. However, we can complement this analysis with a statistical approach that will help us to forecast the future growth.

If our product is in the emergent phase or just in the development phase, we do not have enough data to estimate the S-curve, so we should use the data of products with similar characteristics and analyze their product life cycle curves. It is important to make good assumptions about the market saturation level and the differences between our product and the similar product that can affect the growth rates in the three phases. The more data we obtain after the launch of our product, the more precisely we can compare it with the S-curve of similar products and, thus, the more we can adjust our assumptions.

If we estimate that our product is already in the growth phase, besides comparing it with similar products, we can build our S-curve using for example a logarithmic linear estimate (see the template) and forecast future sales. As shown in the figure below, the sales data for each period (years[1]) are inserted into the tthe able then transformed to estimate a linear trend. In the last row of the table, the logarithmic transformation is reversed and the sales are projected (see the graph on the right in the graphs).


Forecasting using log transformation (S-Curve Forecasting)

Sales Data and Forecast Using Log Transformation


If we think that the S-curve does not fit the forecast properly, we can change our assumptions about the market saturation level (which will change the log-transformed data and thus our forecast). In the template the R2 is calculated and we can use it as a measure of how well the forecast curve fits the actual sales data. However, remember that our assumptions about market saturation levels are more important than reaching a “perfect” fit of the forecast curve. For example, we can reach a higher R2 but with an improbably high market saturation level. In fact, there are different factors that can affect the shape of the curve: the economic situation, competitors’ strategies, the entry of new substitute products, new fashions, and so on.


Graph log transformation s-curve forecasting

Log Transformed Data and Linear Trend Line (on the Left); Real Sales Data and Forecasted Sales (on the Right)


Finally, in the case that our product is already in the mature phase, this model will just project a slightly increasing or stable level of sales. However, it cannot predict or estimate whether or when our product will pass into the decline phase. This can be realized only when the product has already started to decline. Anyway, when it becomes apparent that our product is in the mature phase, our strategic actions will focus on optimization and “life extension.” On one side we have to optimize what we can obtain with this product and its market by reaching its full potential (pricing optimization, loyalty programs, product bundling, advertising, promotions, etc.). However, sometimes this is not enough either to continue to increase sales or to avoid declining. In this case we should consider actions that are able to “push upward” the S-curve, extending the life cycle of the product: product evolution, innovation, new markets, new use of the product, and so on.

Finally, it is important to remember that this is not a precise forecasting method, since this is not its main goal. With this method we can project the medium- and long-term product growth potential, but, for a more accurate forecast, this method has to be complemented with more precise methods, especially for the short-term forecast.


TEMPLATE




[1] Usually the life cycle of a product takes years to reach maturity, but, if we have a shorter life cycle, we can use deseasonalized monthly data (for example using a moving average).


Thursday, October 27, 2016

2. SUPERFORECASTING

The only true wisdom is in knowing you know nothing.
(Socrates)

Even though this is not a technique, I decided to start this toolbox with superforecasting, inspired by the book by Philip E. Tetlock and Dan Gardner,[1] which I consider a must for any analyst. The authors try to explain why some experts are good at making predictions and others are not based on several forecasting experiments.

The first reason for poor forecasting is overconfidence in our knowledge (“illusion of knowledge”); the example is given of how medicine improved when experimentation was introduced. Our brain works using two systems, 1 and 2.[2] System 1 is good for fast, effortless reasoning that happens unconsciously and is useful in pattern recognition (for example, when driving on a route that we follow often, we use System 1). However, System 1 can create biases or illusions, since the reasoning behind it is based on simplifications to make fast and effortless responses. In the case of dealing with problems with possible biases, we have to use System 2, the system that uses reasoning and logic and, despite requiring more time and effort, allows us to overcome the “illusion of knowledge.” Usually, for complex problems we need to use System 2, but sometimes, when there are many patterns or much information, intuition can be a better solution, since it can simplify all the information and analyze unconsciously a quantity of patterns that we are not able to analyze logically.

Another reason for unfortunate forecasts is the lack of precision and/or measurement. Vague forecasts cannot be measured, and therefore we cannot improve our forecasting methods. A good prediction has to include:

  • -          A measurable outcome: “the USSR will dissolve”;
  • -          A more precise forecast with a possible date frame: “within one year from now”;
  • -          Probability: “80% probability that it will happen.”


Probability should not be a measure of our confidence in the results but the result of our reasoning (based on several pieces of information) about the probability of an event occurring. To measure the results of our forecasts with probabilities, it is necessary to make several similar predictions to calculate their accuracy and calibration.

The author also proves that average group predictions are better than individual predictions, because they use different perspectives, knowledge, and information. If we have to perform forecasts individually, we can behave like a group by aggregating different sources of information, asking for other people’s perspectives and opinions, and always questioning the results. We should also remember to update our results based on any new, relevant information that we obtain.

Finally, a wonderful technique that will help in making complex forecasts is “Fermi estimation.” It consists of breaking down a problem into several probability questions to make more accurate guesses and then adding up those questions that will produce a more realistic final outcome. This technique usually starts by taking into consideration an outer perspective. For example, we are presented with a picture of a family and we have to predict whether they have a pet or not. Instinctively we may start by focusing on the family’s characteristics that we can identify. However, we should start with a broader perspective, for example the number of families in a certain geographical space (country, state, city, etc.) who own pets, namely 30%. This is our starting point, so we know without any other additional information that our best guess would be that there is a 30% probability that this family owns a pet. We can then adjust our prediction with an inside view focusing on the family’s characteristics, for example age, ethnicity, children, and so on. A famous example is the estimation of the number of piano tuners in Chicago. Instead of guessing the number directly, the problem is broken down into several questions, starting with defining the total population of the city, then determining the number of households, guessing the number of households with a piano, gauging how often a piano needs to be tuned, and so on.[3]