When it comes to commerce businesses, rarely is there an analysis more sought after than accurate forecasting. (Trust me – I’ve been on the calls, I’ve heard your requests!) Whether it be revenue, item sales, or inventory levels, being able to forecast gives you a sought after preview into the future of your business. This information is incredibly valuable for executives, employees, and investors alike, all whom benefit from having a look into the crystal ball.

Unfortunately, forecasting is often put on the backburner for many commerce businesses – especially startups and small businesses with limited resources – because it can be surprisingly difficult to implement due to the time, resources, and skill sets required to get started. This leaves many of the businesses that could benefit most blind to the insights forecasting can provide to ultimately save time, money, and resources.

In our quest to make the world a more data-driven place, I’m excited to share that the Professional Services team here at RJMetrics (a Magento company) is helping clients with this task every day. In this post, I’ll explore the various methods that can be used for forecasting business metrics as well as the specific technologies we use at RJMetrics to help clients forecast. If this type of forecasting analysis is on the roadmap for your business, contact our support team for more information and pricing. If you’re not yet using RJMetrics and want to learn more, reach out!

For those of you who already understand the ins and outs of forecasting, feel free to jump ahead to Implementation to learn about how I’m implementing forecasting models for clients at RJMetrics.

The Basics of Forecasting

There are two main types of forecasting models that can be used to predict the future: quantitative models and qualitative models.

Quantitative Models

As the name suggests, these models rely on quantitative data, such as historical orders, inventory levels, interest rates, and stock prices, from your business and industry. These models identify patterns and trends from quantifiable data to predict future data points. While setting up these models requires some initial technical overhead, the cost of forecasting using these models on an ongoing basis can be relatively inexpensive.

Qualitative Models

Unlike quantitative approaches, qualitative models use unquantifiable data for their predictions. Some examples of qualitative data are survey results from experts or market research. Paired with human judgement and methods of quantifying the data, these models produce quantitative estimates. As one might expect, these models require significant human calibration to produce and can take months to have in place.

Depending on the type of forecasting you’re interested in, both types of models can be of use. When trying to estimate something with minimal historical or quantifiable data, such as the revenue for a new product line or the value of your brand, qualitative methods are going to be your best option. When forecasting core business metrics for startups and midsized companies, quantitative methods will be your most effective and least expensive option due to their shorter time for implementation and ability to be automated.

For the purposes of our modeling, we focus entirely on the quantitative rather than the qualitative. For many of our clients at RJMetrics, cost and speed to implementation are the two most important factors when embarking on new analyses, making quantitative models the optimal solution.

Methods Within Quantitative Modeling

Within quantitative modeling, there are two major methods commonly used for business metric forecasting: time series methods and econometric methods. Both methods rely on a metric’s historical data for predicting future values, but econometric methods also include outside data sets.

When estimating a sunglasses business’ future sales, a time series method would analyze historical sales of sunglasses and derive predictions based on historic values, trends, and patterns. An econometric method for the same forecast may also analyze weather data, fashion industry data, and some of the forecaster’s judgement when deriving predictions. Both of these methods could be computer automated and have low costs for repeat analysis, but econometric models require significantly more time and money upfront due to their need for additional data and human intervention.

Knowing this, we find that using the time series method helps us provide clients the most timely, cost-effective, and accurate forecasts for their business’ needs.

Selecting the Best Time Series Method

When choosing a specific time series method to use, various requirements are necessary to meet the needs of our commerce clients. A strong forecasting model needs to:

  • Derive accurate short-term forecasting that can drive immediate action within an organization, such as deciding how much inventory to order.
  • Account for trends and seasons. Businesses typically have trends (either upwards or downwards) in their performance, such as seasonal sales numbers for down jackets. We want to make sure forecasts account for these fluctuations.
  • Be automated and lightweight. Automated reports save time and resources for an organization, and the forecasts should run frequently enough to continually provide actionable data.

Given these constraints, one of the best models to use is exponential smoothing. Within this model, you can choose various methods based on trend and seasonality. These components can be considered additive, multiplicative, or non-existent, providing a good deal of flexibility for working with diverse data sets.


For everyone who jumped through the lesson on forecasting, here’s the part you’re looking for: the nitty-gritty details on how we’re implementing exponential smoothing models of forecasting at RJMetrics. For this, we leverage some additional resources, Python and R.

In our case, the data source and the destination of the forecasts are a client’s RJMetrics account, but the analysis itself occurs outside the platform. We start by making API calls to RJMetrics and then manipulate the data using Python. (Python is my programming language of choice here, but many others could be used.) Then we use use R as our statistical programming language to perform the actual forecasting of the data. Once that’s complete, it feeds back through Python and into RJMetrics.


Why R?

I prefer using R as a statistical programming language for a few reasons:

  • R is free, unlike other languages such as MATLAB.
  • As a language, it’s intuitive and easy to learn relative to others thanks to the large user community that develops tutorials and videos.
  • R has a massive library for additional packages and functions thanks to its adoption by researchers and professionals.

Behind the scenes

And now, a peek at how our predictions are made. To begin, we make an API call to a client’s RJMetrics account to pull the data for a particular metric, such as revenue.

image06 image05

After manipulating the data into a format R can understand, we use Python’s rpy2 package to seamlessly interface between the two languages.


Within R, we use the forecast package to access a variety of time series and linear models for forecasting. From this, we use the ets function, which stands for ExponenTial Smoothing. This function allows the user to manually select a model type or have one automatically selected based on the data set. We also have the ability to return the upper and lower bounds of the forecast’s confidence interval. (I’ve demonstrated returning the mean below.) image01

Once the forecast has been run, the forecasted data is sent back to Python, formatted, and sent into RJMetrics via an API call.


Finally, we can plot the forecasted data alongside the historical data to get the full picture.


That’s a Wrap

Predictive Forecasting is being used everyday by hundreds of thousands of commerce companies to make millions of business decisions. Here at RJMetrics, our Professional Services team can help you build out the metric forecasting you need to drive your business. If you’re interested in exploring forecasting analysis further with me, contact our support team for more information and pricing. If you’re not yet using RJMetrics and want to learn more, reach out!