GithubHelp home page GithubHelp logo

abhi-37 / stock-price-prediction Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 289 KB

Find stock price in real time

R 100.00%
autoarima descriptive-analysis predictive-analysis r-programming time-series stock-market stockprice

stock-price-prediction's Introduction

Time Series Analysis and Forecasting of Stock Prices

This repository contains an R script for the time series analysis and forecasting of TCS.NS stock prices. The analysis includes data fetching, time series conversion, differencing, stationarity checks, ARIMA modeling, and forecasting.

This project demonstrates a complete workflow for analyzing and forecasting stock prices using the TCS.NS stock from Yahoo Finance. The steps involved are:

  1. Data Fetching: Retrieve historical stock prices for TCS.NS from Yahoo Finance.
  2. Time Series Conversion: Convert the fetched data into a timeSeries object for analysis.
  3. Differencing: Calculate the first differences of the stock prices to make the time series stationary.
  4. Stationarity Check: Perform the Augmented Dickey-Fuller test to confirm stationarity.
  5. Identifying AR and MA Processes: Plot the Auto-Correlation Function (ACF) and Partial Auto-Correlation Function (PACF) to identify AR and MA components.
  6. ARIMA Modeling: Use the auto.arima function to find the best fitting ARIMA model.
  7. Forecasting: Forecast future stock prices using the identified ARIMA model.
  8. Visualization: Plot the actual and forecasted values using ggplot2.

Libraries Used

  • timeSeries
  • timeDate
  • quantmod
  • fUnitRoots
  • forecast
  • ggplot2

Getting Started

Prerequisites

Make sure you have the following R packages installed:

  • timeSeries
  • timeDate
  • quantmod
  • fUnitRoots
  • forecast
  • ggplot2

Conclusion

This script provides a systematic approach to time series analysis and forecasting of stock prices. By modifying the stock symbol and date range, users can adapt the script to analyze and forecast the prices of other stocks. Ensure to follow the steps carefully and make necessary adjustments for different datasets.

stock-price-prediction's People

Contributors

abhi-37 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.