📉 Time Series Forecasting 📈

View on GitHub

S&P 500 index forecasting using various Time Series models

This project intends to build different time series models (ARIMA, LSTM...) in order to forecast the S&P 500 index monthly price.

Read More

View on GitHub

Age pyramid forecast for the Moroccan population

The goal of this project is to provide a reasonable forecast for the age pyramid of Morocco's population by 2050, based on government data and using ARIMA models.

Read More

Time-series forecasting is the practice of using historical data points, ordered chronologically, to predict future values. It underpins decision-making in finance, economics, public health, and resource planning. The central challenge lies in capturing the temporal patterns, trends, seasonality, and noise hidden within sequential observations, and selecting a model that generalizes well to unseen future data rather than simply memorizing the past.

The projects in this section compare two fundamentally different approaches to time-series prediction. On the statistical side, the Auto-Regressive Integrated Moving Average (ARIMA) family of models decomposes a series into autoregressive and moving-average components after differencing to achieve stationarity. On the deep learning side, Long Short-Term Memory (LSTM) networks use gated recurrent cells to learn long-range dependencies in sequential data without requiring manual feature engineering. By applying both methods to the same datasets, you can directly compare their strengths and limitations in terms of prediction accuracy, model interpretability, training time, and overall computational cost.

The first project forecasts the S&P 500 stock index using ARIMA, SARIMA, and LSTM models, evaluating each with metrics such as RMSE and MAE on held-out test periods. The notebook walks through data collection, visualization of historical trends, the Augmented Dickey-Fuller test for stationarity, hyperparameter selection via grid search, and residual diagnostics to verify that model assumptions are met. The second project models Morocco's population age pyramid out to 2050, using government census data and ARIMA-based projections for each age cohort. It demonstrates how demographic data can be decomposed by age group and modeled independently, then reassembled into a full population pyramid for long-range policy analysis and resource planning.

Both notebooks include thorough exploratory data analysis, stationarity tests, model diagnostics, and visualizations of predicted versus actual values so you can assess forecast quality and replicate the analysis with your own data. By the end of these projects you will understand when a classical statistical model is sufficient and when a neural network approach offers meaningful gains, equipping you to choose the right tool for your own forecasting problems. All code runs on Google Colab with one click, and every dependency is version-pinned so the experiments remain fully reproducible over time.