Skip to main content

Forecasting Using ARIMA, SARIMA, and the Additive Model

  • Chapter
  • First Online:
Implementing Machine Learning for Finance

Abstract

Time-series analysis is a method for explaining sequential problems. It is convenient when a continuous variable is time-dependent. In finance, we frequently use it to discover consistent patterns in the market data and forecast future prices. This chapter offers a comprehensive introduction to time-series analysis. It first conceals ways of finding stationary in a series using the augmented Dickey-Fuller (ADF) test and testing for white noise and autocorrelation. Second, it conceals techniques of succinctly summarizing the patterns in time-series data using smoothening, such as the moving average technique and exponential technique. Third, it properly covers the estimation of rates of return on investment. Last, it covers hyperparameters optimization and model development and evaluation. This chapter enables you to design, develop, and test time-series analysis models like the autoregressive integrated moving average (ARIMA) model, seasonal ARIMA (SARIMA) model, and additive model, to identify patterns in currency pairs and forecast future prices. In this chapter, we use pandas_datareader to scrape financial data from Yahoo Finance, and we use conda install -c anaconda pandas-datareader. For time-series modeling, we use the statsmodel library, which is pre-installed in the Python environment. We also use pmdarima, which is an extension of statsmodels. To install it in the Python environment, we use pip install pmdarima; in the conda environment, we use conda install -c saravji pmdarima. Lastly, we use FB Prophet for high-quality time-series analysis. To install it in the Python environment, we use pip install fbprophet; in the conda environment, we use conda install -c conda-forge fbprophet. Before you install fbprophet, ensure that you first install pystan. To install pystan, we use conda install -c conda-forge pystan.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Nokeri, T.C. (2021). Forecasting Using ARIMA, SARIMA, and the Additive Model. In: Implementing Machine Learning for Finance. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7110-0_2

Download citation

Publish with us

Policies and ethics