Time series · model comparison
Forecasting MSFT Returns
0.000875
test MSE (ARIMA) · 62.2% directional accuracy
Returns are close to noise, so this project is really about disciplined comparison: chronological splits, one shared feature set, both error and directional accuracy, and a simple trading backtest to see whether predictions carry any usable signal.
Pipeline
- Features come from MSFT, IBM and GOOGL, the S&P 500, DJIA and VIX, USD/JPY and USD/GBP, plus gold and oil returns, treasury change and Bitcoin return, technical indicators (RSI, MACD, Bollinger width, ATR, rate of change) and a 52-week rolling beta against SPY.
- Target is the forward 5-day log return. Splits are chronological (80/20) and cross-validation uses TimeSeriesSplit so folds never look into the future.
- Models: ARIMA(1,0,0) with exogenous regressors, LASSO, Elastic Net, KNN, tree ensembles, boosting, SVR, and a small LSTM (5-step sequences, 32 hidden units).
Findings
- ARIMA had the lowest MSE and LASSO/Elastic Net were nearly as good, with the best directional accuracy (64.9%). The LSTM, XGBoost and Random Forest did worse.
- A long/short strategy driven by ARIMA predictions was backtested with cumulative return, Sharpe ratio and maximum drawdown against buy-and-hold.
- The takeaway I would defend: on small, noisy financial data, regularised linear and classical models are hard to beat, and MSE alone hides directional usefulness.
Stack
Statsmodelsscikit-learnPyTorchyfinanceta