🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
  • Home
  • AI Reference
  • What is root mean square error (RMSE) in time series forecasting?

What is root mean square error (RMSE) in time series forecasting?

Root Mean Square Error (RMSE) is a widely used metric for evaluating the accuracy of time series forecasting models. It quantifies the average magnitude of prediction errors by measuring the square root of the mean squared difference between predicted values and actual observed values. Mathematically, RMSE is calculated as the square root of the average of ((y_{\text{predicted}} - y_{\text{actual}})^2) across all data points. Squaring the errors emphasizes larger deviations, making RMSE particularly sensitive to outliers. For example, if a model predicts sales for 10 days, RMSE aggregates the errors across all days into a single value that represents the typical error magnitude in the original units (e.g., sales units).

RMSE is valuable because it provides a straightforward interpretation of average error in the same units as the target variable, which simplifies communication of model performance. For instance, if a temperature forecasting model has an RMSE of 2°C, developers can intuitively understand that predictions deviate from actual temperatures by about 2°C on average. Unlike Mean Absolute Error (MAE), which averages absolute errors, RMSE penalizes larger errors more heavily due to the squaring step. This makes RMSE a better choice when large errors are especially undesirable, such as in demand forecasting where underestimating peak demand could lead to costly stockouts. However, this sensitivity also means RMSE can be misleading if the dataset contains occasional extreme outliers, as they disproportionately influence the result.

Consider a concrete example: predicting daily website traffic. Suppose actual values for three days are [500, 600, 700], and predictions are [520, 580, 690]. The errors are [20, -20, -10]. Squaring these gives [400, 400, 100], averaging to 300. The square root of 300 is approximately 17.3, so the RMSE is 17.3 visits. This tells developers that, on average, predictions are off by about 17 visits, with larger errors weighted more heavily. When using RMSE, it’s important to pair it with domain context and complementary metrics like MAE to assess whether large errors are acceptable or indicative of model flaws. For developers, implementing RMSE is straightforward in code (e.g., using Python’s sklearn.metrics.mean_squared_error with squared=False), making it a practical tool for model evaluation.

Like the article? Spread the word