ds-brx / Time-series-analysis-project

Time series analysis on NIFTY-50 index stock data. The project visualises trends in stock data and explores various time-series analysis models such as ARIMA, ARMA and deep learning models such as LTSM and RNN to predict stock prices with the highest accuracy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time-series Analysis : Nifty-50 stock price dataset

Time series analysis enables us to visualize trends in stock prices, seasonality, autocorrelations and hence predict subsequent prices and trends. These insights are essential for many financial and non financial companies, portfolio analysis etc. In this notebook, I have explored various feature engineering techniques and models exclusive to time series data.
Please find the link to my kaggle notebook here: https://www.kaggle.com/breenda/lstm-rnn-arimax-ar-models-and-analysis


Goal of this project was to explore the techniques to handle stock data. I started of with visualizing the various parameters to get an idea of the trends in data, seasonality, if its present etc. Next, I explored a few engineering techniques to generate exogenous features. Then I used models such as ARIMA, Autoregressors, LSTMs and RNNs to see which models best predict the target variable.

Dataset

https://www.kaggle.com/rohanrao/nifty50-stock-market-data

Libraries Used:

  • Statsmodels
  • Keras
  • Numpy
  • Pandas
  • Sci-kit learn
  • Sci-py
  • pmdarima
  • Matplotlib
  • Seaborn
  • Features:

    1. Series: Here EQ stands for equity series of stock market.
    2. Prev Close: The closing price of the stock for the day before.
    3. Open,High, Low, Last, Close: The opening price, highest price, lowest price, last price and closing price of ICICI shares on the current day.
    4. VWAP: Volume Weighted Average Price,the target variable to predict. VWAP is a trading benchmark used by traders that gives the average price the stock has traded at throughout the day, based on both volume and price.
    5. Volume: Volume of shares traded on the current day.
    6. Turnover: It is a measure of stock liquidity calculated by dividing the total number of shares traded over a period by the average number of shares outstanding for the period.
    7. Trades: total number of trades on the current day.
    8. Deliverable Volume: is the quantity of shares which actually move from one set of people to another set of people.
    9. Deliverable(%): Deliverable volume in percentage.

    Feature analysis:

  • Trends in VWAP, Trades and Turnovers over a period of 20 years
  • Box Cox Plot of VWAP
  • Exogenous features generated by moving average smoothing and rolling of features
  • Auto Correlation plots
  • Stationarity of the data by Augmented Dickey-Fuller test
  • Decomposition to study trends and seasonality in VWAP
  • Models explored:

  • Statsmodels Autoregressors: rmse score - 32.30
  • pmdarima ARIMAX: rmse score - 82.27 mae score - 55.83
  • keras LSTM sequential model: rmse score - 0.046 mae score- 0.0370
  • keras RNN sequential model: rmse score - 0.046 mae score- 0.0624
  • About

    Time series analysis on NIFTY-50 index stock data. The project visualises trends in stock data and explores various time-series analysis models such as ARIMA, ARMA and deep learning models such as LTSM and RNN to predict stock prices with the highest accuracy.


    Languages

    Language:Jupyter Notebook 100.0%