hongwai1920 / Using-ARIMA-model-to-forecast-returns

Implement ARIMA and ARFIMA to forecast returns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using ARIMA model to forecast returns

This repository contains a detailed theoretical and practical application to time series analysis models such as AutoRegressive (AR), Moving Average (MA), AutoRegressive Moving Average (ARMA), AutoRegressive Integrated Moving Average (ARIMA) and AutoRegressive Fractionally Integrated Moving Average (ARFIMA).

As stationarity is important in using those time series models, we introduced and implemented several stationarity tests such as Augmented Dickey-Fuller (ADF) test and KPSS. We mainly use Python's library statsmodels to implement all models above and use the ARIMA model to forecast future stock prices.

All datasets in csv are obtained from Yahoo Finance. The following describe the contents in each notebook.

This notebook gives a flavour of how to use ARIMA to predict stock prices. The following is a plot of using ARIMA(5,2,0) to predict Apple'stock price with mean square error 1.640.

This notebook introduces time series. The following four time series are the open, high, low and close prices of Apple's stock.

This notebook introduces stochastic processes, autocorrelation function (ACF) and partial autocorrelation function (PACF) of a stochastic process. Lastly, we also discuss white noise stochastic process. The following plots contain time series, histogram, ACF and PACF graphs of a white noise generated by standard normal distribution.

This notebook introduces stationarity, an important concept in time series analysis. We differentiate those time series which exhibit stationarity and those who do not by using stationarity tests such as Augmented Dickey-Fuller test (ADF) and Kwiatkowski–Phillips–Schmidt–Shin (KPSS) tests.

This notebook introduces AR, MA and ARMA models in time series analysis. The following contains time series generated by AR, MA and ARMA models with their corresponding ACF and PACF.

We also discuss information criteria for Selecting ARMA hyperparameters p and q. Particularly, we can use AIC, BIC and HQIC to select p and q to fit a given time series to do prediction.

This notebook introduces the ARIMA model, its assumptions and implementations. We fit the model to several datasets such as Apple, Amazon and bitcoin to predict their future prices. After fitting, we perform residual diagnostic to determine model's goodness of fit.

As ARIMA requires integer value of time series differencing to obtain stationarity, This notebook introduces a generalization of ARIMA model, called ARFIMA, which allows non-integer time series differencing. We implement and fit ARFIMA to data TSLA obtained from quandl. Then following combine both original prices and differenced prices of the TSLA stock.

About

Implement ARIMA and ARFIMA to forecast returns


Languages

Language:Jupyter Notebook 100.0%