Coder Social home page Coder Social logo

yklin / metropolis-hasting-wgan-on-stock-prediction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chickenbenny/metropolis-hasting-wgan-on-stock-prediction

1.0 0.0 0.0 1.81 MB

Use metropolis hasting to enhance gan on stock prediction

License: MIT License

Python 3.17% Jupyter Notebook 96.83%

metropolis-hasting-wgan-on-stock-prediction's Introduction

This repository try to use Metropolis-Hastings Algorithm and WGAN to do the stock prediction.

๐Ÿ’จ Quick start

  1. Clone the repositroy and enter the folder
$ git clone [email protected]:ChickenBenny/Metropolis-Hasting-WGAN-on-stock-prediction.git
$ cd Metropolis-Hasting-WGAN-on-stock-prediction
  1. Set up the virtual environment
$ python -m venv venv
  • Windows
$ venv\Scripts\activate
  • Mac / Linux
$ source venv/bin/activate
  1. Install package
$ pip install -r requirements.txt
  1. Run the demo notebook. However, GAN is an unstable model, so you may need to run it for a longer period of time or adjust the hyperparameters to obtain better results.

๐Ÿ”ฝ Reference

  1. Metropolis-Hastings GAN : https://arxiv.org/abs/1811.11357
  2. Wasserstein GAN : https://arxiv.org/abs/1701.07875
  3. Repo from borisbanushev : https://github.com/borisbanushev/stockpredictionai
  4. Stock price prediction using Generative Adversarial Networks : https://thescipub.com/abstract/jcssp.2021.188.196

๐ŸŒŸ Idea

Incorporate the ideas from Boris Banushev's repository, as it focuses on implementing GAN-based models for stock prediction. These models leverage the power of GANs' ability to generate realistic and diverse samples, making them suitable for handling stock market dynamics, especially during high-volatility situations.

  1. Try using GAN to predict stock prices and simulate the stock distribution.
  2. Try enhancing the sampling process using the Metropolis-Hastings algorithm to achieve better convergence and explore a broader range of parameter values.
  3. Attempt to improve the prediction accuracy by employing a VAE to extract latent variables and enhance the prediction effect.

๐Ÿ–ฅ๏ธ Result

  • RMSE and MAE from testing dataset

    RMSE MAE
    2.077 1.673

๐Ÿ‘€ Pros and Cons

  • Pros
    1. Improve the stability of WGAN model.
    2. Improve the adaptability of the model.
    3. Might capture comple or highly volatile distributions.
  • Cons
    1. Computational complexity and sesitivity to hyperparameters.
    2. Data limitations and highly dependency on data quailty.

๐Ÿ™ˆ Notice

The model exhibits instability and high volatility. Therefore, if you are interested in making stock predictions using GAN-based models, it is recommended to fine-tune the hyperparameters, explore various data preprocessing techniques, or consider alternative models.

License

MIT ยฉ ChickenBenny

metropolis-hasting-wgan-on-stock-prediction's People

Contributors

chickenbenny avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.