1. Forecasting
Welcome back! In this chapter, we will review the fundamentals of forecasting.
2. What is forecasting?
Forecasting is the process of predicting or estimating a future outcome, and they're useful for planning and setting expectations.
Much like a weatherman uses data on past and current weather patterns to inform us all of a sunny or rainy day ahead, forecasts are based on historical data and statistical techniques.
They say, "Lightning never strikes the same spot twice." Using historical data to predict the future is not perfect, but the model can detect trends in the dataset that allow it to draw conclusions about the future.
3. Seasonality
One trend worth mentioning is called seasonality. Seasonality describes the correlation between the time of year and the performance of the underlying data. Take this graph, for example, which has highlighted the seasonality in gray. Retail sales are highly seasonal: they peak in December and dramatically decrease in January.
Seasonality is unique for each industry and doesn't necessarily need to follow holidays. For example, there may be a seasonal trend for a small company when their big contracts need to be renewed each year.
4. That's a bit biased...
Reducing bias in our data will also help our forecasts to be more precise and reduce the margin of error, so it's important to be aware of them and avoid them.
Bias is distortion in the results because of the way the analysis was set up. Let's highlight a few.
First, sampling bias is when data is collected in a way that does not represent the true population, resulting in inaccurate forecasts.
Second, confirmation bias is when the analyst only accepts results or tweaks the forecasting model to give results that they already believe to be true.
And third, anchoring bias occurs when analysts rely too heavily on initial information or historical trends and fails to adjust for new data or changing trends.
5. Confidence intervals
Because there can be errors in our predictions, good forecasts should have confidence intervals. Confidence intervals estimate the range where an actual outcome is likely to occur. They are defined by a lower bound and an upper bound.
The confidence level is the probability that an actual outcome lies within the calculated confidence interval.
6. Confidence intervals
For example, a 90% confidence level implies a 90% chance the confidence intervals would contain an actual outcome.
7. Confidence intervals
A higher confidence level, like 95% for example, will result in a wider confidence interval because by extending the range, there is more possibility that an actual outcome appears within that range.
For example, let's say that you placed a $1,000 bet on how long your friend can hold their breath. Would you rather bet between 30 and 45 seconds, or between 15 seconds and 2 minutes?
While the range of 30 to 45 seconds is more precise, you have a higher chance of winning the bet when your range is between 15 seconds and 2 minutes.
Because a higher confidence level means a higher probability of holding the observed value, a 95% confidence level or higher is generally recommended.
8. Moving averages
Moving averages are a simple technique that can be used to forecast.
A moving average is type of trendline that finds the average over a certain period of time and moves with the data, which gives it it's name. As time goes on, the average changes and a clearer trend can be seen.
9. Weighted averages
Weighted averages are useful when we want to apply more importance to more recent values.
In a weighted average, the values are multiplied by an assigned weight and then the sum of those are divided by the weight.
10. Weighted averages
For example, let's say that we have a set of values and their corresponding weights. We would simply multiply them by their weight and then add them together like so, and then we divide by the sum of those weights, which is one in this case. Here we get 3.6, and the simple average of 2 plus 3 plus 4 would have been 3. Therefore, we can see how weighting 4 more heavily has impacted our values.
In forecasting, we want to give a higher weight to more recent values so that changing trends can be captured quicker.
11. Let's practice!
Great! Now you know the basics of forecasting, let's see it in action!