• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Time-Series Forecasting: Predicting Stock Prices Using Facebook’s Prophet Model

December 16, 2020 by systems

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 of predicting 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.

An example of a time-series. The plot was 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 intend in any way to “direct” people into buying stocks.

1.2 The forecasting model: Facebook’s Prophet

The most commonly used models for forecasting predictions are the autoregressive models. Briefly, the autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term (an imperfectly predictable term).

Recently, in an attempt to develop a model that could capture seasonality in time-series data, Facebook developed the famous Prophet model that is publicly available for everyone. In this article, we will use this state-of-the-art model: the Prophet model. Prophet is able to capture daily, weekly and yearly seasonality along with holiday effects by implementing additive regression models.

The mathematical equation behind the Prophet model is defined as:

y(t) = g(t) + s(t) + h(t) + e(t)

  • with, g(t) representing the trend. Prophet uses a piecewise linear model for trend forecasting.
  • s(t) represents periodic changes (weekly, monthly, yearly).
  • h(t) represents the effects of holidays (recall: Holidays impact businesses).
  • e(t) is the error term.

The Prophet model fitting procedure is usually very fast (even for thousands of observations) and it does not require any data pre-processing. It also deals with missing data and outliers.

In this article, we are going to use the Prophet mode to predict Google’s stock price in the future.

Let’s get started!

Filed Under: Machine Learning

Primary Sidebar

Google Photos for Android gets revamped interface for tablets

Understanding Machine Learning

Machine Learning Kya h(story continues….)

SwitchTransformer: стероидная гонка в NLP

Metrics for Evaluating Classification Models

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2021 NEO Share

Terms and Conditions - Privacy Policy