1. Introduction

1.1. Time-series & forecasting models

Traditionally most machine learning (ML) models use as input features some observations (samples / examples) but there is no time dimension in the data.

Time-series forecasting models are the models that are capable to predict future values based on previously observed values. Time-series forecasting is widely used for non-stationary data. **Non-stationary data **are called the data whose statistical properties e.g. the mean and standard deviation are not constant over time but instead, these metrics vary over time.

These non-stationary input data (used as input to these models) are usually called **time-series. **Some examples of time-series include the temperature values over time, stock price over time, price of a house over time etc. So, the input is a signal (time-series) that is defined by observations taken sequentially in time.

A time series is a sequence of observations taken sequentially in time.

Image for post

An example of a time-series. Plot created by the author in Python.

Observation: Time-series data is recorded on a discrete time scale.

**Disclaimer **(before we move on): There have been attempts to predict stock prices using time series analysis algorithms, though they still cannot be used to place bets in the real market. This is just a tutorial article that does not intent in any way to “direct” people into buying stocks.


2. The LSTM model

Long short-term memory (LSTM) is an artificial recurrent neural network (RNN) architecture used in the field of deep learning. Unlike standard feedforward neural networks, LSTM has feedback connections. It can not only process single data points (e.g. images), but also entire sequences of data (such as speech or video inputs).

LSTM models are able to store information over a period of time.

In order words, they have a memory capacity. Remember that LSTM stands for Long Short-Term Memory Model.

This characteristic is extremely useful when we deal with Time-Series or Sequential Data. When using an LSTM model we are free and able to decide what information will be stored and what discarded. We do that using the “gates”. The deep understanding of the LSTM is outside the scope of this post but if you are interested in learning more, have a look at the references at the end of this post.

#lstm #forecasting #machine-learning #recurrent-neural-network #stock-market #deep learning

 Predicting Stock Prices Using An LSTM Model
2.20 GEEK