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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call