Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 2.58 KB

File metadata and controls

51 lines (40 loc) · 2.58 KB

Trading-With-Bayesian-LSTM

Hugging Face

This repository contains the implementation of a Bayesian Long Short-Term Memory (Bayesian LSTM) model designed to predict hourly log returns and estimate both Epistemic and Aleatoric uncertainty for major cryptocurrency assets (SOL, BTC, and DOGE).

This project is part of a Master's Thesis in Mathematics (Statistics Concentration) at Andalas University.

🧠 Model Features

  • Bayesian Inference: Built using blitz-bayesian-pytorch for Variational Inference.
  • Uncertainty Estimation: Quantifies market noise (aleatoric) and model confidence (epistemic) using Monte Carlo Sampling.
  • Feature Engineering: Includes log returns, volatility metrics, and cyclical time encoding (sin/cos).
  • Multi-Asset: Pre-trained weights and artifacts for Solana (SOL), Bitcoin (BTC), and Dogecoin (DOGE).

📂 Repository Structure

  • data: The data used in this research.
  • notebooks: Jupyter notebook file for model development.
  • requirements.txt: Necessary libraries.

📈 Performance Summary

Results based on backtesting process using Bayesian LSTM model for trading strategy on the test data (Jan 2025 - Nov 2025):

Asset RMSE Sharpe Ratio PICP (95% CI)
Solana (SOL) 0.0094 0.7631 0.7631
Bitcoin (BTC) 0.0048 -0.0112 -0.0112
Dogecoin (DOGE) 0.0103 0.8999 0.8999

📈 Detailed Backtesting Results

Click to expand: Cumulative Returns of gain from Bitcoin

Backtesting Plot

Click to expand: Cumulative Returns of gain from Solana

Backtesting Plot

Click to expand: Cumulative Returns of gain from Dogecoin

Backtesting Plot

Download the models at HuggingFace.