Forecasting with Uncertainty: Probabilistic Models

Forecasting with Uncertainty: Probabilistic Models

Simor Consulting | 05 Dec, 2024 | 03 Mins read

Traditional forecasting methods produce point estimates—single values representing the most likely outcome. This approach fails to capture inherent uncertainty, leading to overconfidence in decision-making. Probabilistic forecasting predicts entire probability distributions rather than single values.

The Limitations of Point Forecasts

Point forecasts have fundamental limitations:

  1. False precision: They imply certainty where none exists
  2. Limited risk assessment: No information about the range of possible outcomes
  3. Asymmetric costs: They ignore that overestimation and underestimation have different consequences
  4. Tail risks: They fail to account for low-probability, high-impact events
  5. Evaluation challenges: They make it difficult to assess forecast quality over time

Compare these forecasts:

  • “Sales will be 10,000 units next month”
  • “There’s a 70% chance sales will be between 8,500 and 11,300 units, with a median of 10,000”

The second approach provides richer understanding of potential outcomes.

Probabilistic Forecasting Approaches

1. Bayesian Time Series Models

Bayesian approaches incorporate uncertainty through prior distributions:

# Bayesian structural time series model with PyMC3
import pymc3 as pm
import numpy as np

np.random.seed(42)
n_points = 100
time = np.arange(n_points)
level = 10 + 0.1 * time

with pm.Model() as model:
    # Priors
    alpha = pm.Normal('alpha', mu=0, sigma=10)
    beta = pm.Normal('beta', mu=0, sigma=1)
    sigma = pm.HalfNormal('sigma', sigma=1)

    # Likelihood
    mu = alpha + beta * time
    y = pm.Normal('y', mu=mu, sigma=sigma, observed=level + np.random.randn(n_points) * 0.5)

    trace = pm.sample(1000, tune=500)

2. Quantile Regression

Predicting quantiles of the distribution:

# Quantile regression for prediction intervals
from sklearn.linear_model import QuantileRegressor
import numpy as np

# Fit models for different quantiles
quantiles = [0.1, 0.25, 0.5, 0.75, 0.9]
models = {}

for q in quantiles:
    qr = QuantileRegressor(quantile=q, alpha=1.0)
    qr.fit(X_train, y_train)
    models[q] = qr

# Generate prediction intervals
predictions = {}
for q, model in models.items():
    predictions[q] = model.predict(X_test)

3. Ensemble Methods

Combining multiple models for robust uncertainty:

# Ensemble of models with different assumptions
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor
from sklearn.linear_model import Ridge

models = [
    ('rf', RandomForestRegressor(n_estimators=100)),
    ('gb', GradientBoostingRegressor(n_estimators=100)),
    ('ridge', Ridge())
]

ensemble_predictions = []
for name, model in models:
    model.fit(X_train, y_train)
    ensemble_predictions.append(model.predict(X_test))

# Prediction intervals from ensemble spread
lower = np.percentile(ensemble_predictions, 10, axis=0)
upper = np.percentile(ensemble_predictions, 90, axis=0)
median = np.median(ensemble_predictions, axis=0)

4. Deep Learning for Uncertainty

Neural networks with uncertainty quantification:

# Dropout as uncertainty estimation
import torch
import torch.nn as nn

class UncertaintyNetwork(nn.Module):
    def __init__(self, input_dim):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, 64)
        self.fc2 = nn.Linear(64, 64)
        self.fc3 = nn.Linear(64, 1)
        self.dropout = nn.Dropout(0.1)

    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.dropout(x)
        x = torch.relu(self.fc2(x))
        x = self.dropout(x)
        return self.fc3(x)

# Multiple forward passes with dropout give uncertainty estimates
predictions = []
for _ in range(100):
    with torch.no_grad():
        predictions.append(model(X_test).numpy())

predictions = np.array(predictions)
mean_pred = predictions.mean(axis=0)
std_pred = predictions.std(axis=0)

Implementing Uncertainty Forecasts

1. Choose Appropriate Quantiles

Different decisions require different uncertainty information:

  • Inventory planning: Need full distribution for stock-out risk
  • Revenue forecasting: Focus on downside risk (lower quantiles)
  • Capacity planning: Upper quantiles for resource allocation

2. Validate Uncertainty Estimates

Test that prediction intervals actually contain expected proportion of outcomes:

def evaluate_prediction_intervals(y_true, lower, upper, confidence=0.9):
    """Check if prediction intervals contain expected proportion of outcomes."""
    within_interval = (y_true >= lower) & (y_true <= upper)
    coverage = within_interval.mean()

    expected_coverage = confidence
    is_calibrated = abs(coverage - expected_coverage) < 0.05

    return {
        'coverage': coverage,
        'expected': expected_coverage,
        'calibrated': is_calibrated
    }

3. Communicate Uncertainty Effectively

Present uncertainty in actionable formats:

  • Distribution plots: Show full probability distributions
  • Fan charts: Display prediction intervals at multiple confidence levels
  • Risk metrics: Value at Risk (VaR), Conditional Value at Risk (CVaR)
  • Scenario tables: List specific scenarios with probabilities

Business Applications

Financial Forecasting

Challenge: Predicting revenue with uncertainty for budget planning.

Approach: Quantile regression for prediction intervals, scenario analysis for strategic planning.

Results: Budget ranges instead of point estimates, quantified downside risk.

Demand Forecasting

Challenge: Inventory planning with uncertain demand.

Approach: Probabilistic forecasting with quantile predictions, service level optimization.

Results: Optimal stock levels based on desired service level, reduced stockouts.

Capacity Planning

Challenge: Resource allocation with uncertain future demand.

Approach: Ensemble methods with scenario planning, risk-adjusted capacity decisions.

Results: Flexible capacity plans with contingency options.

Common Pitfalls

  1. Overconfidence: Prediction intervals too narrow
  2. Ignoring correlation: Uncertainty in multiple forecasts may be correlated
  3. Stationarity assumptions: Past uncertainty may not reflect future uncertainty
  4. Communication gaps: Decision-makers may misinterpret uncertainty

Decision Rules

Use these guidelines for applying probabilistic forecasting:

When to use point forecasts:

  • When the cost of being wrong is symmetric and small
  • When decisions are reversible
  • When stakeholders require simple numbers

When to use probabilistic forecasts:

  • When the cost of being wrong is asymmetric
  • When decisions are hard to reverse
  • When tail risks matter
  • When planning for multiple scenarios

Ready to Implement These AI Data Engineering Solutions?

Get a comprehensive AI Readiness Assessment to determine the best approach for your organization's data infrastructure and AI implementation needs.

Similar Articles

Data Pipelines for Time Series Forecasting
Data Pipelines for Time Series Forecasting
21 Mar, 2024 | 02 Mins read

Time series forecasting requires specialized pipeline architecture. Unlike standard batch processing, time series work demands strict chronological ordering, historical context, time-based feature eng

Time-Series Forecasting Pipelines: From TSDB to Model Monitoring
Time-Series Forecasting Pipelines: From TSDB to Model Monitoring
01 Aug, 2025 | 04 Mins read

An energy company's AI predicted electricity demand would peak at 6 PM, as typical. The first game of the World Cup had millions turning on TVs at 4 PM, creating an unprecedented spike their models co