Git Product home page Git Product logo

petr4.sa-forecasting's Introduction

PETR4.SA Forecasting

Open in colab GitHub license

A collection of PIBIC 2020-2021 codes. Statistical models of time series analysis applied to stock market predictions, compared to CNN and LSTM forecasts. Trading simulation with PETR4.SA stocks. This repository includes the scientific paper (along with the LaTeX project) written at the end of the project, documenting the steps in more detail.

The PETR4.SA historical data is available on Yahoo Finance: https://finance.yahoo.com/quote/PETR4.SA/history?p=PETR4.SA

Topic of the PIBIC: "Evaluation of the Performance of Deep Learning Techniques for the Classification of the Temporal Behavior of Shares".

Tested Models

  • SMA 10, 30 & 50 (Simple Moving Average of 10, 30 and 50 days)
  • Autorregressive model (AR)
  • ARMA model
  • ARIMA model
  • Naive 1 & 5 (Naive model of 1 and 5 days)
  • CNN (Convolutional Neural Network)
  • LSTM (Long Short-Term Memory)

Models Results

SMA10 SMA30 SMA50 AR ARMA(2,0,2) ARIMA(5,0,2) Naive1 Naive5 CNN LSTM
Accuracy 0.589431 0.540650 0.520325 0.626016 0.491870 0.508130 0.491870 0.520325 0.544715 0.524390
MSE 0.550165 1.392854 2.068185 0.126310 0.272212 0.293134 0.244692 1.064078 4.456264 1.356165
R2 0.798460 0.489760 0.242368 0.953729 0.953729 0.891471 0.910363 0.610200 -0.632448 0.503201

Trading Results

AR ARMA(2,0,2) ARIMA(5,0,2) CNN LSTM
Final Wallet 134110.0150 105564.99850 110709.9910 110859.9835 103360.0075
Wallets Diff 34110.0150 5564.99850 10709.9910 10859.9835 3360.0075
% Wallets Diff 1.3411 1.05565 1.1071 1.1086 1.0336
Score 43.0000 21.00000 25.0000 35.0000 16.0000
Loss 23.0000 41.00000 38.0000 22.0000 17.0000

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.