SPGF: The Sign-Power Generalized Forecast — When Getting the Direction Matters More Than the Exact Number

SPGF: The Sign-Power Generalized Forecast — When Getting the Direction Matters More Than the Exact Number

By Dimitrios Thomakos

Every forecaster faces a fundamental question: what do I actually care about? Most forecasting methods are obsessed with getting the number exactly right—minimizing the average squared error. But in many real-world decisions, especially in finance, economics, and policy, the question is not "how much will it change?" but primarity "will it go up or down?" Getting the direction right can matter far more than getting the magnitude exactly correct. Yet, surprisingly, there has been no unified forecasting framework that lets you choose—explicitly, mathematically, and optimally—which of these goals you're actually pursuing. This working paper attempts to bridge this gap.

Our paper introduces the Sign-Power Generalized Forecast (SPGF), a forecasting framework that is surprisingly simple yet remarkably flexible. At its core is the sign-power transform: instead of just using the past observation itself, you first ask whether it was positive or negative, then raise its magnitude to a power of your choosing. This tiny tweak has enormous consequences. When the power is one, you recover the standard linear forecast. When the power is small, you effectively ignore magnitude and focus purely on direction—useful in volatile markets. When the power is large, you amplify big moves, capturing momentum or leverage effects. This one-parameter knob lets you tune your forecast to the specific nature of your data; critically, this new forecast functional encompasses many well known standard forecasting benchmarks, including the naive forecast, the naive with drift forecast, momentum and the linear AR(1) forecast. But the real innovation is that the SPGF framework simultaneously optimizes this transformation alongside three fundamentally different goals: minimizing squared error (the traditional statistician's approach), minimizing absolute error (more robust to outliers), and maximizing directional accuracy (perfect for traders and decision-makers who care about up versus down). The framework shows, mathematically and rigorously, that these three goals lead to genuinely different optimal forecasts—and the differences are not minor technicalities but reflect deep structural properties of how your data behave.

From Theory to Code: Two Complete, Audited Python Implementations

Theory is only half the story. To make the SPGF framework actually useful, we've built two complete, production-ready Python implementations that bring every aspect of the paper to life. The first is a self-contained script that does everything end-to-end: it pulls real financial data from Yahoo Finance, fits the copula-based dependence model (our mathematical engine for capturing how past observations influence future ones), runs a rolling backtest where forecasts are made using only historical data with no cheating, and produces a comprehensive report with all the important metrics—not just traditional error measures, but also directional accuracy, economic performance (like information ratio and cumulative profit and loss), and a suite of diagnostic tests that check whether the underlying assumptions actually hold for your data.

The second implementation is a modular Python package that separates everything into logical components: copulas for dependence modelling, estimators for fitting the SPGF parameters, forecasters (including benchmarks like AR(1) and the Theta method), a backtesting engine, diagnostic tests, statistical tests, data loading, and reporting. This modularity makes it easy to extend, modify, or integrate into larger projects. We've provided three entry points: one for running controlled experiments on synthetic data (to verify everything works as expected), one for financial returns (the natural domain for directional forecasting), and most importantly, a generic entry point for *any* univariate time series—whether it's temperature readings, retail sales, energy demand, or any other data you have in a CSV file. You can point it at your data, choose which loss function you care about, and get a complete evaluation with just a few commands.

Both implementations are audited for forward-looking bias: no future data ever enters the training process. The backtest uses expanding or rolling windows, refits models periodically to keep them current, and handles errors gracefully with configurable fallback policies. They're fast enough for daily use, fully documented, and ready to run. Whether you're an academic researcher exploring nonlinear forecasting, a practitioner needing a robust forecasting tool, or just someone curious about how better forecasting works, the code is there for you to use, adapt, and build upon. The paper and the code together provide a complete, reproducible research asset that bridges the gap between theory and practice—and lets you choose exactly what you want to optimize in your forecasting.

SPGF: The Sign-Power Generalized Forecast
SPGF
SPGF_Master

More by Dimitrios Thomakos

View All ➜