# How To Use the SMAPE Formula (4 Methods With Examples)

The SMAPE formula is a calculation you can perform to find the symmetric mean absolute percentage error. Here’s what the letters mean in more detail: SymmetricAn equation that compares both predictions that are over and predictions that are under the actual outcome.

## Why is the SMAPE formula important?

The SMAPE formula is crucial as it enables you to fine-tune your calculations and produce more precise forecasts for your business, personal finances, or the stock market. SMAPE is crucial when combined with other measures of prediction accuracy, such as MAPE and WMAPE (weighted mean absolute percentage error), as these equations focus on particular variances between forecast and actual measurements.

## What is the SMAPE formula?

You can calculate the symmetric mean absolute percentage error using the SMAPE formula. Heres what the letters mean in more detail:

The SMAPE formula is:

SMAPE is calculated as follows: 1/n x (|Forecast – Actual|) / ((|Actual + Forecast|) / 2) x 100

Where:

## How to use the SMAPE formula

Although mastering the SMAPE formula may require some practice, the four techniques listed below can assist you:

### Method one: Calculating SMAPE by hand

This approach might take longer than the following three, but you can frequently learn the steps and how to calculate it to ensure that subsequent approaches calculate it correctly. If you want to determine the SMAPE for a relatively small amount of data, such as five or fewer entries, you can also calculate the SMAPE manually. Here are the steps for calculating SMAPE by hand:

Obtaining the necessary information and filling out the necessary sections of the equation is the first step in calculating SMAPE. Creating a table with the data you require can help you separate it, so it might be helpful to do so. For instance, the information in the table below compares actual sales figures to projections:

You can determine the unique SMAPE for each entry in the table once you have the first step of the equation. Use the following formula to determine the specific value of each entry:

SMAPEI is equal to (|Forecast – Actual| / ((Actual + Forecast) / 2)

Meaning that the calculations for each entry are:

Once more, it might be helpful to write the results of each entry in a table, like the one below:

After determining each SMAPE value individually, you can determine the average by adding all the values together and dividing by the total number of values. For example:

(0. 00 + 0. 40 + 0. 32 + 1. 38) / 4 = 0. 53.

The final step in applying the formula to calculate SMAPE is to multiply the result by 100 to obtain a percentage. To accomplish this, multiply the data set’s absolute mean by 100. For example:

0.53 x 100 = 53%

You can assess how closely your forecast models match the outcome of your data using the SMAPE you find. For instance, a value of 2% indicates that there is only a small discrepancy between your forecasting techniques and the actual data you have collected. A high SMAPE, such as 53%, indicates that you can enhance your forecasting models for greater accuracy and future cost savings.

### Method two: Calculating SMAPE in Excel

This technique offers a quick way to determine the SMAPE of a large data sample using Excel’s built-in functions. You can use the steps listed below to calculate SMAPE:

Entering the actual and anticipated data points into a spreadsheet is the first step in finding SMAPE in Excel. Cells A2 through B4 contain three data points that can be mapped as follows:

After entering your data into a spreadsheet, you can calculate SMAPE for each set of data by selecting a blank cell and entering the following function:

=ABS(A2-B2)/((ABS(B2)+ABS(A2))/2

Where:

When you locate SMAPE for a particular set of data points, you can click and drag the calculated cell to the bottom right until your cursor resembles a plus sign. You can perform the calculation for cells A3, A4, B3, and B4 by dragging the calculation from cell C2 over cells C3 and C4. The results of the calculation are shown in the table below:

A blank cell, such as cell C5, can be used to enter the following formula to determine the data set’s final SMAPE:

=SUM(C2:C4)/COUNT(C2:C4)

This function calculates the average of the individual SMAPE calculations. The value of the entire set of data can be obtained by multiplying the result of this calculation by 100. For example, the values above give the outcome of 0. 19. To get your final value of 19%, multiply this number by 100.

### Method three: Calculating SMAPE in Python

The Python programming language is used in the third method of applying the SMAPE formula. You can programmatically create a custom function to use SMAPE. The steps for making the function and using it in Python are listed below:

Python needs an additional package called numpy to calculate SMAPE. You can enter the following into Python’s first line to install the package:

pip install numpy

With the aid of this package, Python can operate on the different components of the SMAPE formula and assist you in computing it.

Once you install numpy, you can import it to Python. To do this, enter the following command into the second line of the Python script, granting it access to the package’s components that are required to use the SMAPE formula:

import numpy as np

This command instructs Python that any mention of “np” in commands that come after the import refers to the numpy package.

Defining the formula is the third step in applying the SMAPE formula in Python. The third line of the Python command prompt is where you can use the “define” command. The formula to define SMAPE is:

def smape(actual,forecast): return 100/len(actual) * np. sum(2 * np. abs(forecast – actual) / (np. abs(actual) + np. abs(forecast))).

By referencing the values of actual and forecast, this command instructs Python to define SMAPE and perform the calculation using those values.

You can specify the values of actual and forecast once you’ve entered the SMAPE definition into Python. To do this, move your cursor to the following empty line and type:

Actual = np.array([value 1, value 2, value 3, …])

Forecast = np.array([value 1, value 2, value 3, …])

Where:

Once your forecast and actual arrays have been defined, you can use the definition you created to calculate SMAPE. The command you can use to do this is:

result = smape(actual, forecast)

Once Python has calculated the SMAPE result, you can print it by issuing the command:

print(“SMAPE :”, result)

Based on the values you entered for actual and forecast, this prints the SMAPE result.

### Method four: Calculating SMAPE in R

Since the language’s base program includes a function for SMAPE, computing SMAPE in R is effective. You can use R’s SMAPE formula by following the steps listed below:

Open the package metrics library as the first step in the R programming language to calculate SMAPE. You can enter “library (Metrics)” metrics and press “Enter” on the keyboard to launch the package. This informs the program that one of the metric tools in that package is what you want.

By entering the commands listed below after the metrics package has been opened, you can define the values for actual and forecast data:

actual <– c(value 1, value 2, …)

forecast <– c(value 1, value 2, …)

For the program to calculate SMAPE, these two commands provide the values of the forecast and actual data.

Using a command to run the calculation is the final step in computing the SMAPE formula in R. The command for SMAPE is:

smape(actual, forecast)

This executes the computation in R and generates a number based on the actual and anticipated data.

## FAQ

What does SMAPE mean in statistics?

How to Calculate SMAPE in Excel (With Examples)
1. The symmetric mean absolute percentage error (SMAPE), which measures how well models predict outcomes,
2. SMAPE is equal to (1/n)*(|forecast – actual| / ((|actual| + |forecast|)/2)*100.
3. where:
4. The more SMAPE is less, the more accurate a given model is at predicting future events.

What is SMAPE in machine learning?

A measure of accuracy based on percentage (or relative) errors is called the symmetric mean absolute percentage error (SMAPE). The absolute error is divided by the magnitude of the precise value to calculate relative error. Unlike the mean absolute percentage error, SMAPE has an upper bound as well as a lower bound.

What is the unit of MAPE?

A measure of accuracy based on percentage (or relative) errors is called symmetric mean absolute percentage error (SMAPE or sMAPE).