Engineering
Forecasting Freshness for Perishable Goods: Part 1 — Dive into the World of Univariate Predictions
In the high-stakes game of perishable goods like fresh produce and seafood, forecasting demand isn’t just strategy — it’s survival!
The ability to predict demand with accuracy is a vital determinant of success in this game. Take items like meat and fish, for instance, with fleeting shelf lives of just a day or two under suitable conditions. Overstocking can lead to wastage and financial losses, while understocking can disappoint and drive away customers. This is where demand forecasting comes into play, it orchestrates the balance, guiding businesses in their enigmatic dance of informed inventory decisions, ensuring every move is a step towards success.
In the bustling marketplace of fresh produce, we zeroed in on a special item — Fish Eggs data from a leading company. Think of it like a detective focusing on a single footprint in a crowded place. We then crunched the numbers and pulled out a tool called MAPE to see just how close our sales predictions came to the real deal. It’s a bit like guessing the weight of a pumpkin at a fair!
MAPE, or Mean Absolute Percentage Error, is like a scorecard that tells us how off our guesses are, in percentage terms, from the actual results. It’s like checking how close our arrow gets to the bullseye on a target! 🎯🏹
Peeking into our crystal ball of sales data, we found that the forecasting was swinging off by about 50%. What’s the ripple effect? Well, it’s like preparing a feast but overshooting the guest list, leading to heaps of leftovers and waste!
In this read, we’ll embark on our journey with the univariate forecasting approach and explore its intricacies. Hold tight, we’re about to unravel the layers of data magic!
Univariate Demand Forecasting
Alright! Now let’s understand Univariate Demand Forecasting. Imagine we have a jar where we drop a marble every time we sell a packet of Fish Eggs. At the end of each day, we look inside and count how many marbles are there.
Now, the univariate model is like a friend who tries to guess how many marbles will be in the jar tomorrow, but the only thing he looks at is how many marbles we had in the jar for the past days. He doesn’t care if it’s a holiday tomorrow, if there’s a big event in town, or if it’s going to rain. He only looks at our jar’s history to make his guess.
So, if he notices we always have a lot of marbles on Fridays, he’ll just say, “Tomorrow’s Friday, so I guess you’ll have a lot of marbles in the jar!” That’s it. Simple!
Univariate forecasting is all about analyzing a single variable — in this case, the past sales of a particular product such as Fish Eggs.
Key features: It is simple & straightforward in terms of data collection and analysis since it considers only one factor. The focus here is on patterns, trends, and seasonality in historical data. For instance, if sales of Fish Eggs typically surge in December, a univariate model will incorporate this pattern into its predictions.
Limitations: This method often fails to account for external factors that might influence demand, such as promotions, competitor actions, or changing consumer preferences due to seasonality or ethnicity.
Data Gathering & Analysis
For our initial analysis , we took daily sales data for one year and one perishable product (Fish Eggs) and for one pos (i.e. a point of sale).
We took data with the above filters and plotted the sales vs. time graph and received the below results
Then we plotted the bar graph to look for trend, seasonality, and outliers.
To identify the exact outliers, we plotted a histogram as below and observed that there are very few days with exceptionally high sales. Therefore, we decided against outlier removal.
To identify trends and seasonality, we plotted a graph using rolling mean and rolling standard deviation. From this, we determined that our data shows no trend but seasonality for the given time frame
We’ll be harnessing the power of univariate methods, ARIMA and Triple Exponential methods to weave through data and gaze into the future of sales.
ARIMA Model
Let’s delve into ARIMA using the sales data of Fish Eggs.
As we’re trying to guess how many Fish Eggs we might sell in the upcoming weeks. The ARIMA model is like a smart assistant that helps us predict by looking at our sales diary.
1. AutoRegressive (AR):
The idea here is that the amount of fish eggs we’ll sell today is somewhat influenced by what we sold a few days or weeks ago.
For instance, if we had a spike in sales last Saturday, it might be because people buy more for weekend. AR looks at such patterns in past sales to anticipate future sales.
2. Integrated (I):
Now, instead of directly examining sales, this part is more concerned about the changes or differences in sales.
Imagine that every day we make a note: “Today, we sold 5 kilograms more than yesterday” or “Today, we sold 3 kilograms less than the day before.” Over time, these differences can show a pattern. Recognizing this pattern helps in understanding whether sales are steadily increasing, decreasing, or staying the same.
3. Moving Average (MA):
This component believes that any sudden spikes or drops in our sales (maybe because a big event happened in town or due to unexpected weather changes) can influence future sales.
For instance, if there was an unexpected heavy rainfall one day leading to less foot traffic and sales, the MA part would factor in such random incidents and adjust the prediction.
With ARIMA, we’re essentially telling our smart assistant: “Hey, look at my past sales, see how they’ve changed from day to day, and also consider any surprising events. Then, tell me how much meat and fish I might sell in the coming weeks.”
This model then studies our sales diary, spots the patterns, and gives us its best guess for the upcoming sales, ensuring we stock just the right amount of meat and fish!
Triple Exponential Smoothening
Alright! Now let’s understand Triple Exponential Smoothing, also known as the Holt-Winters method.
As we’re trying to predict how many Fish Eggs we’ll sell in the upcoming months. Let’s see the components of this method.
Level (Single Smoothing):
Think of this as the average amount of Fish Eggs we sell on a regular day.
For instance, we notice we typically sell around 100 kilograms combined daily.
2. Trend (Double Smoothing):
Over time, we see that each month, perhaps due to a growing population or more people turning to non-veg diets, we’re selling an additional 5 kilograms daily.
This upward pattern, or trend, is like noticing a river’s current gradually getting stronger as you move downstream.
3. Seasonality (Triple Smoothing):
Now, there’s a twist! During festive seasons or certain cultural events, people might eat less Fish Eggs, leading to a drop in sales. But once the festival season is over, sales rise again, even if the trend of increasing consumption continues.
This repeating pattern each year is the seasonality. It’s like observing that during certain times, a particular Fish Eggs are more available because it’s their breeding season, and at other times, it’s scarce.
Triple Exponential Smoothing, in this context, would combine these three observations: your daily average sales (level), the general increase over time (trend), and the ups and downs due to seasonal events (seasonality) to make a well-informed prediction about our future Fish Eggs sales.
So, using this method, if a major festival is approaching where people traditionally consume less meat or fish, even if our sales have generally been rising, we’d prepare for a temporary dip based on past patterns!
We applied these two models to our Fish Egg Sales data for one pos and observed the following.
As we noticed that just looking at past sales isn’t enough because the sales have some patterns that repeat or trends that are changing, the Triple Exponential is better equipped to handle that, that’s why we tried both approaches and received the results as below.
ARIMA results: We got a MAPE of 16.59%
Triple Exponential Smoothening results: We got a MAPE of 15.17%
After diving deep into our data, we realized our predictions were missing a few tricks! Turns out, factors like seasons, weekends, holidays, and those irresistible discounts on website play a big role in Fish Eggs sales. So, thought to take a multivariate forecasting approach, ensuring our predictions are sharper and more on point than ever. 🐟🥩📊🚀
Multivariate Demand Forecasting
For MDF, every day, we keep track of how much we sell. But we also notice other things matter: the weather (people might buy more for a BBQ on sunny days), the day of the week (maybe more orders on weekends when folks cook at home), special holidays (like Christmas or Thanksgiving), and even those special discount days on our website.
Now, if we were just looking at how many Fish Eggs we sold previously to guess future sales, that would be like trying to predict the outcome of a football game based only on the last game’s score. It gives us some idea, but it’s not the whole picture.
Multivariate Demand Forecasting is like upgrading to a crystal ball that doesn’t just look at one thing, but multiple things at once. It’s like a magical sales assistant who says, “Okay, tomorrow is sunny, a weekend, AND we have a 20% off sale. I bet we’ll sell a lot of Fish Eggs!”
In simpler terms, it’s using lots of different pieces of information (like weather, day of the week, holidays, and sales 🛒🌤️📅🛍️ ) all together to make a really good guess about how much Fish Eggs we’ll sell. It’s like cooking a recipe; the more ingredients you add (as long as they’re the right ones), the tastier the dish! 🍖🐟
Conclusion
After some detective work, we noticed our sales predictions for Fish Eggs were missing some key ingredients! Seasons, weekends, holidays, and even those hot discounts on the site to spice up egg sales. So, we’re jazzing things up and shifting to a multivariate forecast, aiming to nail 🎯 our predictions even better. It’s not just about picking one method over another; it’s about getting the recipe just right. Because when it comes to serving fresh food, timing is the secret sauce. Let’s keep it fresh and precise! 🐟🥩🍽️
Keep an eye out, because things are about to get a lot more exciting with our detailed multivariate analysis article on the horizon! Dive in with us!




